Install → Module Setup

Prerequisites

TODO: Turn this into a script

Follow directions for the tungsten prerequisites prerequisites The following settings are required for each database in the federation:

  • binlog-format = row
  • log-bin-trust-function-creators = 1
  • server-id = #
    • each server must be different suggest using:
    • printf %d\n 0xhostname -f | md5sum | awk '{ print $1 }' | cut -b 1-7
  • Number of files
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

Initialize Hub Database

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)

Prepare for replication using tungsten

Hub Server

Prerequisites

Additional Information

Create tungsten user(s) and generate RSA key and password

a random 32 character password will be generated for mysql and stored in ~tungsten/.my.cnf

xdmod-fed-tungsten-add-user

Create ETL for Instance Initialization

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,...]
Download and extract tungsten
xdmod-fed-tungsten-download

Instances

Tungsten Prerequisites (for the instances)
Create tungsten user(s) and generate RSA key

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.

Configuring tungsten for Fan-In Replication

Hub Server

Set Tungsten defaults

xdmod-fed-tungsten-defaults

Configuring the xdmodfederation service

(replacing instance\d.fqdn with the fqdn of the instance(s))

xdmod-fed-tungsten-configure -h hub.fqdn -i instance1.fqdn[,instance2.fqdn,...]

Configuring database rename

(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

Validate and install Tungsten on federation

NOTE: this processes opens up MANY connections in rapid succesion to the instances, rate limiting may cause issues

xdmod-fed-tungsten-install

Setup the Hub

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

    • field of science hierarchies
    • Use the default for these (for now)
    • resource types
    • Job Times
    • Error Descriptions
    • process-buckets

Expanding the Federation

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'