To add an engine to a cluster, connect it to the shared database. Then, configure the
load balancer to send traffic to it.
Before you begin
- Set up a cluster of engines, including setting up a load balancer and shared database.
See Setting up clusters of engines.
- Each engine must run the same version of IBM® UrbanCode™ Deploy.
About this task
You can add many engine nodes to the cluster as you need.
Procedure
- On the new node, install the engine as described in Installing engines. For the public address of the system, specify the IP address of the load balancer. For
the Keystone server, use the same Keystone server that you would use if you were
installing a single engine.
- After you install the engine, stop the Heat services by running the following
commands:
cd /etc/init.d
for s in $(ls openstack*); do service $s stop; done
- Stop the MySQL database and prevent it from starting at system startup by running the
following commands:
service mysqld stop
chkconfig mysqld off
The
engine does not require this service because it must use the shared engine database. If
the cluster node does not require MySQL for any other purpose, you can uninstall MySQL
from the cluster node.
- Open the /etc/heat/heat.conf file in a text editor.
- In the /etc/heat/heat.conf file, if you are connecting to a
Keystone engine other than the default Keystone engine for the cloud, find the
allowed_auth_uris property, and add the complete URL to the
Keystone server to the property value. For example, if the engine connects to clouds at
cloud1.example.com and cloud2.example.com, the property might look
like the following
example:
allowed_auth_uris=http://cloud1.example.com:5000/v2.0,http://cloud2.example.com:5002/v2
- Find the sql_connection property, and change it to the location of
the shared engine database. For example, if the shared engine database has the host name
engine-database.example.com, the property looks as
follows:
sql_connection=mysql://heat:heat@engine-database.example.com:3306/heat?charset=utf8
- Find the auth_host property, and update it to point to the load
balancer host name, as in the following example:
auth_host=ucd-patterns.example.com
- Find the rabbit_host property, and update it to point to the host
name of the shared engine database, as in the following example:
rabbit_host=engine-database.example.com
- Stop the RabbitMQ service:
service rabbitmq-server stop
- Prevent the RabbitMQ service from starting on system startup:
chkconfig rabbitmq-server off
- Open the /etc/keystone/keystone.conf file in a text editor.
- In the /etc/keystone/keystone.conf file, find the
connection parameter and update it to use shared engine database,
as in the following example:
connection=mysql://keystone:keystone@engine-database.example.com:3306/keystone?charset=utf8
- Start the Heat services by running the following commands:
cd /etc/init.d
for s in $(ls openstack*); do service $s start; done
for s in $(ls openstack*); do service $s status; done
- Configure the load balancer to send traffic on the following ports to the new engine
node:
- 5000
- 35357
- 8004
- 8000
- 8003
For example, if you are using HAProxy, the configuration file might have code that
is similar to the following snippets. In this code example, it is assumed that the engine
nodes have these host names: engine1.example.com,
engine2.example.com, and
engine3.example.com.frontend keystone_api
bind *:5000
default_backend keystone_api_back
frontend keystone_admin
bind *:35357
default_backend keystone_admin_back
frontend heat_api
bind *:8004
default_backend heat_api_back
frontend heat_cfn
bind *:8000
default_backend heat_cfn_back
frontend heat_cloudwatch
bind *:8003
default_backend heat_cloudwatch_back
backend keystone_api_back
balance roundrobin
server enginenode1 engine1.example.com:5000 check
server enginenode2 engine2.example.com:5000 check
server enginenode3 engine3.example.com:5000 check
option httpchk
backend keystone_admin_back
balance roundrobin
server enginenode1 engine1.example.com:35357 check
server enginenode2 engine2.example.com:35357 check
server enginenode3 engine3.example.com:35357 check
option httpchk
backend heat_api_back
balance roundrobin
server enginenode1 engine1.example.com:8004 check
server enginenode2 engine2.example.com:8004 check
server enginenode3 engine3.example.com:8004 check
option httpchk
backend heat_cfn_back
balance roundrobin
server enginenode1 engine1.example.com:8000 check
server enginenode2 engine2.example.com:8000 check
server enginenode3 engine3.example.com:8000 check
option httpchk
backend heat_cloudwatch_back
balance roundrobin
server enginenode1 engine1.example.com:8003 check
server enginenode2 engine2.example.com:8003 check
server enginenode3 engine3.example.com:8003 check
option httpchk
- Restart the HAProxy service:
service haproxy restart
- On the new engine node, run the following commands to verify that the engine is
running:
source ˜/clientrc
heat stack-list
keystone endpoint-list
The
endpoints that the keystone endpoint-list command returns must refer to
the load balancer and not the engine node.
- Verify that the load balancer is sending traffic to the new node. For example, if HAProxy is installed on a system with the host
name ucd-patterns.example.com, you can go to the following URL to see the
status of the nodes:
http://ucd-patterns.example.com:1936/haproxy?stats
Results
The engine is part of the cluster.