코우치베이스 모바일

vagrant up: Running Couchbase and Couchbase Sync Gateway with Vagrant

In this blog, we will explore how to run Couchbase and Couchbase Sync Gateway using Vagrant.  Before beginning, you will need to have VirtualBox 그리고 Vagrant installed locally on your machine.  Download those two software first before proceeding as you will need them to install Couchbase.  At the time of writing, I am running:

  • Vagrant:  Version 1.7.4
  • VirtualBox:  Version 5.0.10

Running Couchbase VM:

Create a directionary to work from and then from within the folder, bring in the Couchbase software distribution that is defined in a ‘Vagrantfile’ configuration file and also an associated ‘.box’ file.  You will need both these files in the directory before continuing and can find those files located in the direct ZIP download.  The next step is to set up Sync Gateway and we will do that by executing:

Disregard any warnings or connection timeouts as this process takes some time to setup.  To see the list of VM instances that are running or if ever you wish to restart/poweroff a VM, then you can execute the command:

For the example here, the name and UUID of the VirtualBox Vagrant VM that is running Sync Gateway is, ‘test_Sync_Gateway-1’ and ‘83305d4f-5fa8-4523-8037-48142b9d7ebf’ respectively which I got from running the previous command.  You should see a similar output as above before continuing.

Optionally, if you would like to shut off the VM and restart again from the beginning of the tutorial then run the command below and reference the VM UUID of interest.

Now if you check for the list of running machines, you should see none that are outputted like below.

Connect to VM:

With the ‘test_Sync_Gateway-1_…’ running, we can take a look at the status of our VM and what is running by executing:

Now we are ready to log into our machine and look at starting Sync Gateway. To do that, first we ‘SSH’ into our instance by running:

Let us take a look at the content we have in our VM.

The folder ‘finished’ contains completed code files that we will reference. Taking a look also on what is available, let us execute:

We can start our Sync Gateway by calling the script ‘start-Sync_Gateway-configured.sh’ and passing in the JSON parameter that defines our Sync Gateway configurations.

Couchbase Admin UI:

Now that you have Sync Gateway started, you are able to log into the Couchbase Admin UI.  This is located at:

https://10.111.72.101:8091/index.html

  • Username:  관리자
  • Password:   비밀번호

Open a browser and type in the URL end point and the above credentials to log in.  You would need to be connected to the VM and also have started Sync Gateway at this point to be able to login.

Click on ‘Data Buckets’ section to see that the ‘todos’ bucket details from within the Couchbase portal.  The current configurations have been set up to target the sample ToDoLite mobile application (안드로이드 | iOS) that is running 코우치베이스 라이트.

Of course there are many other ways to set up Couchbase Sync Gateway and Couchbase Server.  You can opt for running both software from your own machine using the binaries downloaded from Couchbase or you can use the Couchbase AMI on AWS and then connect the Couchbase Sync Gateway accordingly.  Either way, you are able to quickly have a scalable solution up and running that supports a full offline mobile user experience across various platforms.  In the next blog, we explore how to do that!

이 기사 공유하기

작가

윌리엄은 카우치베이스의 모바일 엔지니어링/개발자 경험 팀에서 개발자 옹호자로 활동했습니다. 커피와 코딩에 대한 그의 사랑은 오프라인 대면 경험의 가치를 높이 평가하면서 그를 모바일의 세계로 이끌었습니다. 이전에 윌리엄은 리서치 인 모션(Research In Motion)에서 임베디드 GPS 소프트웨어 엔지니어로 근무했으며, 트위터, 블랙베리, 마이크로소프트의 개발자 relations 팀에서 일했습니다. 윌리엄은 맥길 대학교에서 전기소프트웨어공학을 졸업했습니다.

댓글 남기기

카우치베이스 카펠라를 시작할 준비가 되셨나요?

개발 시작하기

NoSQL을 탐색하고, 리소스를 찾아보고, 튜토리얼을 시작하려면 개발자 포털을 확인하세요.

카펠라 프리 사용하기

단 몇 번의 클릭으로 카우치베이스(Couchbase)를 직접 체험해 보세요. Capella DBaaS는 시작하기 가장 쉽고 빠른 방법입니다.

연락해

Couchbase 제품군에 대해 더 알고 싶으신가요? 저희가 도와드리겠습니다.