The Couchbase Mobile Stack

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:

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.

Start Sync Gateway running using one of the example configuration files.

You should see output that looks something like this:

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

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:

You should see output that looks something like this:

Access the administrative interface by navigating in a browser to http://localhost:4985/_admin/.

You’ll see this top level page:

Sync Gateway Admin Interface Welcome

If you click on db under the database list, you’ll see this page:

Sync Gateway Admin Interface Database View

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.

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://developer.couchbase.com/documentation/mobile/current/references/sync-gateway/rest-common/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

Autor

Publicado por Hod Greeley, Defensor del Desarrollador, Couchbase

Hod Greeley es desarrollador de Couchbase y vive en Silicon Valley. Tiene más de dos décadas de experiencia como ingeniero de software y director de ingeniería. Ha trabajado en una variedad de campos de software, incluyendo física computacional y química, seguridad informática y de redes, finanzas y móviles. Antes de unirse a Couchbase en 2016, Hod dirigió las relaciones con desarrolladores para móviles en Samsung. Hod es doctor en física química por la Universidad de Columbia.

5 Comentarios

  1. […] 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 […]

  2. […] 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. […]

  3. […] 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 […]

  4. […] 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. […]

Dejar una respuesta