Moving our production NetXMS server to a new computer server. I have an issue.

Started by jbriseno, June 03, 2022, 04:22:05 PM

Previous topic - Next topic

jbriseno

Hi, there. We decided to move our production NetXMS server to a new computer server. With this idea in mind. I did the following:


1. backed up the database file of the production NetXMS server.
2. In the new computer server, I installed:

2.1 Ubuntu 20.204
2.3. mysql Ver 15.1 Distrb 10.3.34-MariaDB

3. I moved the backed database to the new computer server

4. I restored the backed database into the new computer server

5. I installed the latest NetXMS server version in to the new computer server
at the final of this procedure appeared the following steps:

###
Additional steps required:

1. Edit default configuration file (/etc/netxmsd.conf)

2. Load database schema

   nxdbmgr init

3. Start daemon with command:

   systemctl start netxms-server

###

I omited the step 2. Because, I want to use our current database.

In the step 3, when I executed this command sent back on my end the following message:

Failed to start netxms-server.service: Unit netxms-server.service not found.

I run the following command:

sudo systemctl status netxmsd
● netxmsd.service - NetXMS Server
     Loaded: loaded (/lib/systemd/system/netxmsd.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2022-06-02 19:25:39 UTC; 18h ago
    Process: 119243 ExecStart=/usr/bin/netxmsd -d (code=exited, status=0/SUCCESS)
   Main PID: 119244 (code=exited, status=3)

Jun 02 19:25:39 netxms systemd[1]: netxmsd.service: Scheduled restart job, restart counter >
Jun 02 19:25:39 netxms systemd[1]: Stopped NetXMS Server.
Jun 02 19:25:39 netxms systemd[1]: netxmsd.service: Start request repeated too quickly.
Jun 02 19:25:39 netxms systemd[1]: netxmsd.service: Failed with result 'exit-code'.
Jun 02 19:25:39 netxms systemd[1]: Failed to start NetXMS Server.

What I did wrong?

Any comments are welcome.

My best
Jose

Filipp Sudanov

try
sudo systemctl start netxmsd
instead of
systemctl start netxms-server

jbriseno

HI, Filiipp. First thanks for your sooner reply. Second I did that you described in the post reply.

$ sudo systemctl start netxmsd

When I execute the next command. The netxmsd still not running

$ sudo systemctl status netxmsd
● netxmsd.service - NetXMS Server
     Loaded: loaded (/lib/systemd/system/netxmsd.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2022-06-03 14:56:01 UTC; 3s ago
    Process: 148891 ExecStart=/usr/bin/netxmsd -d (code=exited, status=0/SUCCESS)
   Main PID: 148892 (code=exited, status=3)

Jun 03 14:56:01 netxms systemd[1]: netxmsd.service: Scheduled restart job, restart counter >
Jun 03 14:56:01 netxms systemd[1]: Stopped NetXMS Server.
Jun 03 14:56:01 netxms systemd[1]: netxmsd.service: Start request repeated too quickly.
Jun 03 14:56:01 netxms systemd[1]: netxmsd.service: Failed with result 'exit-code'.
Jun 03 14:56:01 netxms systemd[1]: Failed to start NetXMS Server.

jbriseno

Hi, Filipp. I decided tu remove netxm server from the new computer server. Then I reinstalled. Bingo !

It works !

I attach the systemctl status netxmsd message.

somebody@netxms:~$ sudo systemctl status netxmsd
● netxmsd.service - NetXMS Server
     Loaded: loaded (/lib/systemd/system/netxmsd.service; disabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-06-03 16:38:21 UTC; 10s ago
    Process: 152786 ExecStart=/usr/bin/netxmsd -d (code=exited, status=0/SUCCESS)
   Main PID: 152797 (netxmsd)
      Tasks: 2 (limit: 2237)
     Memory: 4.2M
     CGroup: /system.slice/netxmsd.service
             └─152797 /usr/bin/netxmsd -d

Jun 03 16:38:21 netxms systemd[1]: Starting NetXMS Server...
Jun 03 16:38:21 netxms systemd[1]: netxmsd.service: Can't open PID file /run/netxmsd.pid (yet?) after start: Operation no>
Jun 03 16:38:21 netxms systemd[1]: Started NetXMS Server.

But, when I want to logging to this new computer server. The NetXMC client sent back the following message.

connect timed out.

I attach a screenshot.



Any idea how can I fix this connection issue?

Thanks in advance

My best

Jose

jbriseno


jbriseno

Hi, there. I added the latest lines of the netxmsd logfile.

The tail of the file /var/log/nextmsd

2022.06.04 18:23:14.398 *I* [logger             ] Log file opened (rotation policy 2, max size 16777216)
2022.06.04 18:23:14.398 *I* [startup            ] Starting NetXMS server version 4.1.333 build tag 4.1-333-gf37ab67d18
2022.06.04 18:23:14.398 *I* [logger             ] Debug level set to 0
2022.06.04 18:23:14.398 *I* [config             ] Main configuration file: /etc/netxmsd.conf
2022.06.04 18:23:14.398 *I* [config             ] Configuration tree:
2022.06.04 18:23:14.398 *I* [config             ] config
2022.06.04 18:23:14.398 *I* [config             ]  +- server
2022.06.04 18:23:14.399 *I* [config             ]      +- LogFile
2022.06.04 18:23:14.399 *I* [config             ]      |    value: /var/log/netxmsd
2022.06.04 18:23:14.399 *I* [config             ]      +- DBDriver
2022.06.04 18:23:14.399 *I* [config             ]           value: mariadb.ddr
2022.06.04 18:23:14.399 *I* [startup            ] Using system default codepage
2022.06.04 18:23:14.400 *I* [                   ] Platform subagent "/usr/lib/x86_64-linux-gnu/netxms/linux.nsm" successfully loaded
2022.06.04 18:23:14.401 *I* [db.drv             ] Database driver "mariadb.ddr" loaded and initialized successfully
2022.06.04 18:23:14.401 *I* [comm.listener      ] SocketListener/LocalAdmin: listening on 127.0.0.1:21784
2022.06.04 18:23:14.401 *I* [comm.listener      ] SocketListener/LocalAdmin: listening on [127.0.0.1]:21784

I hope this helps

My best
Jose

Filipp Sudanov

Are there also lines like this in the log:

2022.06.06 11:41:35.641 *I* [comm.listener      ] SocketListener/Clients: listening on 0.0.0.0:4701
2022.06.06 11:41:35.641 *I* [comm.listener      ] SocketListener/Clients: listening on [0.0.0.0]:4701

Victor Kirhenshtein

Try to run netxmsd with elevated debug by adding
DebugLevel = 6
to /etc/netxmsd.conf and share log file for startup.

Best regards,
Victor

jbriseno

Hi, Filipp. I did that you mentioned in the your latest post reply.  I did not find 2022.06.06 11:41:35.641 *I* [comm.listener      ] SocketListener/Clients: listening on 0.0.0.0:4701

However I found in the same file the following lines:

2022.06.07 13:05:47.148 *I* [                   ] Platform subagent "/usr/lib/x86_64-linux-gnu/netxms/linux.nsm" successfully loaded
2022.06.07 13:05:47.149 *I* [db.drv             ] Database driver "mariadb.ddr" loaded and initialized successfully
2022.06.07 13:05:47.150 *I* [comm.listener      ] SocketListener/LocalAdmin: listening on 127.0.0.1:21784
2022.06.07 13:05:47.150 *I* [comm.listener      ] SocketListener/LocalAdmin: listening on [127.0.0.1]:21784
2022.06.07 13:06:12.175 *E* [db                 ] Unable to establish connection with database (Access denied for user 'netxms'@'localhost' (using password: NO))

I hope these lines help.
My best
Jose

Filipp Sudanov

Well, this line gives the answer:
2022.06.07 13:06:12.175 *E* [db                 ] Unable to establish connection with database (Access denied for user 'netxms'@'localhost' (using password: NO))
NetXMS was not able to connect to the database. Check your login and password and that the database accepts connection from that IP address.

jbriseno

Hi, Filipp. I am agree with you. However, I can log to the database with the same root credentials. I attach a screenshot. It is weird for me. Meanwhile I was working in this database connection issue. I have the following idea:

Because, I moved the database file into a new computer server. Maybe, I need to use the same root password that I use in the production server. I am going to try it.

My best
Jose

Filipp Sudanov

Try connecting from the machine where your netxms server is running by giving the IP address of your database server:

mysql -u root -p -h 1.2.3.4

1.2.3.4 should be replaced by IP address of your database server.

jbriseno

Done ! the mysql command sent back the following message on my end:

ERROR 2002 (HY000): Can't connect to MySQL server on databse IP address

Whoops !

My best
José

Side note: NetXMS server and NextXMS database server are in the same IP address.

Filipp Sudanov

How the IP of DB server is configured in netxmsd.conf? Is it like this:
DBServer=127.0.0.1

If so, try
mysql -u root -p -h 127.0.0.1

jbriseno

Done ! I attach a screenshot.

Also,  I decided to open the log file of the netxmsd. I found the following information in the latest line:

2022.06.07 16:44:25.647 *E* [db                 ] Your database has format version 40.100, but server is compiled for version 41.17