Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Install the cluster node package, as described in the section Cluster Node Installation of Setup on Linux.
  2. Stop all the services by executing the following command:

    Code Block
    languagebash
    monit -g all stop


  3. Squirro cluster service
    1. Edit the /etc/squirro/cluster.ini configuration file as follows (all settings are in the [cluster] section of the ini file):
      1. id: change this to the same value as on the previous cluster nodes - ensuring it's the same value for all cluster nodes.
      2. redis_controller: set this to true so that Redis replication is managed by the Squirro cluster service.
      3. mysql_controller: set this to true so that MySQL replication is managed by the Squirro cluster service.
    1. 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 the endpoint_discovery (for Redis) db_endpoint_discovery (for MySQL) configuration entries and in every /etc/squirro/*.ini file to be set to true. This can be automated with the following sed 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


  4. MySQL
    1. Enable MySQL replication. This requires two changes in /etc/mysql/conf.d/replication.cnf - both of these values are commented out by default:
      1. server_id: this integer value needs to be a unique value over the whole cluster. For example use 10 for the first server in the cluster, 11 for the second, etc.
      2. report_host: set this to the human-readable name of the server, as it should be reported to the other hosts - for example node01.
    2. Raise the MySQL limits on open files and maximum connections.

      Code Block
      languagetext
      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.

  5. Zookeeper

    1. 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.
    2. 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
      languagetext
      title/etc/zookeeper/zoo.cfg
      server.1=10.1.87.10:2888:3888
      server.2=10.1.87.11:2888:3888
      …


    3. Start Zookeeper:

      Code Block
      service zookeeper start


    4. At this point follow the Process on all the other cluster nodes section and make sure a cluster leader is elected.

  6. Starting
    1. Start the cluster node:

      Code Block
      service sqclusterd start


    2. 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.
       

    3. 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.

...