TODO: Turn this into a script
Follow directions for the tungsten prerequisites prerequisites The following settings are required for each database in the federation:
hostname -f | md5sum | awk '{ print $1 }' | cut -b 1-7
mkdir -p /etc/systemd/system/mariadb.service.d/
cat > /etc/systemd/system/mariadb.service.d/limits.conf << EOF
[Service]
LimitNOFILE=65535
EOF
systemctl daemon-reload
systemctl restart mariadb
cat >> /etc/sysctl.conf << EOF
vm.swappiness=10
EOF
The Hub database needs to have all of the same tables and structure of the instances.
Use the xdmod-setup
script initialize the Hub Database (setup your database and organization)
a random 32 character password will be generated for mysql and stored in ~tungsten/.my.cnf
xdmod-fed-tungsten-add-user
Create instance databases on Hub
This can be done as part of xdmod-setup
Otherwise you can use the following commands:
(replacing instance\d.fqdn with the fqdn of the instance(s))
xdmod-fed-instance-etl -i instance1.fqdn[,instance2.fqdn,...]
xdmod-fed-tungsten-download
a random 32 character password will be generated for mysql and stored in ~tungsten/.my.cnf
xdmod-fed-tungsten-add-user
TODO: Automate this?
Copy the public (~tungsten/.ssh/id_rsa.pub), private key (~tungsten/.ssh/id_rsa), and authorized keys (~tungsten/.ssh/authorized_keys) from the Hub server to the ~/tungsten/.ssh directory.
xdmod-fed-tungsten-defaults
(replacing instance\d.fqdn with the fqdn of the instance(s))
xdmod-fed-tungsten-configure -h hub.fqdn -i instance1.fqdn[,instance2.fqdn,...]
(replacing instance\d.fqdn with the fqdn of the instance(s))
xdmod-fed-tungsten-config-instance -i instance1.fqdn[,instance2.fqdn,...]
DIFFERENT MYSQL PASSWORDS
Since the mysql passwords should be different for the different instances
currently this must be done outside of xdmod-fed-* commands
tpm configure --host instace.fqdn --datasource-user theUser --datasource-password thePassword
NOTE: this processes opens up MANY connections in rapid succesion to the instances, rate limiting may cause issues
xdmod-fed-tungsten-install
The following must be agreed upon before Federation setup
We must decide on the following before going forward This will be changed to be able to be a mapping in the future
currently this must be done outside of xdmod-fed-* commands read more at: deployment expanding slaves
su - tungsten -c '/opt/continuent/software/tungsten-replicator-5.0.1/tools/tpm configure --dataservice-name xdmodfederation --members+=instance.fqdn'
xdmod-fed-tungsten-config-instance -i instance.fqdn
xdmod-fed-instance-etl -i
su - tungsten -c '/opt/continuent/software/tungsten-replicator-5.0.1/tools/tpm configure xdmodfederation --host instance.fqdn --datasource-user theUser --datasource-password thePassword'
Get all the current instances, they will be needed for the next step
/opt/continuent/software/tungsten-replicator-5.0.1/tools/tpm dump | grep '\-\-masters' | cut -d'=' -f 2 | cut -d' ' -f 1
NOTE: This requires you to put in all other instances
su - tungsten -c '/opt/continuent/software/tungsten-replicator-5.0.1/tools/tpm configure xdmodfederation --master=instance.fqdn[other instances]'
su - tungsten -c '/opt/continuent/software/tungsten-replicator-5.0.1/tools/tpm configure xdmodfederation --master-services=instance.fqdn[other instances]'
su - tungsten -c '/opt/continuent/software/tungsten-replicator-5.0.1/tools/tpm update'
su - tungsten -c '/opt/continuent/software/tungsten-replicator-5.0.1/tools/tpm update xdmodfederation'