4

I'm having trouble starting zabbix server on centOS 7.

This is the status message I get after trying to start zabbix-server:

[root@monitor2:~] #systemctl status zabbix-server
zabbix-server.service - Zabbix Server
   Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; disabled)
   Active: failed (Result: start-limit) since Thu 2016-04-28 01:15:16 EDT; 20s ago
  Process: 23744 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=killed, signal=SEGV)
 Main PID: 31446 (code=exited, status=1/FAILURE)

Apr 28 01:15:16 monitor2 systemd[1]: zabbix-server.service: control process exited, code=killed status=11
Apr 28 01:15:16 monitor2 systemd[1]: Failed to start Zabbix Server.
Apr 28 01:15:16 monitor2 systemd[1]: Unit zabbix-server.service entered failed state.
Apr 28 01:15:16 monitor2 systemd[1]: zabbix-server.service holdoff time over, scheduling restart.
Apr 28 01:15:16 monitor2 systemd[1]: Stopping Zabbix Server...
Apr 28 01:15:16 monitor2 systemd[1]: Starting Zabbix Server...
Apr 28 01:15:16 monitor2 systemd[1]: zabbix-server.service start request repeated too quickly, refusing to start.
Apr 28 01:15:16 monitor2 systemd[1]: Failed to start Zabbix Server.
Apr 28 01:15:16 monitor2 systemd[1]: Unit zabbix-server.service entered failed state.

And this is what I see in the zabbix server log:

[root@monitor2:~] #tail /var/log/zabbix/zabbix_server.log
zabbix_server [24366]: [file:'log.c',line:271] lock failed: [43] Identifier removed
zabbix_server [24366]: [file:'log.c',line:271] lock failed: [43] Identifier removed
zabbix_server [24370]: [file:'log.c',line:271] lock failed: [43] Identifier removed
zabbix_server [24370]: [file:'log.c',line:271] lock failed: [43] Identifier removed
zabbix_server [24374]: [file:'log.c',line:271] lock failed: [43] Identifier removed
zabbix_server [24374]: [file:'log.c',line:271] lock failed: [43] Identifier removed
 24378:20160428:011714.312 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: YES)
 24378:20160428:011714.312 database is down: reconnecting in 10 seconds
 19933:20160428:011714.593 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: YES)
 19933:20160428:011714.593 database is down: reconnecting in 10 seconds

This is my /etc/zabbix/zabbix_server.conf file:

LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
DBName=zabbix
DBUser=zabbix
DBPassword='secret'
SNMPTrapperFile=/var/log/snmptt/snmptt.log
ListenIP=127.0.0.1
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts

And this is my /etc/zabbix/web/zabbix.conf.php

 <?php
// Zabbix GUI configuration file.
global $DB;

$DB['TYPE']     = 'MYSQL';
$DB['SERVER']   = '127.0.0.1';
$DB['PORT']     = '0';
$DB['DATABASE'] = 'zabbix';
$DB['USER']     = 'zabbix';
$DB['PASSWORD'] = 'secret';

// Schema name. Used for IBM DB2 and PostgreSQL.
$DB['SCHEMA'] = '';

$ZBX_SERVER      = 'zabbix.example.com';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = 'Zabbix';

$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
?>

And I can connect to the mysql database using the same credentials as I have listed in both config files:

[root@monitor2:~] #mysql -uzabbix -p -h 127.0.0.1
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 36326
Server version: 10.0.22-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

So I don't know why the zabbix server fails to connect to the database.

I'd appreciate some help on this!

bluethundr
  • 1,005
  • 17
  • 68
  • 141
  • The first snippet seems to say that Zabbix server exited because of SEGV, which probably means that it crashed. Could you please post a longer part of the log? – asaveljevs Apr 28 '16 at 06:24
  • Hmm yeah that makes sense. I seem to be running a bit low on memory for this server. I wonder if that could by the reason for the SEGV: `[root@monitor2:~] #free -m total used free shared buff/cache available Mem: 992 388 183 52 421 332 Swap: 511 143 368`. So I stopped a few services, cleared the log and tried starting the zabbix-server again. This is the entire log that was created from that attempt: http://pastebin.centos.org/44401/ Thanks! – bluethundr Apr 28 '16 at 11:39
  • There seems to be two problems. One is MySQL database access: ` 19933:20160428:074746.723 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: YES)`. That you will have to resolve somehow - either connection settings in Zabbix are not correct or MySQL refuses access for other reasons. – asaveljevs Apr 28 '16 at 12:13
  • The other problem is `zabbix_server [7333]: [file:'log.c',line:271] lock failed: [43] Identifier removed`. That may or may not be a yet another case of [ZBX-3974](https://support.zabbix.com/browse/ZBX-3974). – asaveljevs Apr 28 '16 at 12:14
  • Ok, thanks. I think the main problem I need to resolve currently is the mysql connection error. As I point out in the OP I have the same settings in my zabbix_server.conf and my zabbix.conf.php for connecting to the database. And I can connect to the DB on the command line using those settings. So why can't the zabbix server connect to the database? That's the main issue I believe. Thanks! – bluethundr Apr 28 '16 at 14:39
  • What if you specify "DBHost=127.0.0.1"? According to zabbix_server.conf, if "DBHost" is set to "localhost" (the default), then socket is used. – asaveljevs May 02 '16 at 06:47
  • Thanks, I tried that. But no change. This is what I get in the logs when I tried to start zabbix server: ' 20729:20160503:095438.743 [Z3001] connection to database 'zabbix' failed: [2005] Unknown MySQL server host ''127.0.0.1'' (-2)' . zabbix_server.conf has this: DBHost='127.0.0.1' and web/zabbix.conf.php I have: $DB['SERVER'] = '127.0.0.1'; Any other ideas? – bluethundr May 03 '16 at 13:48
  • Did you use `DBHost=127.0.0.1` or `DBHost='127.0.0.1'`? The former should be used, without single quotes. – asaveljevs May 05 '16 at 08:08
  • I used DBHost=127.0.0.1 without quotes. Same issue in the logs `22857:20160505:191332.415 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: YES) 22857:20160505:191332.415 database is down: reconnecting in 10 seconds 20735:20160505:191333.449 [Z3001] connection to database 'zabbix' failed: [2005] Unknown MySQL server host ''127.0.0.1'' (-2) 20735:20160505:191333.449 database is down: reconnecting in 10 seconds` – bluethundr May 05 '16 at 23:02
  • Hi @bluethundr , any news on this one ? I have the same issue with the mysql connection , with the packaged install on Debian 8 Jessie. Did you sole the issue ? (How, then ?) – fleuryc May 26 '16 at 09:23

1 Answers1

2

For me, the problem was that in /etc/zabbix/zabbix_server.conf, I had set the DBPassword parameter with (double) quotes around the actual password.


The configuration must be :

DBPassword=ZABBIX_DB_PASSWORD

And not :

DBPassword="ZABBIX_DB_PASSWORD"
fleuryc
  • 493
  • 7
  • 24