Provision Cassandra Zookeeper in Config node of a Existing cluster
Steps to provision cassandra/zookeeper in config node of an existing cluster with config and database roles in different set of nodes.
Managing separate Cassandra database for config and analytics DB's in a existing contrail cluster by migrating config key-spaces and zookeeper data to config node. This is achieved by,
- Provisioning Cassandra/zookeeper in config node for config key-spaces and migrating data to config node.
- Using the existing database node for analytics key-spaces.
- Stopping zookeeper in database nodes.
s1, s2, s3 -- Nodes playing config roles
s4, s5, s6 -- Nodes playing analytics and database roles.
1.1 Install database packages in config servers
fab -R cfgm -- "apt-get install contrail-openstack-database"
2.1 Populate testbed.py with following backup information
backup_node="root@x.y.x.z"
cassandra_backup="custom"
backup_db_path = ["/root/"]
skip_keyspace=["ContrailAnalyticsCql", "useragent", "system_auth", "system_distributed", "system_traces", "system"] # Skip all existing key-space's except confid_db_uuid,svc_monitor_keyspace,to_bgp_keyspace,DISCOVERY_SERVER,dm_keyspace
Populate ‘backup’ role in env.roledefs with backup_node
set root password for the backup_node in env.password
2.2 Backup the config key-spaces
fab backup_cassandra_db
2.3 Backup the zookeeper
fab backup_zookeeper_data
3.1 Populate testbed.py with following information,
ssd_data_dir = '<commit-logs-partition>/commit_logs_data'
database_dir = '<cassandra-data-partition>/cassandra’
3.2 Provision database services in config servers
fab setup_database_node:<user@s1>,<user@s2>,<user@s3>
4.1 Rename the backed up data dir to config servers host names in the backup node
BACKUP_NODE# cd /root
BACKUP_NODE# mv s4_HOSTNAME_DIR/ s1_HOSTNAME_DIR/
BACKUP_NODE# mv s5_HOSTNAME_DIR/ s2_HOSTNAME_DIR/
BACKUP_NODE# mv s6_HOSTNAME_DIR/ s3_HOSTNAME_DIR/
4.2 Restore the config key-space's from the backup node to config servers
fab restore_cassandra_db
4.3 Restore the zookeeper data from the backup node to config servers
fab restore_zookeeper_data
fab -R collector -- "openstack-config --set /etc/contrail/contrail-alarm-gen.conf DEFAULTS zk_list <s1>:2181 <s2>:2181 <s3>:2181"
fab -R collector -- "openstack-config --set /etc/contrail/contrail-collector.conf DEFAULT zookeeper_server_list <s1>:2181,<s2>:2181,<s3>:2181"
fab -R collector -- "openstack-config --set /etc/contrail/contrail-snmp-collector.conf DEFAULTS zookeeper <s1>:2181,<s2>:2181,<s3>:2181"
fab -R collector -- "openstack-config --set /etc/contrail/contrail-topology.conf DEFAULTS zookeeper <s1>:2181,<s2>:2181,<s3>:2181"
fab -R database -- "sed -i 's/zookeeper.connect=.*/zookeeper.connect=<s1>:2181,<s2>:2181,<s3>:2181/g' /usr/share/kafka/config/server.properties"
fab -R cfgm -- "openstack-config --set /etc/contrail/contrail-api.conf DEFAULTS zk_server_ip <s1>:2181,<s2>:2181,<s3>:2181"
fab -R cfgm -- "openstack-config --set /etc/contrail/contrail-device-manager.conf DEFAULTS zk_server_ip <s1>:2181,<s2>:2181,<s3>:2181"
fab -R cfgm -- "openstack-config --set /etc/contrail/contrail-schema.conf DEFAULTS zk_server_ip <s1>:2181,<s2>:2181,<s3>:2181"
fab -R cfgm -- "openstack-config --set /etc/contrail/contrail-svc-monitor.conf DEFAULTS zk_server_ip <s1>:2181,<s2>:2181,<s3>:2181"
fab -H <user@s4>,<user@s5>,<user@s6> -- "service zookeeper stop"
fab -H <user@s4>,<user@s5>,<user@s6> -- 'echo "manual" > /etc/init/zookeeper.override'
fab -R database -- "service kafka restart"
fab restart_cfgm
fab restart_collector
After executing the above steps,
-
Config services will use the new Cassandra provisioned in servers (s1, s2, s3) and analytics service will use the existing Cassandra in the new servers( s4, s5, s6).
-
Config/collector/kafka services will use the new zookeeper provisioned in servers (s1, s2, s3)