{"id":2007,"date":"2015-12-16T01:03:35","date_gmt":"2015-12-16T01:03:35","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2007"},"modified":"2024-01-12T12:28:31","modified_gmt":"2024-01-12T20:28:31","slug":"database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/","title":{"rendered":"Database on Amazon:  Connecting Couchbase Sync Gateway to Couchbase AMI on AWS"},"content":{"rendered":"<p style=\"text-align: justify\">Following up from the blog where we <a href=\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-installing-couchbase-ami-on-aws\/\">installed the Couchbase AMI<\/a> (Amazon Machine Image) on AWS, we will now explore how to connect <a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/current\/develop\/guides\/sync-gateway\/index.html\">Couchbase Sync Gateway<\/a> to Couchbase Server that is running on Amazon EC2 in a working mobile application.<\/p>\n<h3 style=\"text-align: justify\"><strong>[1]\u00a0 Couchbase Web Console<\/strong><\/h3>\n<p style=\"text-align: justify\">To see our Couchbase Server instance and the Data Buckets we will log into the Couchbase Web Console, which we did in <a href=\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-installing-couchbase-ami-on-aws\/\">Step 4 of the previous blog<\/a>.\u00a0 When you log in and click on the &#8216;Server Nodes&#8217; tab, you will see the Couchbase Server instance running.\u00a0 This is spung from the Couchbase AMI when we launched it from the AWS marketplace.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3065\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/failoverwarning.png\" alt=\"failoverwarning\" width=\"1434\" height=\"312\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/failoverwarning.png 1434w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/failoverwarning-300x65.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/failoverwarning-1024x223.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/failoverwarning-768x167.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/failoverwarning-20x4.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/failoverwarning-1320x287.png 1320w\" sizes=\"auto, (max-width: 1434px) 100vw, 1434px\" \/><\/p>\n<p style=\"text-align: justify\">Also you will see the Data Buckets tab that has pre-configured buckets from the AMI installations.\u00a0 For this blog where we will connect together Couchbase Sync Gateway to Couchbase Server and the first thing we need to do is to modify one of the data bucket names.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3066\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/databuckets1.png\" alt=\" databuckets1\" width=\"1448\" height=\"346\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets1.png 1448w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets1-300x72.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets1-1024x245.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets1-768x184.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets1-20x5.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets1-1320x315.png 1320w\" sizes=\"auto, (max-width: 1448px) 100vw, 1448px\" \/><\/p>\n<p style=\"text-align: justify\">To modify the name of our bucket, we will first click on the arrow next to the bucket name to drop down the bucket&#8217;s information like shown below.\u00a0 Then we will click on the &#8216;Edit&#8217; button to bring us to the configuration menu.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3067\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/databuckets2.png\" alt=\"databuckets2\" width=\"1354\" height=\"826\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets2.png 1354w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets2-300x183.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets2-1024x625.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets2-768x469.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets2-20x12.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets2-1320x805.png 1320w\" sizes=\"auto, (max-width: 1354px) 100vw, 1354px\" \/><\/p>\n<p style=\"text-align: justify\">Next in our &#8216;Configure Bucket&#8217; menu, we will change the name of our Bucket Name field value to be &#8216;todolite&#8217; as this will be our target for the mobile application to point to.\u00a0 Make the bucket naming modification while leaving everything else and then click on &#8216;Save&#8217; in the bottom right as shown below.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3068\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/configurebuckets.png\" alt=\"configurebuckets\" width=\"842\" height=\"1180\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/configurebuckets.png 842w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/configurebuckets-214x300.png 214w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/configurebuckets-731x1024.png 731w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/configurebuckets-768x1076.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/configurebuckets-300x420.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/configurebuckets-14x20.png 14w\" sizes=\"auto, (max-width: 842px) 100vw, 842px\" \/><\/p>\n<p style=\"text-align: justify\">Now you should be seeing two data buckets in the Data Buckets tab where one of them is the &#8216;todolite&#8217; bucket that we will be using next in our application.<\/p>\n<h3 style=\"text-align: justify\"><strong>[2]\u00a0 Connecting to Couchbase AWS instance <\/strong><\/h3>\n<p style=\"text-align: justify\">Next we will need to obtain the &#8216;Public IP&#8217; from the AWS console.\u00a0 You may reference <a href=\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-installing-couchbase-ami-on-aws\/\">Step 4 of the previous blog<\/a> again in getting to the AWS web console where the Public IP can be obtained.\u00a0 Once you locate the Couchbase instance that is running, copy down the Public IP address.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3069\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/launchinstance.png\" alt=\"launchinstance\" width=\"1608\" height=\"356\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/launchinstance.png 1608w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/launchinstance-300x66.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/launchinstance-1024x227.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/launchinstance-768x170.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/launchinstance-1536x340.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/launchinstance-20x4.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/launchinstance-1320x292.png 1320w\" sizes=\"auto, (max-width: 1608px) 100vw, 1608px\" \/><\/p>\n<p style=\"text-align: justify\">Open up your terminal application and locate the folder where you stored the private key pair file that you downloaded previously.\u00a0 This would be a .pem extension file and you would need to be in that folder to connect to the Couchbase instance on AWS.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3070\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/macbookpro.png\" alt=\"macbookpro\" width=\"306\" height=\"30\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro.png 306w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro-300x29.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro-20x2.png 20w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/><\/p>\n<p style=\"text-align: justify\">Your key must not be publicly viewable for SSH to work and a command to run if needed would be:<!--cke_bookmark_733S--><!--cke_bookmark_733E--><\/p>\n<p><!--cke_bookmark_762S--><\/p>\n<pre><code class=\"language-command language-bash\">chmod 400 'name_of_key.pem'\r\n<\/code><\/pre>\n<p><!--cke_bookmark_762E--><\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3071\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/macbookpro2.png\" alt=\"macbookpro2\" width=\"476\" height=\"20\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro2.png 476w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro2-300x13.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro2-450x20.png 450w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro2-20x1.png 20w\" sizes=\"auto, (max-width: 476px) 100vw, 476px\" \/><\/p>\n<p style=\"text-align: justify\">From the previous example, the .pem file was named &#8216;couchbase_aws&#8217; and so the command to run is &#8216;chmod 400 couchbase_aws.pem&#8217;<\/p>\n<p style=\"text-align: justify\">Next we will SSH into our Amazon Linux AMI and we will do that from the location of our private key folder.\u00a0 The command to run would be:<\/p>\n<p><!--cke_bookmark_659S--><\/p>\n<pre><code class=\"language-command language-bash\">ssh -i \"name_of_key.pem\" ec2-user@\"public_ip\"\r\n<\/code><\/pre>\n<p><!--cke_bookmark_659E--><\/p>\n<p style=\"text-align: justify\">where the &#8220;name_of_key.pem&#8221; and &#8220;public_ip&#8221; will be respectively your own that you have named and have from the Amazon web console.\u00a0 This is illustrated below in the terminal console screen.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3072\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/macbookpro3.png\" alt=\"macbookpro3\" width=\"812\" height=\"200\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro3.png 812w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro3-300x74.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro3-768x189.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro3-20x5.png 20w\" sizes=\"auto, (max-width: 812px) 100vw, 812px\" \/><\/p>\n<h3 style=\"text-align: justify\"><strong>[3]\u00a0 Modify Sync Gateway Config file<\/strong><\/h3>\n<p style=\"text-align: justify\">The last step before we connect the Couchbase Sync Gateway and Couchbase Server together is to modify the Couchbase Sync Gateway Configuration file.\u00a0 The config.json content that we need is located on the <a href=\"https:\/\/github.com\/couchbaselabs\/ToDoLite-Android\/blob\/master\/sync-gateway-config.json\">GitHub ToDoLite repo<\/a> and we will need to copy the content from that repo and bring it into our config.json file in our AWS instance.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3073\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/macbookpro4.png\" alt=\" macbookpro4\" width=\"1248\" height=\"48\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro4.png 1248w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro4-300x12.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro4-1024x39.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro4-768x30.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro4-20x1.png 20w\" sizes=\"auto, (max-width: 1248px) 100vw, 1248px\" \/><\/p>\n<p style=\"text-align: justify\">We will open our configuration file named &#8216;config.json&#8217; and paste the content from the <a href=\"https:\/\/github.com\/couchbaselabs\/ToDoLite-Android\/blob\/master\/sync-gateway-config.json\">&#8216;sync-gateway-config.json&#8217; file<\/a> located in the ToDoLite repo.\u00a0 Below we show the content of what the config.json will have after we execute the command in the Terminal app:\u00a0 nano config.json<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3074\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/macbookpro5.png\" alt=\"macbookpro5\" width=\"1504\" height=\"1120\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro5.png 1504w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro5-300x223.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro5-1024x763.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro5-768x572.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro5-20x15.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro5-1320x983.png 1320w\" sizes=\"auto, (max-width: 1504px) 100vw, 1504px\" \/><\/p>\n<p style=\"text-align: justify\">You will notice that there is a slight modification and difference with this config.json file that is shown above than what we have in the GitHub repo.\u00a0 The &#8220;server&#8221; value is now &#8216;https:\/\/localhost:8091&#8217; as oppose to &#8216;walrus&#8217; which is a simple, limited, <a href=\"https:\/\/www.couchbase.com\/resources\/concepts\/in-memory-database\/\">in-memory database<\/a> that was used in place of Couchbase Server.\u00a0 You may read more about using Walrus during development over at the <a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/current\/develop\/guides\/sync-gateway\/deployment\/during-development\/index.html\">Mobile Portal<\/a>.\u00a0 Walrus can be used for unit testing but for us here, we are going to have Sync Gateway target Couchbase Server on our local AWS instance in the cloud which is located on port: &#8216;8091&#8217;.\u00a0 We modify the server value to be:<\/p>\n<p><!--cke_bookmark_825S--><\/p>\n<pre><code class=\"language-command language-bash\">\"server\" : \"https:\/\/localhost:8091\" ,\r\n<\/code><\/pre>\n<p><!--cke_bookmark_825E--><\/p>\n<p style=\"text-align: justify\">You will also notice that the &#8220;databases&#8221; value has &#8220;todolite&#8221; which is specifically the Data Bucket that we have created or modified in our Couchbase Web Console in step 1 of this blog.\u00a0 This Sync Gateway is now ready to target the specific data bucket named &#8216;todolite&#8217; which is located on our Couchbase Server instance in AWS on port &#8216;8091&#8217;.\u00a0 execute together &#8216;control+x&#8217; on the keyboard to exit out of the &#8216;nano&#8217; program and save the changes you have made to the config.json file.<\/p>\n<h3 style=\"text-align: justify\"><strong>[4]\u00a0 Running Couchbase Mobile Application<\/strong><\/h3>\n<p style=\"text-align: justify\">Now that we have the Sync Gateway configuration file, config.json, ready for our application; the next step will be to point our mobile application to the end point we wish to target.\u00a0 <a href=\"https:\/\/github.com\/couchbaselabs\/ToDoLite-Android\">Download the ToDoLite Couchbase Mobile sample application<\/a> found on GitHub and for this blog we will reference the Android version.\u00a0 There is an iOS ToDoLite version as well and the steps to connecting the application to Couchbase Sync Gateway and Couchbase Server are similar.\u00a0 You may reference the Mobile Portal <a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/current\/get-started\/get-started-mobile\/android\/building-todo-lite\/index.html\">guide on how to Build ToDoLite in Android<\/a>.\u00a0 We will assume that you have the mobile application running on your device or emulator and our next step is to modify the Sync URL.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3075\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/macbookpro6.png\" alt=\"macbookpro6\" width=\"1766\" height=\"462\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro6.png 1766w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro6-300x78.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro6-1024x268.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro6-768x201.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro6-1536x402.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro6-20x5.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro6-1320x345.png 1320w\" sizes=\"auto, (max-width: 1766px) 100vw, 1766px\" \/><\/p>\n<p style=\"text-align: justify\">To modify our Sync URL, we will locate our &#8216;BuildConfig.java&#8217; file and you may do that by clicking on the magnifying glass icon on the topic right within Android Studio and type in &#8216;BuildConfig.java&#8217;, press enter and open up the file.\u00a0 You should see the above where the SYNC_URL_HTTP variable is pointing to &#8220;https:\/\/demo.couchbasemobile.com:4984\/todolite\/&#8221; end point.\u00a0 This is a demo box that we have setup originally but now since you have your own Couchbase Sync Gateway and Couchbase Server instance on AWS, we will modify that accordingly and point it to the instance you have set up.\u00a0 To do that first locate the &#8216;Public DNS&#8217; on your Amazon web console as this will be your target instance.\u00a0 You may <a href=\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-installing-couchbase-ami-on-aws\/\">reference Step 4 of the AMI blog<\/a> on how and where to obtain the Public DNS.\u00a0 The Sync Gateway listens on port 4984 for the Sync API commands and the data bucket we are targeting is named &#8216;todolite&#8217;; therefore for the modified Sync URL we will have the structure to be:<\/p>\n<pre><code class=\"language-command language-bash\"><span style=\"color: #cc7832\">public static final <\/span>String <span style=\"color: #9876aa;font-style: italic\">SYNC_URL_HTTP <\/span>= <span style=\"color: #6a8759\">\"https:\/\/'Public DNS':4984\/todolite\/\"<\/span><span style=\"color: #cc7832\">;<\/span>\r\n<\/code><\/pre>\n<p style=\"text-align: justify\">where the &#8216;Public DNS&#8217; is your own that is obtained from the AWS console.\u00a0 Now before you build and run your mobile application you would need to start the Sync Gateway from within your EC2 instance.<\/p>\n<h3 style=\"text-align: justify\"><strong>[5]\u00a0 Start Sync Gateway<\/strong><\/h3>\n<p style=\"text-align: justify\">From within the Terminal application, log into your EC2 instance that we did towards the end of Step 2 of this blog and add a path to your &#8216;.bash_profile&#8217; file.\u00a0 You should be in your user directory &#8216;\/home\/ec2-user&#8217; and then execute &#8216;nano .bash_profile&#8217; like below<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3076\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/macbookpro7.png\" alt=\"macbookpro7\" width=\"1280\" height=\"358\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro7.png 1280w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro7-300x84.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro7-1024x286.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro7-768x215.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/macbookpro7-20x6.png 20w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/p>\n<p style=\"text-align: justify\">Next you will add an additional line to the &#8216;.bash_profile&#8217; file so that you can access the Couchbase Sync Gateway program from anywhere within your instance without having to type out the entire path of the Sync Gateway location.\u00a0 The location of Sync Gateways is located in &#8216;\/opt\/couchbase-sync-gateway\/bin&#8217; when the Couchbase AMI got created and the additonal line you would add is:<\/p>\n<pre><code class=\"language-command language-bash\">PATH=$PATH:\/opt\/couchbase-sync-gateway\/bin\r\n<\/code><\/pre>\n<p style=\"text-align: justify\">From within the nano program, you can reference the image below on where the PATH value is added.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3077\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/exportpath.png\" alt=\"exportpath\" width=\"1176\" height=\"402\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/exportpath.png 1176w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/exportpath-300x103.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/exportpath-1024x350.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/exportpath-768x263.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/exportpath-20x7.png 20w\" sizes=\"auto, (max-width: 1176px) 100vw, 1176px\" \/><\/p>\n<p style=\"text-align: justify\">Execute &#8216;control+x&#8217; on the keyboard to exit out of nano and save the changes you have made to the &#8216;.bash_profile&#8217; file.\u00a0 Exit out of the instance by typing in &#8216;exit&#8217; and hit &#8216;enter&#8217; on the keyboard and then SSH back in so that you now have the PATH in your profile.\u00a0 And if you wish to access the directory of where the Sync Gateway is located, you may follow below starting from within your user directory &#8216;\/home\/ec2-user&#8217;.\u00a0 The green arrow points to the actual Sync Gateway program that we will be running.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3078\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/syncgateway.png\" alt=\"syncgateway\" width=\"1536\" height=\"290\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/syncgateway.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/syncgateway-300x57.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/syncgateway-1024x193.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/syncgateway-768x145.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/syncgateway-20x4.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/syncgateway-1320x249.png 1320w\" sizes=\"auto, (max-width: 1536px) 100vw, 1536px\" \/><\/p>\n<p style=\"text-align: justify\">Finally we are ready to run Sync Gateway from within our EC2 instance and we will return back to the directory where our &#8216;config.json&#8217; file is located as we will need to specify the configuration we wish to run our Couchbase Sync Gateway against.\u00a0 Follow the commands below to return back to the &#8216;\/home\/ec2-user&#8217; directory and run:<\/p>\n<pre><code class=\"language-command language-bash\">sync_gateway config.json\r\n<\/code><\/pre>\n<p style=\"text-align: justify\">This is shown below as the last command.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3079\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/lastcommand.png\" alt=\" lastcommand\" width=\"1622\" height=\"164\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/lastcommand.png 1622w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/lastcommand-300x30.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/lastcommand-1024x104.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/lastcommand-768x78.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/lastcommand-1536x155.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/lastcommand-20x2.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/lastcommand-1320x133.png 1320w\" sizes=\"auto, (max-width: 1622px) 100vw, 1622px\" \/><\/p>\n<p style=\"text-align: justify\">After we execute our Sync Gateway against the &#8216;config.json&#8217; file, we will see the below information about our configurations where the Couchbase Server and Couchbase Sync Gateway are now both ready for our mobile application to replicate data against at the appropriate ports.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3080\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/image1.png\" alt=\"image1\" width=\"1662\" height=\"260\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/image1.png 1662w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/image1-300x47.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/image1-1024x160.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/image1-768x120.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/image1-1536x240.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/image1-20x3.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/image1-1320x206.png 1320w\" sizes=\"auto, (max-width: 1662px) 100vw, 1662px\" \/><\/p>\n<h3 style=\"text-align: justify\"><strong>[6]\u00a0 Replicate Data to Couchbase Sync Gateway and Server<\/strong><\/h3>\n<p style=\"text-align: justify\">Finally we can run our Android ToDoLite application and sync data against our Couchbase Sync Gateway and Couchbase Server in the cloud.\u00a0 Recall that the Couchbase Mobile stack consists of Couchbase Lite, the embedded JSON database that is consumed within the ToDoLite project and we have now setup our Sync Gateway and Server to be targeted by the application.\u00a0 This was done from within Android Studio by modifying the &#8216;SYNC_URL_HTTP&#8217; variable from within the &#8216;BuildConfig.java&#8217; file.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3081\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/couchbaselite.png\" alt=\"couchbaselite\" width=\"1626\" height=\"622\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbaselite.png 1626w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbaselite-300x115.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbaselite-1024x392.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbaselite-768x294.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbaselite-1536x588.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbaselite-20x8.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/couchbaselite-1320x505.png 1320w\" sizes=\"auto, (max-width: 1626px) 100vw, 1626px\" \/><\/p>\n<p style=\"text-align: justify\">From within Android Studio we will launch two separate instances of the application and log in with two separate users.\u00a0 This would allow us to show replication across the two different instances.\u00a0 We will launch one with the stock Android emulator and another using <a href=\"https:\/\/www.genymotion.com\/\">Genymotion<\/a> as shown below.\u00a0 Upon logging in and sharing the list across to the users, you are able to see that not only the list is shared across but the task that is entered is replicated to both client devices.<\/p>\n<p style=\"text-align: justify\">Below we have a List named &#8216;Couchbase AMI&#8217; that we created by entering and sharing to users on the same database.\u00a0 From within the list, we created a task named &#8216;Replicate Data&#8217; and the title got sync accordingly through Couchbase Sync Gateway.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3082\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/nexusscreenshot.png\" alt=\"nexusscreenshot\" width=\"1217\" height=\"920\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/nexusscreenshot.png 1217w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/nexusscreenshot-300x227.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/nexusscreenshot-1024x774.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/nexusscreenshot-768x581.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/nexusscreenshot-20x15.png 20w\" sizes=\"auto, (max-width: 1217px) 100vw, 1217px\" \/><\/p>\n<p style=\"text-align: justify\">Another place to see this replication working is to open up the Couchbase web console again where you will see the Data Buckets populate with the Task item title that you created.\u00a0 Log into the Couchbase console and click on Data Buckets tab as we did in Step 1.\u00a0 Click on the arrow pointing to &#8216;todolite&#8217; and then click &#8216;Documents&#8217; like below.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3083\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/databuckets3.png\" alt=\"databuckets3\" width=\"1716\" height=\"1044\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets3.png 1716w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets3-300x183.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets3-1024x623.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets3-768x467.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets3-1536x934.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets3-20x12.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/databuckets3-1320x803.png 1320w\" sizes=\"auto, (max-width: 1716px) 100vw, 1716px\" \/><\/p>\n<p style=\"text-align: justify\">Upon opening up the &#8216;Documents&#8217;, you will see all the documents that are created when we entered a task into the list from within out &#8216;ToDoLite&#8217; mobile applicaton.\u00a0 If you click and open a document, you will see the type, &#8216;task&#8217; that was created and we named the title here in this example to be, &#8220;Replicate Data&#8221; as shown below.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3084\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/todolite.png\" alt=\" todolite\" width=\"1128\" height=\"890\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/todolite.png 1128w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/todolite-300x237.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/todolite-1024x808.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/todolite-768x606.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2015\/12\/todolite-20x16.png 20w\" sizes=\"auto, (max-width: 1128px) 100vw, 1128px\" \/><\/p>\n<p style=\"text-align: justify\">Congratulations!\u00a0 You have now got Couchbase as a service running on Amazon AWS and also have a mobile application, ToDoLite, running against Couchbase Sync Gateway and Couchbase Server in production.\u00a0 You are able to sync data across both Android client devices using the Sync Gateway through the config.json file configurations and while having the data stored on the server in the cloud.\u00a0 You can read more about the Couchbase Lite APIs over on our <a href=\"https:\/\/developer.couchbase.com\/mobile\/\">Mobile Developer Portal<\/a> and also on <a href=\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-installing-couchbase-ami-on-aws\/\">how to install the Couchbase AMI<\/a> from part 1.<\/p>\n<p style=\"text-align: justify\">\n","protected":false},"excerpt":{"rendered":"<p>Following up from the blog where we installed the Couchbase AMI (Amazon Machine Image) on AWS, we will now explore how to connect Couchbase Sync Gateway to Couchbase Server that is running on Amazon EC2 in a working mobile application. [&hellip;]<\/p>\n","protected":false},"author":30,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1810],"tags":[],"ppma_author":[8983],"class_list":["post-2007","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-mobile"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.7.1 (Yoast SEO v25.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Connecting Couchbase Sync Gateway to Couchbase AMI on AWS<\/title>\n<meta name=\"description\" content=\"The post focuses on how to connect the Couchbase Sync Gateway to Couchbase Server that is running on Amazon EC2 in a working mobile application.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Database on Amazon: Connecting Couchbase Sync Gateway to Couchbase AMI on AWS\" \/>\n<meta property=\"og:description\" content=\"The post focuses on how to connect the Couchbase Sync Gateway to Couchbase Server that is running on Amazon EC2 in a working mobile application.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-16T01:03:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-12T20:28:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/failoverwarning.png\" \/>\n<meta name=\"author\" content=\"William Hoang, Mobile Developer Advocate, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"William Hoang, Mobile Developer Advocate, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/\"},\"author\":{\"name\":\"William Hoang, Mobile Developer Advocate, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/425717456c198fdf9aaa5d7a6d42ad32\"},\"headline\":\"Database on Amazon: Connecting Couchbase Sync Gateway to Couchbase AMI on AWS\",\"datePublished\":\"2015-12-16T01:03:35+00:00\",\"dateModified\":\"2024-01-12T20:28:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/\"},\"wordCount\":1898,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"articleSection\":[\"Couchbase Mobile\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/\",\"name\":\"Connecting Couchbase Sync Gateway to Couchbase AMI on AWS\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2015-12-16T01:03:35+00:00\",\"dateModified\":\"2024-01-12T20:28:31+00:00\",\"description\":\"The post focuses on how to connect the Couchbase Sync Gateway to Couchbase Server that is running on Amazon EC2 in a working mobile application.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Database on Amazon: Connecting Couchbase Sync Gateway to Couchbase AMI on AWS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/425717456c198fdf9aaa5d7a6d42ad32\",\"name\":\"William Hoang, Mobile Developer Advocate, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/650445f1ea30314c4f3555dd680154f5\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g\",\"caption\":\"William Hoang, Mobile Developer Advocate, Couchbase\"},\"description\":\"William was a Developer Advocate on the Mobile Engineering\/Developer Experience team at Couchbase. His love for coffee and code has transcended him into the world of mobile while appreciating the offline in-person experiences. Prior, William worked on the Developer Relations team over at Twitter, BlackBerry, and Microsoft while also having been a Software Embedded GPS engineer at Research In Motion. William graduated from McGill University in Electrical Software Engineering\",\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/william-hoang\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Connecting Couchbase Sync Gateway to Couchbase AMI on AWS","description":"The post focuses on how to connect the Couchbase Sync Gateway to Couchbase Server that is running on Amazon EC2 in a working mobile application.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/","og_locale":"en_US","og_type":"article","og_title":"Database on Amazon: Connecting Couchbase Sync Gateway to Couchbase AMI on AWS","og_description":"The post focuses on how to connect the Couchbase Sync Gateway to Couchbase Server that is running on Amazon EC2 in a working mobile application.","og_url":"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/","og_site_name":"The Couchbase Blog","article_published_time":"2015-12-16T01:03:35+00:00","article_modified_time":"2024-01-12T20:28:31+00:00","og_image":[{"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2015\/12\/failoverwarning.png","type":"","width":"","height":""}],"author":"William Hoang, Mobile Developer Advocate, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"William Hoang, Mobile Developer Advocate, Couchbase","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/"},"author":{"name":"William Hoang, Mobile Developer Advocate, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/425717456c198fdf9aaa5d7a6d42ad32"},"headline":"Database on Amazon: Connecting Couchbase Sync Gateway to Couchbase AMI on AWS","datePublished":"2015-12-16T01:03:35+00:00","dateModified":"2024-01-12T20:28:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/"},"wordCount":1898,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","articleSection":["Couchbase Mobile"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/","url":"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/","name":"Connecting Couchbase Sync Gateway to Couchbase AMI on AWS","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2015-12-16T01:03:35+00:00","dateModified":"2024-01-12T20:28:31+00:00","description":"The post focuses on how to connect the Couchbase Sync Gateway to Couchbase Server that is running on Amazon EC2 in a working mobile application.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/database-on-amazon-connecting-couchbase-sync-gateway-to-couchbase-ami-on-aws\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Database on Amazon: Connecting Couchbase Sync Gateway to Couchbase AMI on AWS"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/425717456c198fdf9aaa5d7a6d42ad32","name":"William Hoang, Mobile Developer Advocate, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/650445f1ea30314c4f3555dd680154f5","url":"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g","caption":"William Hoang, Mobile Developer Advocate, Couchbase"},"description":"William was a Developer Advocate on the Mobile Engineering\/Developer Experience team at Couchbase. His love for coffee and code has transcended him into the world of mobile while appreciating the offline in-person experiences. Prior, William worked on the Developer Relations team over at Twitter, BlackBerry, and Microsoft while also having been a Software Embedded GPS engineer at Research In Motion. William graduated from McGill University in Electrical Software Engineering","url":"https:\/\/www.couchbase.com\/blog\/author\/william-hoang\/"}]}},"authors":[{"term_id":8983,"user_id":30,"is_guest":0,"slug":"william-hoang","display_name":"William Hoang, Mobile Developer Advocate, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g","author_category":"","last_name":"Hoang","first_name":"William","job_title":"","user_url":"","description":"William was a Developer Advocate on the Mobile Engineering\/Developer Experience team at Couchbase. His love for coffee and code has transcended him into the world of mobile while appreciating the offline in-person experiences. Prior, William worked on the Developer Relations team over at Twitter, BlackBerry, and Microsoft while also having been a Software Embedded GPS engineer at Research In Motion. William graduated from McGill University in Electrical Software Engineering"}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2007","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2007"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2007\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=2007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2007"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}