There are several ways to install Zato services
A new entry needs to be added to that file for each new source that a starting server should pick up the services from.
A rollout using service-sources.text can take a couple of forms:
A Python module containing one or more services can be installed from command line, this will make it available on all servers from a given cluster regardless of which server picks up the Python module to import - the information will be propagated automatically.
A service which has been installed in such a way will survive the server’s restart.
Only flat Python modules can be hot-deployed. (Use zato_extra_paths to install arbitrary Python code).
server.conf’s option beginning with hot_deploy.* all describe the details of where to listen for new services to be installed and where they should be installed, how many backups to keep and more.
An example session would look like:
$ cp crm_channel_customer.py ~/zato/server1/pickup-dir/ $
Note that a service becomes available only after all servers confirm that it's been deployed, in the example below there are 2 servers to wait in the logs for a confirmation from.
INFO - 6578:Thread-4 Uploaded package id:, payload_name:[crm_channel_customer.py] INFO - 6579:Thread-4 Uploaded package id:, payload_name:[crm_channel_customer.py]
Flat Python packages can also be hot-deployed in a cluster using the web admin.
Refer to web admin's docs for more information.
Each Zato installation package contains a directory named zato_extra_paths, documented in its own chapter, and whatever is put into zato_extra_paths will automatically appears on PYTHONPATH.
This can be used in conjunction with service-sources.txt to install services from sources other than flat Python modules.
This is a static method of installing the services and requires a restart (zato stop & zato start) of each server that had its zato_extra_paths updated. Note that for HTTP traffic a load-balancer will re-route traffic to other servers if one goes down.