Page 1 of 1

Offload MySql to remote server.

Posted: Wed Jul 21, 2021 2:27 pm
by tbarnett
So I have followed the document https://assets.nagios.com/downloads/nag ... Server.pdf

I'm successfully at the place where I am sending data from the old NagiosXI server DB to the new stand alone DB.

This command (mysqldump -u root -p'nagiosxi' nagios | mysql -u nagios -p'nagiosP@ssw0rd' -h 10.200.4.160 nagios) results in an error.
[root@nagios barnt]# mysqldump -u root -p'nagiosxi' nagios | mysql -u nagios -p'nagiosP@ssw0rd' -h 10.200.4.160 nagios
mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `nagios_notifications` at row: 1834

The dump for the other two databases works correctly.

I did successfully run the rebuild databases command before I started this process.

Can someone tell me why this is not working?

thx

Tom

Re: Offload MySql to remote server.

Posted: Thu Jul 22, 2021 1:58 pm
by gsmith
Hey Tom,

It might be a large table. Let's add the --quick and --max_allowed_packet=512M options.

So now your command would be:

Code: Select all

mysqldump -u root -p'nagiosxi' --quick --max_allowed_packet=512M nagios | mysql -u nagios -p'nagiosP@ssw0rd' -h 10.200.4.160 nagios
Let me know how that works.

Thanks

Re: Offload MySql to remote server.

Posted: Thu Jul 22, 2021 2:25 pm
by tbarnett
It was a large table. I ended up doing a dump with MySQL workshop and then an import.

That worked and my Nagios DB is running on a separate server now.

Thanks for the reply.

Tom

Re: Offload MySql to remote server.

Posted: Thu Jul 22, 2021 2:32 pm
by gsmith
Hi

That was going to be Plan B ;)

Glad you got it solved.

Locking thread.