gpt4 book ai didi

zabbix 服务器无法启动 - 数据库错误

转载 作者:行者123 更新时间:2023-12-02 16:58:07 25 4
gpt4 key购买 nike

我在 centOS 7 上启动 zabbix 服务器时遇到问题。

这是我尝试启动 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.

这是我在 zabbix 服务器日志中看到的内容:

[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

这是我的/etc/zabbix/zabbix_server.conf 文件:

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

这是我的/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;
?>

我可以使用与我在两个配置文件中列出的相同的凭据连接到 mysql 数据库:

[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.

所以不知道为什么zabbix服务器连接数据库失败。

我希望得到一些帮助!

最佳答案

对我来说,问题是在 /etc/zabbix/zabbix_server.conf 中,我设置了 DBPassword 参数,并在实际密码周围用(双)引号引起来。

<小时/>

配置必须是:

DBPassword=ZABBIX_DB_PASSWORD

而不是:

DBPassword="ZABBIX_DB_PASSWORD"

关于zabbix 服务器无法启动 - 数据库错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36905728/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com