zabbix4与mysql8启动失败

zabbix-server提示缺少/usr/lib64/mysql/libmysqlclient.so.18,下载MySQL8 compat rpm

[root@localhost ~]# locate libmysqlclient.so.
/usr/lib64/mysql/libmysqlclient.so.21
/usr/lib64/mysql/libmysqlclient.so.21.1.19

[root@localhost src]# axel https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-libs-compat-8.0.19-1.el7.x86_64.rpm
Initializing download: https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-libs-compat-8.0.19-1.el7.x86_64.rpm
File size: 1365572 bytes
Opening output file mysql-community-libs-compat-8.0.19-1.el7.x86_64.rpm
Starting download

[root@localhost src]# rpm -ivh mysql-community-libs-compat-8.0.19-1.el7.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql-community-libs-compat-8.0.1################################# [100%]

[root@localhost /]# find / -name libmysqlclient.so.18
/usr/lib64/mysql/libmysqlclient.so.18

之后start zabbix-server仍然失败

[root@localhost /]# systemctl start zabbix-server
[root@localhost /]# systemctl status zabbix-server.service 
● zabbix-server.service - Zabbix Server
   Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; disabled; vendor preset: disabled)
   Active: activating (auto-restart) (Result: exit-code) since Wed 2020-02-12 10:09:36 CST; 8s ago
  Process: 5294 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=1/FAILURE)
  Process: 5291 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)

Feb 12 10:09:36 localhost.localdomain systemd[1]: zabbix-server.service: control process exited, code=exited status=1
Feb 12 10:09:36 localhost.localdomain systemd[1]: Unit zabbix-server.service entered failed state.
Feb 12 10:09:36 localhost.localdomain systemd[1]: zabbix-server.service failed.

查看zabbix-server.log

[root@localhost /]# find / -name zabbix_server.log
/var/log/zabbix/zabbix_server.log
[root@localhost /]# tail /var/log/zabbix/zabbix_server.log 
  6149:20200212:101515.535 VMware monitoring:         YES
  6149:20200212:101515.535 SMTP authentication:       YES
  6149:20200212:101515.535 ODBC:                      YES
  6149:20200212:101515.535 SSH2 support:              YES
  6149:20200212:101515.535 IPv6 support:              YES
  6149:20200212:101515.535 TLS support:               YES
  6149:20200212:101515.535 ******************************
  6149:20200212:101515.536 using configuration file: /etc/zabbix/zabbix_server.conf
  6149:20200212:101515.540 [Z3001] connection to database 'zabbix' failed: [2059] Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
  6149:20200212:101515.540 Cannot connect to the database. Exiting...

failed:mysql认证方式


[root@localhost /]# cat /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html

[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove the leading "# " to disable binary logging
# Binary logging captures changes between backups and is enabled by
# default. It's default setting is log_bin=binlog
# disable_log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
#
# Remove leading # to revert to previous value for default_authentication_plugin,
# this will increase compatibility with older clients. For background, see:
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin
default-authentication-plugin=mysql_native_password

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

mysql> select user,plugin  from user
    -> ;
+------------------+-----------------------+
| user             | plugin                |
+------------------+-----------------------+
| mysql.infoschema | caching_sha2_password |
| mysql.session    | caching_sha2_password |
| mysql.sys        | caching_sha2_password |
| root             | caching_sha2_password |
| zabbix           | caching_sha2_password |
+------------------+-----------------------+
5 rows in set (0.00 sec)

mysql> alter user 'zabbix'@'localhost' identified with mysql_native_password by '***********'
    -> ;
Query OK, 0 rows affected (0.01 sec)

再次启动失败查看日志***

 [root@localhost zabbix]# tail /var/log/zabbix/zabbix_server.log -n 50

  3805:20200212:111559.484 server #6 started [history syncer #1]
  3825:20200212:111559.484 server #26 started [alert manager #1]
  3825:20200212:111559.485 cannot initialize alert manager: Cannot bind socket to "/var/run/zabbix/zabbix_server_alerter.sock": [13] Permission denied.
  3799:20200212:111559.486 One child process died (PID:3825,exitcode/signal:1). Exiting ...
zabbix_server [3799]: Error waiting for process with PID 3825: [10] No child processes
  3799:20200212:111559.639 syncing trend data...
  3799:20200212:111559.639 syncing trend data done
  3799:20200212:111559.639 Zabbix Server stopped. Zabbix 4.4.5 (revision b93f5c4fc0).

*****最后关闭 SELINUX,reboot后正常,但查看status有failed

[root@localhost ~]# systemctl status zabbix-server.service 
● zabbix-server.service - Zabbix Server
   Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2020-02-12 14:38:05 CST; 2h 1min ago
   CGroup: /system.slice/zabbix-server.service
           ├─1389 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
        。。。。。。。。。。。。。

Feb 12 14:38:05 localhost.localdomain systemd[1]: Starting Zabbix Server...
Feb 12 14:38:05 localhost.localdomain systemd[1]: Can't open PID file /run/zabbix/zabbix_server.pid (yet?) after start: No such file or directory
Feb 12 14:38:05 localhost.localdomain systemd[1]: Started Zabbix Server.

未找到原因ing…

start nginx,未能打开localhost/zabbix。最后关闭nginx,打开httpd,打开zabbix正常。

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值