TcaplusDB Local Environment Deployment
This file is aimed at guiding users on how to deploy the TcaplusDB cluster version in a multi-device environment to meet users' development, testing, and online operation scenarios.
Currently, the following deployment scenarios are supported:
Single-device cluster (Oms, Center, Dir, Svr, and Proxy are deployed on one device at the same time, and no alarm monitoring, backup, or rollback capabilities are provided)
Cluster with minimal disaster recovery support (Oms, Center, and Dir are deployed on one device, while Proxy and Svr are deployed on the other two, and no alarm monitoring, backup, or rollback capabilities are provided.)
Standard Cluster (All roles are not deployed in mixed mode, and alarm monitoring, backup, and rollback capabilities are provided)
1. Preparations
1.1. Prepare the hardware and software environment
For details, see TcaplusDB hardware and software requirement.
1.2. Prepare the MySQL DB database
It is recommended to purchase MySQL DB instances on the cloud, such as Tencent Cloud CDB with disaster recovery capability.
Without selling a hosted Mysql instances on the cloud, a device (an Oms device) can be used to install and initialize the MySQL service. For details, see the following steps:
- Install MySQL
yum install -y mariadb-server
- Create a MySQL data directory and authorize the directory
mkdir -p /data/tcaplus_mysql
chown -R mysql:mysql /data/tcaplus_mysql
- Modify the MySQL profile
vim /etc/my.cnf
Fill the following into the MySQL profile Note: Modify XX.XX.XX.XX to the local IP.
[mysqld]
datadir=/data/tcaplus_mysql
max_connections=5000
bind-address=XX.XX.XX.XX #### Local IP ####
skip-name-resolve
innodb_file_per_table=1
max_allowed_packet=500M
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
[mysql]
default-character-set = utf8
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
!includedir /etc/my.cnf.d
- Modify the MySQL open file limit parameters
mkdir -p /etc/systemd/system/mariadb.service.d/
echo -e "[Service]\nLimitNOFILE=204800" >> /etc/systemd/system/mariadb.service.d/limits.conf
systemctl daemon-reload
echo -e "\n\* soft nofile 204800\n\* hard nofile 204800" >> /etc/security/limits.conf
- Set the maximum number of MySQL connections
sed '/\[Service\]/a LimitNOFILE=204800\nLimitNPROC=204800' /usr/lib/systemd/system/mariadb.service
- Start the MySQL service
systemctl enable mariadb
systemctl restart mariadb
- Create a MySQL privileged account. Note: Please set the password and IP address in the command as required.
mysql
grant all on \*.\* to 'root'@'OMS machine IP' identified by 'user password' WITH GRANT OPTION;
- Set MySQL global variables
mysql
set global max_connections=5000;
set global sql_mode='';
set global log_bin_trust_function_creators=1;
1.3. Prepare the installation package
Please contact the TcaplusDB project team to obtain the installation package. For contact details, please see the TcaplusDB project homepage.
Upload the obtained installation package (tcaplus_installer.tar.gz) to any directory (such as /root) on the device where the TcaplusDB OMS is to be deployed. Note: Perform the installation steps as root.
Unzip the installation package.
tar xf tcaplus_installer.tar.gz
After the package is unzipped, you can view the version of the server to be installed, as shown below. The control plane version is 3.62.1, and the data plane version is 3.55.0.
ls -1 pkgs/
gmp.rpm
TcaplusOMS3.62.1.212362.x86_64_release_20220905.tar.gz # TcaplusOMS installation package
TcaplusService3.55.0.208057.x86_64_release_20221101.tar.gz # Tcaplus data module installation package
TcaplusService3.62.1.212362.x86_64_release_20220905.tar.gz # Tcaplus management module installation package
tmonitor_install_2.2.17_192396.tar.gz # Tmonitor back-end program installation package
TSF4WebGame_Deps3.60.1.210831_for_tbuspp_X86_64_Release.tar.gz # Tcaplus machine mounting dependency package
web_portal_2.2.17_192396.tar.gz # Tmonitor front-end program installation package
xampp_install.exp # TcaplusOMS web installation package
xampp-linux-x64-5.6.31-0-installer.run # TcaplusOMS web installation package
2. Prepare the installation profile
vim conf/config.json
Note: Modify the configuration items involving passwords and IP addresses to actual values.
{
"base_env_info": {
"mysql_admin_user": "root", // Mysql privileged account, root by default
"mysql_root_passwd": "MySQL privileged password", // Password of mysql privileged account
"mysql_dbname": "tcaplus_CI", // Mysqldb name used by tcaplus, which is automatically created by the script
"mysql_port": 3306, // Mysqldb service port
"skip_mysql_user_create_and_grant": "FALSE", // Instead of creating a common mysql account for tcaplus, use the root account (not recommended to open it)
"mysql_user": "tcaplus", // Mysql common account used by tcaplus
"mysql_passwd": "MySQL user password", // Password of the mysql common account used by tcaplus
"mysql_node": {
"proc_ip": "MysqlIp" // Mysqldb server ip
},
"web_admin_user": "tcaplus_admin", // Default account of the OMS management website
"tcaplus_passwd": "OMS user password", // OMS default password and tcaplus account password
"ssh_port": 36000, // The machine used to install tcaplus must open 36000 ssh listening ports, which currently does not support modification
"pkg_dir": "pkgs", // Path of installation package
"tcaplus_control_process_version": "3.62.1.212362.x86_64_release_20220905", // Management process version number
"tcaplus_data_process_version": "3.55.0.208057.x86_64_release_20221101", // Data process version number
"xampp_suite_version": "5.6.31-0", // Web package version number
"tcaplus_deps_version": "3.60.1.210831", // Dependent package version number
"tmonitor_version": "2.2.17_192396", // Tmonitor version number
"tcaplus_installation_dir": "/data/tcaplus_upload/", // Directory of the installation file on the destination machine
"ftp_user": "tcaplusftp", // Ftp account used by the tcm module
"ftp_pass": "FTP account password", // Password of the ftp account used by the tcm module
"single_machine_env": "FALSE" // Is it a stand-alone cluster (proc_deploy requires only one IP address, and the tmonitor monitoring service and the gluster backup service cannot be installed)
},
"regist_info": {
"set_name": "AutoInstall_SET", // Cluster information
"append_set": "FALSE" // Is it a new cluster mode (add a cluster to an existing environment, and keep FALSE for the first installation)
},
"tmonitor_config": {
"install_tmonitor": "FALSE", // Whether to install the TMonitor monitoring service
"azure_mysql_mode": "FALSE", // Whether to use Microsoft Azure Cloud's mysqldb (there are some differences when adding tables)
"mysql_host": "MysqlIp", // mysql dbip
"mysql_port": 3306, // mysql db port
"mysql_admin_user": "root", // mysql adminuser
"mysql_root_passwd": "MySQL privileged password", // mysql adminpass
"mysql_user": "tmonitor", // Mysql user for tmonitor service (keep the default)
"mysql_passwd": "tmonitor", // Mysql pass for tmonitor service (keep the default)
"tmonitor_web_user": "tmonitor", // Tmonitor web control adminuser (keep the default)
"tmonitor_web_passwd": "tmonitor", // Tmonitor web control adminpass (keep default)
"tmonitor_db_name_base": "tmonitor_center_db", // Tmonitor website dbname (keep the default)
"tmonitor_db_name_tcaplus": "db_tmonitor_for_autoinstall", // Tmonitor Tcaplus cluster dbname (Optional. It is recommended to keep the default)
"tmonitor_db_name_tmonitor1": "tmonitor1_db", // Tmonitor self-monitoring dbname1 (keep the default)
"tmonitor_db_name_tmonitor2": "tmonitor2_db", // Tmonitor self-monitoring dbname2 (keep the default)
"tmonitor_app_name_tcaplus": "autoinstall_tcaplus", // App name of the Tcaplus cluster registered in Tmonitor, which is recommended to be consistent with the register_info.set_name
"tmonitor_app_name_tmonitor1": "tmonitor1", // Tmonitor self-monitoring service 1 (keep the default)
"tmonitor_app_name_tmonitor2": "tmonitor2", // Tmonitor self-monitoring service 2 (keep the default)
"tmonitor_sasvr1_name": "sasvr1", // Tmonitor self-monitoring process 1 (keep the default)
"tmonitor_sasvr2_name": "sasvr2", // Tmonitor self-monitoring process 1 (keep the default)
"tmonitor_nodes": [
{
"proc_ip": "9.134.12.38", // Intranet IP of Tmonitor node 1
"proc_ip_external": "9.134.12.38", // External IP of Tmonitor node 1. If not, fill in the internal IP
"proc_root_passwd": "XXXXXXXXX" // Root password of Tmonitor node 1
},
{
"proc_ip": "9.134.53.76", // The script currently does not support the deployment of a two-node Tmonitor. The configurations in the three lines are the same as those in node 1 above
"proc_ip_external": "9.134.53.76", // Same as above
"proc_root_passwd": "YYYYYYYYY" // Same as above
}
]
},
"data_backup_config": {
"install_gluster": "FALSE", // Whether to install gluster cluster backup service
"gluster_volume": "glusterfs_autoinstall_vol", // Name of the gluster data volume
"gluster_mountpoint": "/data/glusterfs_autoinstall_dbbak", // Mount path of the gluster backup volume (Tcapcenter/Tcapsvr needs to be mounted under this path)
"gluster_storage_path": "/data/gluster_brick", // Data storage directory of the gluster node machine (ensure that the data disk is mounted at this address)
"gluster_nodes": [
{
"proc_ip": "9.134.12.38", // Since this storage cluster is at the disaster tolerance level of Raid1-1, the number of gluster node machines needs to be a multiple of 2
"proc_root_passwd": "XXXXXXXXX"
},
{
"proc_ip": "9.134.53.76",
"proc_root_passwd": "YYYYYYYYY"
}
]
},
"proc_deploy": {
"?proc_detail": "proc_type: TCAPOMS TCAPCENTER TCAPDIR TCAPSVR TCAPROXY TCAPDB, and only one TCAPOMS and TCAPCENTER must exit. TCAPSVR must be a multiple of 2",
"proc_detail": [
{
"proc_type": "TCAPOMS", // Only one TCAPOMS must exist
"proc_ip": "9.134.53.76",
"proc_root_passwd": "YYYYYYYYY"
},
{
"proc_type": "TCAPCENTER", // Only one TCAPCENTER must exist
"proc_ip": "9.134.52.186",
"proc_root_passwd": "XXXXXXXXX"
},
{
"proc_type": "TCAPDIR", // At least one TCAPDIR must exist
"proc_ip": "9.135.15.178",
"proc_root_passwd": "YYYYYYYYY"
},
{
"proc_type": "TCAPSVR", // Tcapsvr node used for mounting must be a multiple of 2
"proc_ip": "9.135.15.198",
"proc_root_passwd": "YYYYYYYYY"
},
{
"proc_type": "TCAPSVR", // Tcapsvr node used for mounting must be a multiple of 2
"proc_ip": "9.135.15.39",
"proc_root_passwd": "YYYYYYYYY"
},
{
"proc_type": "TCAPDB",
"proc_ip": "9.135.15.198",
"proc_root_passwd": "YYYYYYYYY"
},
{
"proc_type": "TCAPDB",
"proc_ip": "9.135.15.39",
"proc_root_passwd": "YYYYYYYYY"
},
{
"proc_type": "TCAPROXY",
"proc_ip": "9.135.15.39",
"proc_root_passwd": "YYYYYYYYY"
},
{
"proc_type": "TCAPROXY",
"proc_ip": "9.135.15.198",
"proc_root_passwd": "YYYYYYYYY"
}
]
}
}
3. Start the installation
After the installation profile is ready, you can start the installation. Note: Perform the installation steps as root.
python main.py
[INFO] Script begins running...
Welcome to the Tcaplus quick installation script. Please enter the serial number as prompted to perform the corresponding installation steps. You can enter a single serial number (2) or an interval serial number (2 to 8).
(1) Check configuration rationality
(2) Check environment login
(3) Check environment idle, check and initialize environment system
(4) Check whether MySQL database is idle, create MySQL database and role, and check database login (center, dir, oms, tmonitor -> mysql
(5) Import MySQL table, install OMS/initialize OMS
(6) Register Set + install Tcapcenter (DEPS/TCM/TCAPCENTER), set resources to the shared mode, install VsFTPd and related configurations
(7) Install the Gluster backup cluster, open the scheduled backup and Center-related configurations (if there is no Cluster cluster, open local backup only) ++optional++
(8) Mount and install Tcapdir
(9) Mount Tcapsvr
(10) Mount Tcaproxy
(11) [completed by the user] register App(pb/tdr), register Zone, add test table, allocate resources ++user action++
(12) Mount Tcapdb ++optional++
(13) Install and deploy Tmonitor: Check MySQL database idle, create database, create account, test access success, import MySQL table, install TmonitorWeb, install TmonitorA, and Tcaplus cluster access alarm ++optional++
(0) Exit
Please enter:
Perform the script steps in sequence based on different installation scenarios. You must perform Steps 1 - 10. You can perform Steps 7, 12, and 13 based on the actual situation.
If fails occur during the installation, besides the screen information, you can also view the process log: tcaplus_installer.log.
4. FAQ
4.1 The fail "failed to connect X.X.X.X:80" occurs during Step 5: "Import the MySQL table and install/initialize the OMS"
4.1.1 Check whether port 80 is not Listening
netstat -tunlp | grep :80
4.1.2 Try to start the web service manually
/opt/lampp/xampp startapache
4.1.3 If fails occur when starting the web service, check whether hostname is modified on the current device and ensure that it is consistent with the hostname in /etc/hosts, and then start the web service manually
hostname
cat /etc/hosts
/opt/lampp/xampp startapache
4.1.4 Retry the installation in Step 5. You need to modify the script and skip some execution functions
vim commonlib/OmsDeployment.py, comment on the following codes
275 logI("Execute tables import under %s" % decompress_pkg_path)
276 ret = ImportOmsSql(config_items, decompress_pkg_path)
277 if 0 != ret:
278 print("ImportOmsSql failed.")
279 return 7
280
281 logI("Installing Dep pkgs")
282 if 0 != InstallDeps(config_items, 'TCAPOMS', decompress_deps_path):
283 return 8
284
285 logI("Installing Xampp")
286 if 0 != InstallXampp(config_items, dest_path):
287 return 9
288
289 logI("Installing OmsSystem")
290 if 0 != OmsDeployment(config_items, decompress_pkg_path):
291 return 10
4.2 Fails occur during Step 6: "Register Set + Install Tcapcenter"
4.2.1 tcapcenter may fail to start. Please provide Tcaplus service personnel with tcapcenter.log in order for them to locate the fault.
Log path: /data/tcaplus/tcaplus_service/log/tcapcenter/tcapcenter.log
4.2.2 After the fault is solved, perform Step 6 again
4.3 Fails occur during Steps 8 - 10
Please open the OMS management website (for the URL and default account password details, see the output information in Step 5 in yellow font), click "Operation Platform - Transaction Processing" in sequence, locate the pending transaction and send the screen capture (including the following transaction log) to Tcaplus service personnel to locate the fault. After the fault is solved, just retry this transaction instead of re-performing this installation step