CentOS7+zabbix 3.0+mysql5.5安装

前端之家收集整理的这篇文章主要介绍了CentOS7+zabbix 3.0+mysql5.5安装前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


一、准备Yum源,这里我们使用官方的Yum源

zabbix 3.0没有了zabbix_server这个包而是直接整合进zabbix_server_MysqL里面

#rpm-Uivh
#yumcleanall
#yummakecache

二、安装zabbix各组件

服务端

#yuminstallzabbix-agentzabbix-server-MysqLzabbix-getzabbix-webzabbix-web-MysqL{zabbix-agent|zabbix-sender}

安装MysqL

#groupadd-r-g306MysqL
#useradd-g306-u306-r-MMysqL
#tar-xfMysqL-5.5.28-linux2.6-x86_64.tar.gz-C/usr/local/#cd/usr/local/
#chown-RMysqL.MysqL./*#mkdir/data/MysqL5.5.28
#chown-RMysqL.MysqL/data/MysqL5.5.28
#scripts/MysqL_install_db--datadir=/data/MysqL5.5.28--user=MysqL

my.cnf配置

#cpmy-small.cnf/etc/my.cnf[client]
port		=3306socket		=/data/MysqL5.5.28/MysqL.sock
[MysqLd]
port		=3306socket		=/data/MysqL5.5.28/MysqL.sock
server-id	=1log-bin=MysqL-bin
pid-file=/data/MysqL5.5.28/MysqL.pid
innodb-file-per-table=1datadir=/data/MysqL5.5.28[MysqLdump]
quick
max_allowed_packet=16M
[MysqL]
no-auto-rehash
[myisamchk]
key_buffer_size=8M
sort_buffer_size=8M
[MysqLhotcopy]
interactive-timeout

cp MysqLd 并加入自动启动

#cpMysqL.server/etc/init.d/MysqLd
#chmod+x/etc/init.d/MysqLd
#chkconfig--addMysqLd
#chkconfigMysqLd--listMysqLd	
0:off	1:off	2:on	3:on	4:on	5:on	6:off#serviceMysqLdstart

创建zabbix库并授权

#MysqL
WelcometotheMariaDBmonitor.Commandsendwith;or\g.
YourMysqLconnectionidis560Serverversion:5.5.28-logMysqLCommunityServer(GPL)

Copyright(c)2000,2015,Oracle,MariaDBCorporationAbandothers.Type'help;
'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.

MysqL[(none)]>CREATEDATABASEzabbix;
MysqL[(none)]>GRANTALLONzabbix.*TOzabbix@'127.0.0.1'IDENTIFIEDBY'zabbixpass';
MysqL[(none)]>FLUSHPRIVILEGES;

客户端:

#yuminstallzabbix-senderzabbix-agent-y

三、配置zabbix并启动

zabbix-server:

#grep-v"^#"zabbix_server.conf
ListenPort=10051
SourceIP=172.16.0.2
LogFile=/var/log/zabbix/zabbix_server.log
PidFile=/var/run/zabbix/zabbix_server.pid
DBHost=127.0.0.1DBName=zabbix
DBUser=zabbix
DBPassword=zabbixpass
DBSocket=/data/MysqL5.5.28/MysqL.sock
StartPollers=2
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000#systemctlstartzabbix-server.service

zabbix-web:

#rpm-qfzabbix.confzabbix-web-3.0.5-1.el7.noarch
#grep"Asia/Shanghai"/etc/httpd/conf.d/zabbix.conf					
#只需修改这里即可
Alias/zabbix/usr/share/zabbix
PHP_valuedate.timezoneAsia/Shanghai#systemctlstarthttpd.service

#ss-tnl|grep"10051\|80"LISTEN0128*:10051*:*
LISTEN0128:::80:::*
LISTEN0128:::10051:::*

然后访问http://serverIP/zabbix第一次它会自动跳到http://serverIP/zabbix/setup.PHP 根据提示填入相应的即可,很简单,配置完毕后会在生成zabbix.conf.PHP文件

#cat/etc/zabbix/web/zabbix.conf.PHP
<?PHP//ZabbixGUIconfigurationfile.global
$DB;$DB['TYPE']='MysqL';
$DB['SERVER']='127.0.0.1';
$DB['PORT']='0';
$DB['DATABASE']='zabbix';
$DB['USER']='zabbix';
$DB['PASSWORD']='zabbixpass';
//Schemaname.UsedforIBMDB2andPostgresql.$DB['SCHEMA']=''
;$ZBX_SERVER='localhost';
$ZBX_SERVER_PORT='10051';
$ZBX_SERVER_NAME='';
$IMAGE_FORMAT_DEFAULT=IMAGE_FORMAT_PNG;

登入信息:

defaultlogin:username:adminpassword:zabbix
原文链接:https://www.f2er.com/centos/379860.html

猜你在找的CentOS相关文章