2.6. Prepare Hosts

Using Puppet is the fastest way to prepare a host for Tungsten Clustering. These instructions will show you how to install Puppet and prepare a host to run Tungsten Clustering. If you want to prepare the hosts without Puppet, follow the guidelines in Appendix B, Prerequisites.

  • Make sure Puppet and all required packages are installed. See https://docs.puppetlabs.com/guides/puppetlabs_package_repositories.html if you have any issues getting Puppet installed.

    For RHEL/CentOS-based distributions:

    shell > rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm
    shell > yum install -y ruby rubygems ruby-devel puppet

    For Ubuntu-based distributions:

    shell > apt-get update
    shell > apt-get install -y ruby ruby-dev puppet

  • Install the Continuent Puppet module.

    shell > mkdir -p /etc/puppet/modules
    shell > puppet module install continuent/tungsten

  • If you do not have DNS entries for the hosts in use, update the /etc/hosts file so that it reflects the proper IP addresses and complete hostname.

    shell > puppet apply -e "
    host { 'db1.west.example.com': ip => '192.168.11.101', }
    host { 'db2.west.example.com': ip => '192.168.11.102', }
    host { 'db3.west.example.com': ip => '192.168.11.103', }
    "

2.6.1. Prepare MySQL Hosts

Use the Continuent Puppet module to install all prerequisites including MySQL. This will implement the prerequisites described in Section B.2, “Host Configuration” and Section B.3, “MySQL Database Setup”.

shell > puppet apply -e "class { 'tungsten' :
    installMysql => true,
    replicationUser => 'tungsten',
    replicationPassword => 'secret',
    appUser => 'app_user',
    appPassword => 'secret',
}"

2.6.2. Prepare Connector Hosts

Use the Continuent Puppet module to install all common prerequisites. This will implement the prerequisites described in Section B.2, “Host Configuration”.

shell > puppet apply -e "class { 'tungsten' : }"

2.6.3. Prepare Active Witness Hosts

Use the Continuent Puppet module to install all common prerequisites. This will implement the prerequisites described in Section B.2, “Host Configuration”.

shell > puppet apply -e "class { 'tungsten' : }"

2.6.4. Deploy SSH Keys

The tpm script uses SSH to execute commands on each host. There are two simple ways to install these keys.

  • Provide the SSH certificate and key to Puppet. In each of the examples below you may include an SSH certificate and key that will be assigned to the tungsten system user.

    shell > puppet apply -e "class { 'tungsten' :
    sshPublicKey => "-----BEGIN RSA PRIVATE KEY-----
    MIIEogIBAAKCAQEAxoTELWB3x3f2FhpYk6PFpiQh18+TF9AjJVCmmYXRrCuOPOSn
    QolZCcDJu85yZfGKvxcZSl2eQmLkQKLL5REt4W7MdbhH81jLq0E5xOrBH64AxMAZ
    aFBrxw3pyHAoFrf7WuUE+5wSOI3KHWfyj7FzsugvXriGNuM+BL88Wqh9m6cO8H6g
    oz6Rah5Bd93EjIOXbNgcmMQ40blqHu6Dr0ohvXdfOio+g+p8b4STI4tAg68OHfeC
    snoXXmzfNpxi4OBLX9rKUXria+OgWALj7z9G5YAOlTbODZHsW9kX8KT3Koj8B/XT
    wJq8iMfA18vYItcSLK0UnaoDzgbnXjbTE+DulwIDAQABAoIBACn6+41pAAtzh9vG
    uIKIOIzYyTtdDwsTHcuPUZvXm65gC5U++UvtxaF1XnPTxYdfW+rrFJMQVx5M0V4F
    zz5isqQgjSY70SNZ3MAba/8DcdGkN09kHDtd/ly6yXx0k1WylHn1Qmd+6q+A9IPh
    bn8KlJ/5z8KlHOTQi1XvpvC4/s8CVp+J/7CZMnUa7Y5yJvYVV3NCUlySYgYciilw
    VsG5V+1fCB9pvrz86k/yjb20nlL64c0zXZIySg3aCYT8MPk7babKSftZfwP5yTU5
    cauNNMBY81WIKuTQ23Tzh5y/iU7dlnwi3svzIDLApG/XUrv9ovr4R+0E0JGO1FpS
    2tbbGaECgYEA5S4QW9oNdDSo0PaOp5BKxlagPqLY8Qm/aIxdSxzNEuTlHUuVQHuz
    WlKW2pziT+QeQXa6RjbVgRle2eg5T9fI/QPRKHvkQVJ/xuB7qPGdNoibNHJMpQsB
    sqpPKk5btpCnTiM1OVyCNJNZwF884JoIKj4aXf0Oetcbg/rKPAMnX1ECgYEA3cAg
    9c7iHACozBTGP52Mcm0rQgFugtz382L5i7sbJUtfvyTMjXOijzWu53U8Au+sfhwg
    F5DoD0aMnodqJllhXIqyyD5oIRAQwplDm3gCvU278WucOFLKcXtTDobog8aC4DJ+
    TyisczxTxLlviS2paKs4Y3GL3DD8wNpEgN4dBWcCgYAzyjcUKrCDpCrKHg2avDbJ
    n2XTAcX4onVI0P98K+QD8wn7lssBqXKcZLGGcZGK8EgODyCFIXsaE3ulzp609lSL
    KMOpXGX2hQgvDyeixAb8/d3k+jdrzJLzpx0AuHhtRz8nnzk13zvlWa8ck+kT8HsL
    4MDgoIEXLWkgaBoveZ76IQKBgHXKJLftWPX+86rULiqEiaIOkzfQgt9IePzzyhKL
    JPQ+gXGLHozUq7jejzWrdGEq5rlmPzXFZz8V/oQG8j/Eoo8Brc3oOG+3lO+JcfwX
    V30u2XJ38teIQrjdBVVmHARDYimtKKLrvA7KMMUCq1h2xNIwgRdxrRUdgGUAi/rY
    ARppAoGAe6GQOxEdio748n4+Kh1j/bHZWdID7QhjPXCJ83NQ3Jd1lIWqR+9B0tdS
    90jpedj4K24TLd8il2+zQ135/j1XQAqeZXXO5wffNfgRqvnxGm6IIoWX86VIjXV1
    nIOZXfxJbVcOm391bgGfcnxk78vSLuvHM3Iva6cGmBwqTzI7lxQ=
    -----END RSA PRIVATE KEY-----",
    sshPrivateCert => "AAAAB3NzaC1yc2EAAAADAQABAAABAQDGhMQtYHfHd/YWGliTo8WmJCHXz5MX0CMlUKaZhdGsK4485KdCiVkJwMm7znJl8Yq/FxlKXZ5CYuRAosvlES3hbsx1uEfzWMurQTnE6sEfrgDEwBloUGvHDenIcCgWt/ta5QT7nBI4jcodZ/KPsXOy6C9euIY24z4EvzxaqH2bpw7wfqCjPpFqHkF33cSMg5ds2ByYxDjRuWoe7oOvSiG9d186Kj6D6nxvhJMji0CDrw4d94KyehdebN82nGLg4Etf2spReuJr46BYAuPvP0blgA6VNs4Nkexb2RfwpPcqiPwH9dPAmryIx8DXy9gi1xIsrRSdqgPOBudeNtMT4O6X",
    }"

  • After unpacking the software package run the tpm ssh-copy-cert to output a set of commands that will setup the SSH certificate and authorized keys for a user. Run these commands as the tungsten system user on each host before proceeding with deployment.

    shell > ./tools/tpm ssh-copy-cert
    mkdir -p ~/.ssh
    echo "-----BEGIN RSA PRIVATE KEY-----
    MIIEogIBAAKCAQEAxoTELWB3x3f2FhpYk6PFpiQh18+TF9AjJVCmmYXRrCuOPOSn
    QolZCcDJu85yZfGKvxcZSl2eQmLkQKLL5REt4W7MdbhH81jLq0E5xOrBH64AxMAZ
    aFBrxw3pyHAoFrf7WuUE+5wSOI3KHWfyj7FzsugvXriGNuM+BL88Wqh9m6cO8H6g
    oz6Rah5Bd93EjIOXbNgcmMQ40blqHu6Dr0ohvXdfOio+g+p8b4STI4tAg68OHfeC
    snoXXmzfNpxi4OBLX9rKUXria+OgWALj7z9G5YAOlTbODZHsW9kX8KT3Koj8B/XT
    wJq8iMfA18vYItcSLK0UnaoDzgbnXjbTE+DulwIDAQABAoIBACn6+41pAAtzh9vG
    uIKIOIzYyTtdDwsTHcuPUZvXm65gC5U++UvtxaF1XnPTxYdfW+rrFJMQVx5M0V4F
    zz5isqQgjSY70SNZ3MAba/8DcdGkN09kHDtd/ly6yXx0k1WylHn1Qmd+6q+A9IPh
    bn8KlJ/5z8KlHOTQi1XvpvC4/s8CVp+J/7CZMnUa7Y5yJvYVV3NCUlySYgYciilw
    VsG5V+1fCB9pvrz86k/yjb20nlL64c0zXZIySg3aCYT8MPk7babKSftZfwP5yTU5
    cauNNMBY81WIKuTQ23Tzh5y/iU7dlnwi3svzIDLApG/XUrv9ovr4R+0E0JGO1FpS
    2tbbGaECgYEA5S4QW9oNdDSo0PaOp5BKxlagPqLY8Qm/aIxdSxzNEuTlHUuVQHuz
    WlKW2pziT+QeQXa6RjbVgRle2eg5T9fI/QPRKHvkQVJ/xuB7qPGdNoibNHJMpQsB
    sqpPKk5btpCnTiM1OVyCNJNZwF884JoIKj4aXf0Oetcbg/rKPAMnX1ECgYEA3cAg
    9c7iHACozBTGP52Mcm0rQgFugtz382L5i7sbJUtfvyTMjXOijzWu53U8Au+sfhwg
    F5DoD0aMnodqJllhXIqyyD5oIRAQwplDm3gCvU278WucOFLKcXtTDobog8aC4DJ+
    TyisczxTxLlviS2paKs4Y3GL3DD8wNpEgN4dBWcCgYAzyjcUKrCDpCrKHg2avDbJ
    n2XTAcX4onVI0P98K+QD8wn7lssBqXKcZLGGcZGK8EgODyCFIXsaE3ulzp609lSL
    KMOpXGX2hQgvDyeixAb8/d3k+jdrzJLzpx0AuHhtRz8nnzk13zvlWa8ck+kT8HsL
    4MDgoIEXLWkgaBoveZ76IQKBgHXKJLftWPX+86rULiqEiaIOkzfQgt9IePzzyhKL
    JPQ+gXGLHozUq7jejzWrdGEq5rlmPzXFZz8V/oQG8j/Eoo8Brc3oOG+3lO+JcfwX
    V30u2XJ38teIQrjdBVVmHARDYimtKKLrvA7KMMUCq1h2xNIwgRdxrRUdgGUAi/rY
    ARppAoGAe6GQOxEdio748n4+Kh1j/bHZWdID7QhjPXCJ83NQ3Jd1lIWqR+9B0tdS
    90jpedj4K24TLd8il2+zQ135/j1XQAqeZXXO5wffNfgRqvnxGm6IIoWX86VIjXV1
    nIOZXfxJbVcOm391bgGfcnxk78vSLuvHM3Iva6cGmBwqTzI7lxQ=
    -----END RSA PRIVATE KEY-----" > ~/.ssh/id_rsa
    echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGhMQtYHfHd/YWGliTo8WmJCHXz5MX0CMlUKaZhdGsK4485KdCiVkJwMm7znJl8Yq/FxlKXZ5CYuRAosvlES3hbsx1uEfzWMurQTnE6sEfrgDEwBloUGvHDenIcCgWt/ta5QT7nBI4jcodZ/KPsXOy6C9euIY24z4EvzxaqH2bpw7wfqCjPpFqHkF33cSMg5ds2ByYxDjRuWoe7oOvSiG9d186Kj6D6nxvhJMji0CDrw4d94KyehdebN82nGLg4Etf2spReuJr46BYAuPvP0blgA6VNs4Nkexb2RfwpPcqiPwH9dPAmryIx8DXy9gi1xIsrRSdqgPOBudeNtMT4O6X tungsten@db1.east" > ~/.ssh/id_rsa.pub
    touch ~/.ssh/authorized_keys
    cat ~/.ssh/id_rsa.pub>>~/.ssh/authorized_keys
    chmod 700 ~/.ssh
    chmod 600 ~/.ssh/*