...
- Install the cluster node package, as described in the section Cluster Node Installation of Setup on Linux.
Stop all the services by executing the following command:
Code Block language bash monit -g all stop
- Squirro cluster service
- Edit the
/etc/squirro/cluster.ini
configuration file as follows (all settings are in the[cluster]
section of the ini file):
id
: change this to the same value as on the previous cluster nodes - ensuring it's the same value for all cluster nodes.redis_controller
: set this totrue
so that Redis replication is managed by the Squirro cluster service.mysql_controller
: set this totrue
so that MySQL replication is managed by the Squirro cluster service.
Turn on endpoint discovery for all Redis and database connections. This ensures that the services consult the cluster service to know which cluster node is currently the master.
Changing this requires all theendpoint_discovery
(for Redis)db_endpoint_discovery
(for MySQL) configuration entries and in every/etc/squirro/*.ini
file to be set totrue
. This can be automated with the followingsed
commands:Code Block sed -i -e 's/^endpoint_discovery = false/endpoint_discovery = true/' /etc/squirro/*.ini sed -i -e 's/^db_endpoint_discovery = false/db_endpoint_discovery = true/' /etc/squirro/*.ini
- Edit the
- MySQL
- Enable MySQL replication. This requires two changes in
/etc/mysql/conf.d/replication.cnf
- both of these values are commented out by default:server_id
: this integer value needs to be a unique value over the whole cluster. For example use10
for the first server in the cluster,11
for the second, etc.report_host
: set this to the human-readable name of the server, as it should be reported to the other hosts - for examplenode01
.
Raise the MySQL limits on open files and maximum connections.
Code Block language text title /etc/mysql/conf.d/maxconnnections.cnf [mysqld] open_files_limit = 8192 max_connections = 500
The
max_connections
setting should be set higher depending on number of cluster nodes. We recommend at least 150 connections for each cluster node.
- Enable MySQL replication. This requires two changes in
Zookeeper
- Set the unique Zookeeper node identifier. This ID needs to start at 1, and then for each node incremented by 1. Write this identifier to
/var/lib/zookeeper/data/myid
. Add a list of all cluster nodes to Zookeeper. Edit
/etc/zookeeper/zoo.cfg
and list all the cluster nodes (including this new server):Code Block language text title /etc/zookeeper/zoo.cfg server.1=10.1.87.10:2888:3888 server.2=10.1.87.11:2888:3888 …
Start Zookeeper:
Code Block service zookeeper start
At this point follow the Process on all the other cluster nodes section and make sure a cluster leader is elected.
- Set the unique Zookeeper node identifier. This ID needs to start at 1, and then for each node incremented by 1. Write this identifier to
- Starting
Start the cluster node:
Code Block service sqclusterd start
Wait for the cluster node to come up. Make sure the election leader is the same one as on the previous nodes.
Code Block curl -s http://127.0.0.1:81/service/cluster/v0/leader/cluster.json | python -mjson.tool | grep electionLeader
This command may have be repeated a few times until a result is returned.
Start all other services:
Code Block monit -g all-active start
Process on all the other cluster nodes (existing nodes, before the cluster expansion)
This process needs to happen together with the Zookeeper configuration on the new cluster node.
...