安装zabbix的方法
https://blog.51cto.com/lishiyan/2631080

第一页

第二页

第三页

第四页

mysql> mysql> mysql> alter user 'zabbix'@'%' identified with mysql_native_password by 'Root@123456';Query OK, 0 rows affected (0.00 sec)mysql> alter user 'zabbix'@'127.0.0.1' identified with mysql_native_password by 'Root@123456';Query OK, 0 rows affected (0.00 sec)mysql> alter user 'zabbix'@'localhost' identified with mysql_native_password by 'Root@123456';Query OK, 0 rows affected (0.00 sec)mysql> flush privileges;Query OK, 0 rows affected (0.01 sec)mysql> use mysqlReading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> select user,host,plugin,authentication_string from user;+------------------+-----------+-----------------------+------------------------------------------------------------------------+| user             | host      | plugin                | authentication_string                                                  |+------------------+-----------+-----------------------+------------------------------------------------------------------------+| repl             | %         | mysql_native_password | *286872C85B04AF686EFB0743834334D81AC2EE1E                              || zabbix           | %         | mysql_native_password | *286872C85B04AF686EFB0743834334D81AC2EE1E                              || zabbix           | 127.0.0.1 | mysql_native_password | *286872C85B04AF686EFB0743834334D81AC2EE1E                              || mysql.infoschema | localhost | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED || mysql.session    | localhost | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED || mysql.sys        | localhost | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED || root             | localhost | caching_sha2_password | $A$005$u#!vi\u;dcciY`pw46.Z387Zv/c4XEcVmmoTAcmHv7GjffosP0j9r/lFE. || zabbix           | localhost | mysql_native_password | *286872C85B04AF686EFB0743834334D81AC2EE1E                              |+------------------+-----------+-----------------------+------------------------------------------------------------------------+8 rows in set (0.00 sec)mysql> 

第五页

部署zabbix之后,在系统信息里提示以下错误Incorrect default charset for Zabbix database: "utf8mb4" instead "UTF8".故障原因:zabbix使用MySQL数据库时只支持utf8编码,使用utf8mb4编码虽然也没发现什么问题,但是说不定什么时候就发生了什么故障了,所以还是更改为utf8数据编码。解决方法:#备份数据库mysqldump -uroot -p --databases zabbix > zabbix.sql#开始直接想到的是直接更改数据库编码为utf8,登录数据库mysql -uroot -p #查看数据库编码MySQL [(none)]> show create database zabbix;+----------+--------------------------------------------------------------------+| Database | Create Database                                                    |+----------+--------------------------------------------------------------------+| zabbix   | CREATE DATABASE `zabbix` /*!40100 DEFAULT CHARACTER SET utf8mb4 */ |+----------+--------------------------------------------------------------------+1 row in set (0.001 sec)#更改数据库编码为utf8mb4MySQL [(none)]> alter database zabbix character set utf8;Query OK, 1 row affected (0.005 sec)MySQL [(none)]> show create database zabbix;+----------+-----------------------------------------------------------------+| Database | Create Database                                                 |+----------+-----------------------------------------------------------------+| zabbix   | CREATE DATABASE `zabbix` /*!40100 DEFAULT CHARACTER SET utf8 */ |+----------+-----------------------------------------------------------------+1 row in set (0.002 sec)刷新zabbix web页面,发现提示以下错误Unsupported charset or collation for tables: acknowledges, actions, alerts, application_discovery, application_prototype, applications, auditlog, auditlog_details, autoreg_host, conditions, config, config_autoreg_tls, corr_condition_tag, corr_condition_tagpair, corr_condition_tagvalue, correlation, dashboard, dchecks, drules, dservices, event_tag, events, expressions, functions, globalmacro, graph_theme, graphs, graphs_items, group_discovery, group_prototype, history_log, history_str, history_text, host_discovery, host_inventory, host_tag, hostmacro, hosts, housekeeper, hstgrp, httpstep, httpstep_field, httptest, httptest_field, icon_map, icon_mapping, ids, images, interface, interface_snmp, item_condition, item_discovery, item_preproc, item_rtdata, items, lld_macro_path, lld_override, lld_override_condition, lld_override_operation, lld_override_ophistory, lld_override_opperiod, lld_override_optag, lld_override_optrends, maintenance_tag, maintenances, mappings, media, media_type, media_type_message, media_type_param, module, opcommand, opconditions, operations, opmessage, problem, problem_tag, profiles, proxy_autoreg_host, proxy_dhistory, proxy_history, regexps, screens, screens_items, scripts, services, services_times, sessions, slides, slideshows, sysmap_element_url, sysmap_shape, sysmap_url, sysmaps, sysmaps_elements, sysmaps_link_triggers, sysmaps_links, tag_filter, task_data, task_remote_command, task_remote_command_result, task_result, trigger_tag, triggers, users, usrgrp, valuemaps, widget, widget_field.这个错误是由于之前创建的数据库编码是utf8mb4,直接更改为utf8的话会有个问题,旧的数据的编码并没有发生改变,所以无法识别出来#解决方法,将导出的zabbix数据库的sql数据文件中的utf8mb4字符修改成utf8之后再导入到zabbix数据库中cp zabbix.sql zabbix.sql.baksed -i 's/utf8mb4/utf8/g' zabbix.sql注意以下utf8_0900_ai_ci需要仔细查询下, sed -i 's/utf8_0900_ai_ci/utf8_bin/g' zabbix.sql mysql> show create database zabbix;+----------+---------------------------------------------------------------------------------------------------------------------+| Database | Create Database                                                                                                     |+----------+---------------------------------------------------------------------------------------------------------------------+| zabbix   | CREATE DATABASE `zabbix` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */ /*!80016 DEFAULT ENCRYPTION='N' */ |+----------+---------------------------------------------------------------------------------------------------------------------+1 row in set (0.00 sec)mysql> #导入数据库MySQL [(none)]> use zabbix;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -AsDatabase changedMySQL [zabbix]> source zabbix.sql.....................................Query OK, 0 rows affected (0.001 sec)Query OK, 0 rows affected (0.001 sec)导入完成后再次刷新页面发现错误提示消失,故障解决。

第六页

最好重新创建库 ,因此上边通过修改之后,发现出现报错dbversion这是之前的备份cp zabbix.sql zabbix.sql.baksed -i 's/utf8mb4/utf8/g' zabbix.sql注意以下utf8_0900_ai_ci需要仔细查询下, sed -i 's/utf8_0900_ai_ci/utf8_bin/g' zabbix.sql mysql> show create database zabbix; 然后再点击下一步Please create database manually, and set the configuration parameters for connection to this database. Press “Next step” button when done.问题来源:连接mariadb的时候总是连接不上解决方法:创建zabbix数据库的时候应该这样创建:create database zabbix character set utf8 collate utf8_bin;CREATE DATABASE `zabbix`  DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;然后导入create.sql然后执行分区等操作。

第七页

第八页

第九页

第十页

登陆网页

http://10.10.10.203/zabbix账号Admin 密码zabbix

zabbix的配置文件

[root@zabbix-server1 ~]# egrep -v "^$|^#" /etc/zabbix/zabbix_server.conf SourceIP=10.10.10.205LogFile=/var/log/zabbix/zabbix_server.logLogFileSize=0PidFile=/var/run/zabbix/zabbix_server.pidSocketDir=/var/run/zabbixDBHost=10.10.10.201 DBName=zabbixDBUser=zabbixDBPassword=Root@123456SNMPTrapperFile=/var/log/snmptrap/snmptrap.logTimeout=4AlertScriptsPath=/usr/lib/zabbix/alertscriptsExternalScripts=/usr/lib/zabbix/externalscriptsLogSlowQueries=3000[root@zabbix-server1 ~]# grep SourceIP /etc/zabbix/zabbix_server.confOption: SourceIP#SourceIP=SourceIP=10.10.10.205  #VIP地址

报错集锦

https://my.oschina.net/u/4847173/blog/4735064

©著作权归作者所有:来自51CTO博客作者李石岩的原创作品,如需转载,请注明出处,否则将追究法律责任

更多相关文章

  1. Oracle Linux 7.9+Oracle 12c+ASM安装文档--5、数据库软件安装
  2. 监控系统项目实施--安装与部署-- MySQL数据库
  3. 监控系统项目实施--安装与部署-- MySQL数据库--分区表创建
  4. 监控系统项目实施--安装与部署-- MySQL数据库--分区表创建2
  5. 监控系统项目实施--安装与部署-- MySQL数据库--备份脚本
  6. 干货!MySql DAL中间件总结
  7. 开发者要了解的图形数据库知识
  8. 介绍一款免费好用的可视化数据库管理工具
  9. 网易数据库运维自动化演进与 AIOps 探索

随机推荐

  1. 提高Linux安全性--hosts.allow, hosts.de
  2. Linux(七):常用命令-文件处理命令-目录处
  3. android启动后根文件系统分析
  4. Nessus-3.0.6【linux漏洞扫描工具】
  5. linux / vi 常用命令(ubuntu环境)
  6. Linux-自己创建动态库静态库
  7. 多队列网卡CPU中断均衡
  8. Linux系统编程——进程间通信:信号中断处
  9. Linux下安装mysql 出现依赖包冲突解决方
  10. ubi文件系统制作,还是"-c"选项的问题