Introducción
In this fourth post about the Couchbase Móvil stack, we’ll go over installing Pasarela de sincronización.
Look for other posts in my “Getting Comfortable with Couchbase Mobile” series to learn everything you need to get the whole Couchbase Mobile stack up and running on your development machine. (Links provided at the end.)
Fondo
To get comfortable with the whole stack, it’s great to install and run everything on one machine. In this series of posts, I’ll walk through the steps get to started with each component. I’ll show how to do a little extra exploring along the way, too.
I’ll only do minimal configuration. This is not intended to explain what you need for a production environment. I assume you’re familiar with some basics of NoSQL, have some understanding of Couchbase, and know how to build apps in something like Java,
Android, or iOS. If you want to read up on NoSQL databases or Couchbase, you can find lots of resources on the Couchbase sitio.
Couchbase es de código abierto. Todo lo que usaré aquí es gratis para probar. Mira al final del post para más recursos si necesitas ayuda.
Pasarela de sincronización
Sync Gateway es una aplicación web segura con APIs de sincronización, REST, stream, batch y eventos para acceder y sincronizar datos a través de la web. Sync Gateway permite, entre otras cosas, la replicación segura de datos entre Couchbase Server y
Couchbase Lite.
Sync Gateway tiene pocas dependencias y puede ejecutarse en la mayoría de las distribuciones de Linux (incluso en Raspberry Pi), Windows y OSX/macOS. Los pasos específicos para la instalación varían según la plataforma. Consulte el descargas para todos los paquetes disponibles, y el guía completa de instalación for complete details. To install
on Linux distributions other than the supported ones, see esta entrada.
I will walk through a simplified installation on OSX next.
OSX
Initial Installation Steps
To install Sync Gateway, first download the gzipped tar file for Mac aquí. You’ll get a file named something like couchbase-sync-gateway-enterprise_1.3.1.1-1_x86_64.tar.gz.
Unpack the archive, either by double-clicking on the file in Finder, or, from the command line, using the following:
1 |
$ alquitrán xzf couchbase-sincronizar-pasarela-empresa_1.3.1.1-1_x86_64.tar.gz |
This creates a number of files. We’ll only be concerned with the sync_gateway binary and the example configuration files.
Open a command line shell (e.g. Terminal). Change your working directory to the location where you unpacked the archive. In my case, I put them under my home directory in workspace/servers/couchbase-sync-gateway
.
1 |
$ cd ~/workspace/servidores/couchbase-sincronizar-pasarela |
Start Sync Gateway running using one of the example configuration files.
1 |
$ ./papelera/sync_gateway ejemplos/básico-couchbase-cubo.json |
You should see output that looks something like this:
1 2 3 4 5 6 |
2016-09-15T15:07:13.356-07:00 Enabling registro: [*] 2016-09-15T15:07:13.356-07:00 ==== Couchbase Sincroniza Pasarela/1.3.1(16;f18e833) ==== ... 2016-09-15T15:07:13.535-07:00 Inicio admin servidor en 127.0.0.1:4985 2016-09-15T15:07:13.539-07:00 Inicio servidor en :4984 ... 2016-09-15T15:07:14.659-07:00 Changes+: Notifying que "por defecto" cambiado (llaves="{_sync:user:}") cuente=2 |
That’s all it takes to get Sync Gateway up and going. The example configuration file I used here has the settings you need to use the other examples I will give in this and the related blogs.
This one requires you have Couchbase Server up and running at the same time. If you want to try Sync Gateway running stand alone, use
1 |
$ ./papelera/sync_gateway ejemplos/básico-morsa-cubo.json |
instead.
Checking Your Installation
To verify Sync Gateway is running, you can do a couple of things.
From the command line, use rizo
to check the welcome message as follows:
1 |
$ rizo localhost:4985 |
You should see output that looks something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
HTTP/1.1 200 OK Contenido-Longitud: 144 Contenido-Tipo: aplicación/json Fecha: Jue, 15 Sep 2016 22:09:54 GMT Servidor: Couchbase Sincroniza Pasarela/1.3.1 { "ADMIN": verdadero, "couchdb": "Bienvenido", "vendedor": { "nombre": "Pasarela Couchbase Sync", "version": 1.3 }, "version": "Couchbase Sync Gateway/1.3.1(16;f18e833)" } |
Access the administrative interface by navigating in a browser to http://localhost:4985/_admin/.
You’ll see this top level page:
If you click on db under the database list, you’ll see this page:
The links here will allow you to see quite a lot of interesting information while Sync Gateway is running. We’ll explore more when we look at the full stack operating together.
Enlaces útiles
Finally, here are some other pages to explore to find out more about Sync Gateway.
https://developer.couchbase.com/documentation/mobile/current/installation/sync-gateway/index.html
https://developer.couchbase.com/documentation/mobile/current/guides/sync-gateway/index.html
https://github.com/couchbase/sync_gateway/wiki
Próximos pasos
In the next post in this series I’ll show some ways to work with Sync Gateway from the command line. This will help both under how Sync Gateway works, and give you some tools for diagnosing common problems and mistakes. Then we’ll look at a sample app using Couchbase Lite. Finally, we’ll use that sample app to loop back and see how everything ties together.
[buttongroup][button style=”btn-link btn-lg” icon=”fa fa-arrow-left” align=”left” iconcolor=”#dd3333″ type=”link” target=”false” title=”Previous: Couchbase Server via the Command Line” link=”https://www.couchbase.com/blog/getting-comfortable-couchbase-mobile-couchbase-server-command-line/” linkrel=””][button style=”btn-link btn-lg” icon=”fa fa-arrow-right” align=”left” iconcolor=”#dd3333″ type=”link” target=”false” title=”Next: Sync Gateway via the Command Line” link=”https://www.couchbase.com/blog/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line/” linkrel=””][/buttongroup]
Posdata
Consulte más recursos en nuestra portal para desarrolladores y síganos en Twitter @CouchbaseDev.
Puede enviar preguntas a nuestro foros. Y participamos activamente en Stack Overflow.
Puede seguirme personalmente en @HodGreeley
[…] Couchbase Server and Couchbase Lite and/or PouchDB. For a quick guide on installing it, check this guide. If Sync Gateway is installed, it’ll be accessible from the http://localhost:4984 when […]
[…] Previous: Installing Sync Gateway Next: TBD […]
[…] The Couchbase Mobile Stack comprises the Couchbase Server, Couchbase Sync Gateway and Couchbase Lite embedded Database. You can learn more about the server in the Getting started with Couchbase Server guide and the Sync Gateway in the Getting Started with Couchbase Sync Gateway guide. […]
[…] follow instructions in the blog post to install the the Sync Gateway in your Mac OS development environment. See the downloads site for all the available packages, and […]
[…] If you want to learn more about setting up Sync Gateway on your development machine, or how to work with it from the command line, take a look at this blog series. […]