Legacy GUI Installation
Starting from ClusterControl 1.9.7 (September 2023), ClusterControl GUI v2 is the default frontend graphical user interface for ClusterControl, accessible via https://{ClusterControl_host}/
. For new installations, the installer script will only install GUI v2, skipping GUI v1. If you would like to have GUI v1, follow the instructions as written in this article.
Caveats
Before continuing with the installation, do mind the following important points:
- ClusterControl GUI v1 requires PHP. It only supports the outdated PHP 7. It does not support the latest version of PHP 8 at the time of this writing. If the operating system comes with PHP 8 installed by default, you have to downgrade to PHP 7 to continue using it. ClusterControl GUI v2 does not have this requirement.
- It requires a MySQL/MariaDB database called "dcps".
- Only the Apache web server is supported due to its dependency on .htaccess and Apache configuration files.
- ClusterControl GUI v1 has reached the end of the development cycle and is considered a feature-freeze product. All new developments will be happening on ClusterControl GUI v2.
- To run ClusterControl GUI v1 on a Red Hat-based distribution, SELinux must be turned off. The installer script only configures the SELinux policy for ClusterControl GUI v2.
Installation steps
The following installation steps are written based on Ubuntu 22.04 LTS and Rocky Linux 9.2. It is assumed that you have already performed a ClusterControl installation using the installer script, install-cc
which by default would give you ClusterControl GUI v2. See the Quickstart section for details.
-
If you have created an admin user during the first login of ClusterControl GUI v2, proceed to step 2. Otherwise, create a ClusterControl admin user if you haven't done so by accessing ClusterControl GUI v2.
-
Disable SELinux by configuring the following line inside
/etc/selinux/config
:Deactivate SELinux during runtime:
-
Install ClusterControl GUI v1 package:
-
Copy the provided Apache configuration files to the Apache configuration directory:
-
Add
Listen {HTTPS port}
at the top of thes9s-ssl.conf
file (note that port 443 is already taken by GUI v2, so we have to pick another port):Add the following in the first line:
In the same file, configure the same HTTPS port as defined above on line 3:
Also in the same file, configure the SSL certificate and key with the provided cert and key (lines 55 and 56, after you have added the first line above):
Restart the Apache web server to apply the changes:
-
Check the provided PHP module of the operating system. For Rocky Linux 9.2, the PHP module provided by the default AppStream repository is 8.1, which is not supported. We can check using the following command:
-
If PHP7 is unavailable as in this case, we will configure the Remi repository:
-
Verify that the PHP 7 module is listed (in this example, it is
remi-7.4
):$ dnf module list php -y Rocky Linux 9 - AppStream Name Stream Profiles Summary php 8.1 common [d], devel, minimal PHP scripting language Remi's Modular repository for Enterprise Linux 9 - x86_64 Name Stream Profiles Summary php remi-7.4 common [d], devel, minimal PHP scripting language php remi-8.0 common [d], devel, minimal PHP scripting language php remi-8.1 common [d], devel, minimal PHP scripting language php remi-8.2 common [d], devel, minimal PHP scripting language php remi-8.3 common [d], devel, minimal PHP scripting language
-
Switch PHP to use
remi-7.4
module: -
Install the required PHP7 packages:
-
Start the php-fpm service and restart Apache web server:
-
Create
bootstrap.php
from the provided template: -
Configure
/var/www/html/clustercontrol/bootstrap.php
and set the password,DBPASS
, port,DBPORT
andRPCTOKEN
accordingly:Note
Set the password and port used when installing CCv2 for the cmon MySQL user. You can also retrieve the information from
/etc/cmon.cnf
(including the RPC token). -
Login to MySQL and create the 'dcps' database:
Note
We skip configuring MySQL user privilege since the "cmon" MySQL user has a global admin privilege.
-
Import the
dcps
database schema structure from the provided SQL file: -
Finally, add the following database flag to skip the registration and admin user creation page since we have done it via ClusterControl GUI v2 when creating the first admin user:
-
The installation is now complete. ClusterControl GUI v1 should be accessible at
https://{ClusterControl_host}:9443/
. The final thing to do is to import the existing clusters (if you have any) into ClusterControl GUI v1, by executing this script:#!/bin/bash function import() { for i in /etc/cmon.d/cmon_*.cnf; do NAME=$(grep ^name= $i | cut -d "=" -f2 | tr -d "'") TYPE=$(grep ^cluster_type= $i | cut -d "=" -f2) TOKEN=$(grep ^rpc_key= $i | cut -d "=" -f2 | tr -d "'") CREATED_BY=$(grep ^owner= $i | cut -d "=" -f2) CID=$(grep ^cluster_id= $i | cut -d "=" -f2) DBUSER=cmon DBPASS=$(grep ^mysql_password= $i | cut -d "=" -f2 | tr -d "'") echo "Importing cluster ID = $CID, from $i" MYSQL_PWD="$DBPASS" mysql -u$DBUSER -f -A -Bse \ "INSERT IGNORE INTO dcps.clusters SET company_id = 1, \ id = ${CID}, \ cluster_id = ${CID}, \ name = '${NAME}', \ token = '${TOKEN}', \ cmon_db = 'cmon', \ type = '${TYPE}', \ status = 100, \ created_by = $CREATED_BY" retval=$? if [ $retval -eq 0 ]; then echo 'OK' else echo 'ERROR. Fix the script and try again.' exit 1 fi done echo 'Import complete.' exit 0 } echo 'Use this script to import clusters into ClusterControl GUI v1' echo 'after GUI v1 is installed and running (v1.9.7 only).' echo 'This script can be run multiple times if any error occurs.' echo read -p "Do you wish to continue? [Y/n] " yn case $yn in [Yy]* ) import; break;; * ) echo 'Exiting..'; exit 1;; esac
Copy the above code inside the ClusterControl server and save it as
import_cluster_guiv1.sh
. Example output as below:$ vim import_cluster_guiv1.sh # paste the code & save $ chmod 755 import_cluster_guiv1.sh $ ./import_cluster_guiv1.sh Use this script to import clusters into ClusterControl GUI v1 after GUI v1 is installed and running (v1.9.7 only). This script can be run multiple times if any error occurs. Do you wish to continue? [Y/n] Y Importing cluster ID = 2, from /etc/cmon.d/cmon_2.cnf OK Importing cluster ID = 3, from /etc/cmon.d/cmon_3.cnf OK Importing cluster ID = 4, from /etc/cmon.d/cmon_4.cnf OK Importing cluster ID = 7, from /etc/cmon.d/cmon_7.cnf OK
-
If you have created an admin user during the first login of ClusterControl GUI v2, proceed to step 2. Otherwise, create a ClusterControl admin user if you haven't done so by accessing ClusterControl GUI v2.
-
Install ClusterControl GUI v1 package:
-
Copy the provided Apache configuration files to the Apache configuration directory:
-
Add
Listen {HTTPS port}
at the top of thes9s-ssl.conf
file (note that port 443 is already taken by GUI v2, so we have to pick another port):Add the following in the first line:
In the same file, configure the same HTTPS port as defined above on line 3:
Also in the same file, configure the SSL certificate and key with the provided cert and key (lines 55 and 56, after you have added the first line above):
Restart the Apache web server to apply the changes:
-
By default, the installer script configures the PHP7 repository called "ondrej". You may verify by using the following command:
-
If the repository is not listed in the above output, you may install it by using the following commands:
-
Install the required PHP7 packages:
Note
By default, the installer script will install the above packages. In that case, the above command will return those packages as installed.
-
Create
bootstrap.php
from the provided template: -
Configure
/var/www/html/clustercontrol/bootstrap.php
and set the password,DBPASS
, port,DBPORT
andRPCTOKEN
accordingly:Note
Set the password and port used when installing CCv2 for the cmon MySQL user. You can also retrieve the information from
/etc/cmon.cnf
(including the RPC token). -
Login to MySQL and create the 'dcps' database:
Note
We skip configuring MySQL user privilege since the "cmon" MySQL user has a global admin privilege.
-
Import the
dcps
database schema structure from the provided SQL file: -
Finally, add the following database flag to skip the registration and admin user creation page since we have done it via ClusterControl GUI v2 when creating the first admin user:
-
The installation is now complete. ClusterControl GUI v1 should be accessible at
https://{ClusterControl_host}:9443/
. The final thing to do is to import the existing clusters (if you have any) into ClusterControl GUI v1, by executing this script:#!/bin/bash function import() { for i in /etc/cmon.d/cmon_*.cnf; do NAME=$(grep ^name= $i | cut -d "=" -f2 | tr -d "'") TYPE=$(grep ^cluster_type= $i | cut -d "=" -f2) TOKEN=$(grep ^rpc_key= $i | cut -d "=" -f2 | tr -d "'") CREATED_BY=$(grep ^owner= $i | cut -d "=" -f2) CID=$(grep ^cluster_id= $i | cut -d "=" -f2) DBUSER=cmon DBPASS=$(grep ^mysql_password= $i | cut -d "=" -f2 | tr -d "'") echo "Importing cluster ID = $CID, from $i" MYSQL_PWD="$DBPASS" mysql -u$DBUSER -f -A -Bse \ "INSERT IGNORE INTO dcps.clusters SET company_id = 1, \ id = ${CID}, \ cluster_id = ${CID}, \ name = '${NAME}', \ token = '${TOKEN}', \ cmon_db = 'cmon', \ type = '${TYPE}', \ status = 100, \ created_by = $CREATED_BY" retval=$? if [ $retval -eq 0 ]; then echo 'OK' else echo 'ERROR. Fix the script and try again.' exit 1 fi done echo 'Import complete.' exit 0 } echo 'Use this script to import clusters into ClusterControl GUI v1' echo 'after GUI v1 is installed and running (v1.9.7 only).' echo 'This script can be run multiple times if any error occurs.' echo read -p "Do you wish to continue? [Y/n] " yn case $yn in [Yy]* ) import; break;; * ) echo 'Exiting..'; exit 1;; esac
Copy the above code inside the ClusterControl server and save it as
import_cluster_guiv1.sh
. Example output as below:$ vim import_cluster_guiv1.sh # paste the code & save $ chmod 755 import_cluster_guiv1.sh $ ./import_cluster_guiv1.sh Use this script to import clusters into ClusterControl GUI v1 after GUI v1 is installed and running (v1.9.7 only). This script can be run multiple times if any error occurs. Do you wish to continue? [Y/n] Y Importing cluster ID = 2, from /etc/cmon.d/cmon_2.cnf OK Importing cluster ID = 3, from /etc/cmon.d/cmon_3.cnf OK Importing cluster ID = 4, from /etc/cmon.d/cmon_4.cnf OK Importing cluster ID = 7, from /etc/cmon.d/cmon_7.cnf OK