Severalnines Blog
The automation and management blog for open source databases

How to Install ClusterControl on Servers without Internet Access

Ashraf Sharif
Posted in:

There are several ways to get ClusterControl installed on your database infrastructure, as described in the ClusterControl Getting Started page. One simple way is to use an installation script, install-cc.sh. This script automates the whole process, and is executed on the host where you want to install ClusterControl. By default, it assumes the host has internet connectivity during the installation process.

For users who are not able to have their ClusterControl hosts connect to the Internet during the installation, we have some good news! ClusterControl provides a helper script to install and configure ClusterControl packages in an Internetless environment, available at /var/www/clustercontrol/app/tools/setup-cc.sh. The installation steps are also available at our documentation page.

Requirements

Prior to the offline install, make sure you meet the following requirements for the ClusterControl node:

  1. Ensure the offline repository is ready. We assume that you already configured an offline repository for this guide. Details on how to setup offline repository is explained on the next section.
  2. Firewall, SElinux or AppArmor must be turned off. You can turn on the firewall once the installation has completed. Make sure to allow ports as defined on this page.
  3. MySQL server must be installed on the ClusterControl host.

We will now explain these steps in the following sections.

Setting Up Offline Repository

The installer script requires an offline repository so it can automate the installation process by installing dependencies.

CentOS 7

  1. Insert the DVD installation disc into the DVD drive.

  2. Mount the DVD installation disc into the default media location at /media/CentOS:

    $ mount /dev/cdrom /media/CentOS
  3. Disable the default repository by adding enabled=0 to “base”, “updates” and “extras” directives. You should have something like this inside /etc/yum.repos.d/CentOS-Base.repo:

    [base]
    name=CentOS-$releasever - Base
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
    #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    enabled=0
    
    #released updates
    [updates]
    name=CentOS-$releasever - Updates
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
    #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    enabled=0
    
    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
    #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    enabled=0
    …
  4. Update the “enabled” value under the c6-media directive in /etc/yum.repos.d/CentOS-Media.repo, as shown below:

    [c6-media]
    name=CentOS-$releasever - Media
    baseurl=file:///media/CentOS/
            file:///media/cdrom/
            file:///media/cdrecorder/
    gpgcheck=1
    enabled=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
  5. Get the list of available packages:

    $ yum list

Make sure the last step does not produce any error.

Debian/Ubuntu

  1. Download the ISO images from the respective vendor site and upload them onto the ClusterControl host. You should have something like this on Debian 7.6:

    $ ls -1 | grep debian
    debian-7.6.0-amd64-DVD-1.iso
    debian-7.6.0-amd64-DVD-2.iso
    debian-7.6.0-amd64-DVD-3.iso
  2. Create mount points and mount each of the ISO images accordingly:

    $ mkdir /mnt/debian-dvd1 /mnt/debian-dvd2 /mnt/debian-dvd3
    $ mount debian-7.6.0-amd64-DVD-1.iso /mnt/debian-dvd1
    $ mount debian-7.6.0-amd64-DVD-2.iso /mnt/debian-dvd2
    $ mount debian-7.6.0-amd64-DVD-3.iso /mnt/debian-dvd3
  3. Add the following lines into /etc/apt/sources.list and comment other lines:

    deb file:/mnt/debian-dvd1/ wheezy main contrib
    deb file:/mnt/debian-dvd2/ wheezy main contrib
    deb file:/mnt/debian-dvd3/ wheezy main contrib
  4. Retrieve the new list of packages:

    $ apt-get update

Make sure the last step does not produce any error.

Preparing the Installation Files

CentOS 7

  1. The offline installation script will need a running MySQL server on the host. Install MySQL server and client, enable it on boot and start the service:

    $ yum install -y mariadb mariadb-server
    $ systemctl enable mariadb
    $ systemctl start mariadb
  2. Configure MySQL root password for the newly installed MySQL server:

    $ mysqladmin -uroot password yourR00tP4ssw0rd
  3. Create the staging directory and download the latest version of cmon-controller RPM package and s9s-clustercontrol tarball from the Severalnines download page. The latest stable version is listed on this page. At this time of writing the latest stable version is 1.5.0:

    $ wget https://severalnines.com/downloads/cmon/clustercontrol-1.5.1-4265-x86_64.rpm
    $ wget https://severalnines.com/downloads/cmon/clustercontrol-cmonapi-1.5.0-290-x86_64.rpm
    $ wget https://severalnines.com/downloads/cmon/clustercontrol-controller-1.5.1-2299-x86_64.rpm
    $ wget https://severalnines.com/downloads/cmon/clustercontrol-notifications-1.5.0-70-x86_64.rpm
    $ wget https://severalnines.com/downloads/cmon/clustercontrol-ssh-1.5.0-39-x86_64.rpm
    $ wget https://severalnines.com/downloads/cmon/clustercontrol-cloud-1.5.0-31-x86_64.rpm
    $ wget https://severalnines.com/downloads/cmon/clustercontrol-clud-1.5.0-31-x86_64.rpm

    **If ClusterControl server does not have internet connection, please download/upload the above files manually to the server.

  4. Perform the package installation manually:

    $ yum localinstall clustercontrol-*

Debian 7

  1. Install MySQL on the host:

    $ sudo apt-get install -y --force-yes mysql-client mysql-server
    $ sudo systemctl enable mysql
  2. Download the latest version of ClusterControl packages the Severalnines download page. The latest stable version is listed here. At the time of writing, the latest stable version is 1.5.0:

    $ wget https://severalnines.com/downloads/cmon/clustercontrol_1.5.1-4265_x86_64.deb
    $ wget https://severalnines.com/downloads/cmon/clustercontrol-cmonapi_1.5.0-290_x86_64.deb
    $ wget https://severalnines.com/downloads/cmon/clustercontrol-controller-1.5.1-2299-x86_64.deb
    $ wget https://severalnines.com/downloads/cmon/clustercontrol-notifications_1.5.0-70_x86_64.deb
    $ wget https://severalnines.com/downloads/cmon/clustercontrol-ssh_1.5.0-39_x86_64.deb
    $ wget https://severalnines.com/downloads/cmon/clustercontrol-cloud_1.5.0-31_x86_64.deb
    $ wget https://severalnines.com/downloads/cmon/clustercontrol-clud_1.5.0-31_x86_64.deb

    **If ClusterControl server does not have internet connection, please download/upload the above files manually to the server.

  3. Perform the package installation and ClusterControl dependencies manually:

    $ sudo apt-get -f install ntp gnuplot
    $ sudo dpkg -i clustercontrol-*.deb

Installing ClusterControl

  1. Execute the post-installation script to configure ClusterControl components and follow the installation wizard accordingly:

    $ sudo /var/www/html/clustercontrol/app/tools/setup-cc.sh

    **Take note that depending on the operating system, Apache document root path might be different. Try with /var/www if /var/www/html does not work.

  2. Open the browser and navigate to https://ClusterControl_host/clustercontrol. Setup the super admin account by specifying a valid email address and password on the welcome page. Follow the installation wizard. Upon completion you will need to specify an email address as username to access ClusterControl.

  3. Once done, you will be redirected to the onboarding wizard:

Post Installation

Once ClusterControl is up and running, you can point it to your existing clusters and/or single-instance MySQL/MariaDB instances and start managing them from one place. Make sure passwordless SSH is configured from ClusterControl node to your database nodes.

  1. Generate a SSH key on ClusterControl node:

    $ ssh-keygen -t rsa # press Enter on all prompts
  2. Setup passwordless SSH to database nodes:

    $ ssh-copy-id -i ~/.ssh/id_rsa [os_user]@[IP address/hostname]

Repeat step 2 for all database hosts that you are going to manage.

Notes

Note that the following ClusterControl features will not work without Internet connection:

  • Backup > Create/Schedule Backup > Upload to Cloud - requires connection to cloud providers.
  • Integrations > Cloud Providers - requires connection to cloud providers.
  • Manage > Load Balancer - requires connection to EPEL, ProxySQL, HAProxy, MariaDB repository.
  • Manage > Upgrades - requires connection to provider’s repository.
  • Deploy Database Cluster - requires connection to database provider’s repository.