Offloading XI Database to Ubuntu

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
acentek
Posts: 123
Joined: Thu Jul 27, 2017 2:00 pm

Offloading XI Database to Ubuntu

Post by acentek »

We are testing Nagios XI on an Ubuntu 22.04 VM. We have installed the test environment and we can launch the Nagios XI. Now we would like to offload the DB to its own server. We are following this link:

https://answerhub.nagios.com/support/s/ ... _DB_Server

By the time we get to test phase, I am running into the following error:
ERROR 2003 (HY000): Can't connect to MySQL server on 'MySQLServerIP:3306' (111)

We have tried to use localhost. I have gone through the installation steps a few times now and I still receive the same error.
Attempted to set the mysql password prior to the installation steps.



Configuration steps taken:
nagiosxipass='xxxxxxxx'
dbmaintpass='xxxxxxxx'
nagiosqlpass='xxxxxxxx'
ndoutilspass='xxxxxxxx'


apt-get update
apt install mariadb-server
systemctl start mariadb.service

vi /etc/mysql/mariadb.conf.d/50-server.cnf

[mysqld]
bind-address=MySQL/MariaDBServerIP, RemoteXIServerIP
port=3306
query_cache_size=16M
query_cache_limit=4M
tmp_table_size=64M
max_heap_table_size=64M
key_buffer_size=32M
table_open_cache=32
innodb_file_per_table=1


mysql -u root

CREATE USER nagios@'RemoteXIServerIP' IDENTIFIED BY 'xxxxxxxx'
GRANT ALL ON nagios.* TO nagios@'RemoteXIServerIP'
GRANT PROCESS ON *.* TO nagios@'RemoteXIServerIP'
CREATE USER nagiosql@'RemoteXIServerIP' IDENTIFIED BY 'xxxxxxxx'
GRANT ALL ON nagiosql.* TO nagiosql@'RemoteXIServerIP'
GRANT PROCESS ON *.* TO nagiosql@'RemoteXIServerIP'
CREATE USER nagiosxi@'RemoteXIServerIP' IDENTIFIED BY 'xxxxxxxx'
GRANT ALL ON nagiosxi.* TO nagiosxi@'RemoteXIServerIP'
GRANT PROCESS ON *.* TO nagiosxi@'RemoteXIServerIP'
CREATE USER dbmaint_nagiosxi@'RemoteXIServerIP' IDENTIFIED BY 'xxxxxxxx'
GRANT ALL ON nagiosxi.* TO dbmaint_nagiosxi@'RemoteXIServerIP'
GRANT PROCESS ON *.* TO dbmaint_nagiosxi@'RemoteXIServerIP'
CREATE USER root@'RemoteXIServerIP' IDENTIFIED BY 'xxxxxxxx'
GRANT ALL ON *.* TO root@'RemoteXIServerIP'


ufw allow proto tcp from RemoteXIServerIP to any port 3306
ufw reload


Verification
mysql -u nagios -p'xxxxxxx' -h 'MySQL/MariaDBServerIP' -e STATUS;
mysql -u nagiosql -p'xxxxxxxx' -h 'MySQL/MariaDBServerIP' -e STATUS;
mysql -u nagiosxi -p'xxxxxxxx' -h 'MySQL/MariaDBServerIP' -e STATUS;
jsimon
Posts: 136
Joined: Wed Aug 23, 2023 11:27 am

Re: Offloading XI Database to Ubuntu

Post by jsimon »

Hi @acentek,

I believe the issue here is that you have two addresses in your bind-address where you should only have one. Basically if this config file is on your remote DB server, the config should look like this:

Code: Select all

[mysqld]
bind-address=MySQL/MariaDBServerIP
port=3306
Try making this change and restarting mysql on your remote server and then re-running the test command. Let us know if you still have issues after this.
Post Reply