Installation under Docker

Requirements

  • Docker 1.0.1+

Installation steps

Quickstart cluster

  • Get Zato Dockerfile
host$ mkdir -p ~/zato-docker && cd ~/zato-docker && wget -i \
      https://raw.githubusercontent.com/zatosource/zato-build/master/docker/quickstart/filelist
  • Build Zato Docker image
host$ sudo docker build --no-cache -t zato-3.0 .
  • Create a container in which Zato components will be launched:
host$ sudo docker run -it --rm -p 22 -p 6379:6379 -p 8183:8183 -p 17010:17010 -p 17011:17011 \
        -p 11223:11223 --name zato zato-3.0
  • Retrieve your dynamically generated passwords. The first one is to Zato web-admin, the other is for ssh connections.
host$ sudo docker exec zato /bin/bash -c 'cat /opt/zato/web_admin_password \
        /opt/zato/zato_user_password'

That concludes the process - a web-admin instance is running on http://localhost:8183 and you can log into it with the username ‘admin’ using the password printed on the terminal above.

You can also connect via SSH to the container under which Zato is running. User: zato. Password: second one of the two printed on terminal above.

Hot-deployment with mounted volumes

Directory /opt/hot-deploy inside the container can be mapped to a local one on host. Any service placed inside the local directory will be automatically deployed to all servers in the cluster in the container.

For instance, to map local directory /my/services to /opt/hot-deploy in the container, start the container as below:

host$ sudo docker run -it --rm -p 22 -p 6379:6379 -p 8183:8183 -p 17010:17010 -p 17011:17011 \
    -p 11223:11223 -v /my/services/:/opt/hot-deploy/ --name zato zato-3.0

Importing enmasse definitions

A starting container can import enmasse definitions with objects that the cluster running in the container should use.

In this manner, channels, connections and other pieces of a cluster’s configuration can be recreated each time a new container is spun up.

In order for a container to read in an enmasse file, it needs to be made available to the container through a mounted volume which is next used by the ZATO_ENMASSE_FILE environment variable.

For instance:

  • On host, there is a directory called /my/enmasse
  • In the container, this directory will be mapped to /opt/enmasse
  • Inside the host’s directory, there will be an enmasse file called export.yml
  • To automatically import definitions from this file, configuration such as below should be used - mapping volumes and then exporting the file’s full location, from the container’s perspective, to an environment variable
host$ sudo docker run -it --rm -p 22 -p 6379:6379 -p 8183:8183 -p 17010:17010 -p 17011:17011 \
    -p 11223:11223 -v /my/services/:/opt/hot-deploy/ \
    -v /my/enmasse/:/opt/enmasse/ -e ZATO_ENMASSE_FILE=/opt/enmasse/export.yml \
    --name zato zato-3.0

Environment variables available

The Zato image uses several environment variables which can be used to fine-tune the resulting installation.

They are not required to use, and default values will be substituted if any is missing, but they may be employed to configure particular details of each of the components.

Variable Notes
ZATO_SSH_PASSWORD Password for user zato to access through ssh. If not defined, the value is generated automatically at runtime.
ZATO_WEB_ADMIN_PASSWORD Password for the web admin’s technical account user to connect with. If not defined, the value is generated automatically at runtime.
ZATO_IDE_PUBLISHER_PASSWORD Password for user ide_publisher, used for IDE integration. If not defined, the value has to be set manually.
ZATO_ENMASSE_FILE Full path to an enmasse file with object definitions to been imported.
REDIS_HOSTNAME Redis service hostname. Default value is localhost.
ODB_TYPE ODB type to use. Must be one of: mysql, postgresql or sqlite. Default value is sqlite.
ODB_HOSTNAME ODB hostname.
ODB_PORT ODB port.
ODB_NAME ODB database.
ODB_USERNAME ODB username.
ODB_PASSWORD ODB password.