zabbix监控部署不需要LNMP或LAMP架构超简单!

zabbix yum源

[root@web ~]# rpm -ivh http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

修改源zabbix4.0版本

[root@zabbix ~]# vim /etc/yum.repos.d/zabbix.repo

[zabbix]
name=Zabbix Official Repository - \$basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/\$basearch/
enabled=1
gpgcheck=1  #看报错修改0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - \$basearch
baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/\$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1   #看报错修改0

安装部署zabbix数据库 zabbix-server

[root@zabbix ~]# yum install zabbix-server-mysql zabbix-web-mysql -y

启动mariadb
[root@zabbix ~]# yum -y install  mariadb-server  mariadb
[root@zabbix ~]# systemctl enable  mariadb 
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service
[root@zabbix ~]# systemctl start mariadb

初始化数据库

[root@zabbix ~]# mysql_secure_installation   #初始化数据库
Enter current password for root (enter for none):    #直接Enter
Set root password? [Y/n] y
New password: XXXX   #你的密码
Re-enter new password: XXXXX   #确认密码
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
Thanks for using MariaDB!

登陆数据库授权zabbix

[root@172-8-8-172 ~]# mysql -uroot -p
Enter password:    #输入你设置的密码
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 5.5.68-MariaDB MariaDB Server

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

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> create database zabbix  character set utf8 collate utf8_bin;   #创建zabbix库
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all  on zabbix.*  to zabbix@'localhost'   identified  by  'zabbix';   #授权并修改密码
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;   #刷新
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> quit    #退出
Bye  


MariaDB [(none)]> create database zabbix  character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all  on zabbix.*  to zabbix@'localhost'   identified  by  'zabbix';



[root@172-8-8-172 ~]# cd /usr/share/doc/
[root@zabbix doc]# cd zabbix-server-mysql-4.0.31/    #你的zabbix版本目录 
[root@zabbix zabbix-server-mysql-4.0.31]# zcat create.sql.gz | mysql -uzabbix -pzabbix  zabbix


 

 修改配置文件

[root@localhost zabbix-server-mysql-3.4.15]# vim /etc/httpd/conf/httpd.conf 
#ServerName www.example.com:80    #把#号去掉修改伟ServerName 172.0.0.1:80 (你可以:/ServerName或者:set nu 看多少行95)
95 ServerName 172.0.0.1:80
[root@localhost zabbix-server-mysql-3.4.15]# vim  /etc/httpd/conf.d/zabbix.conf 
 php_value date.timezone Asia/Shanghai        # 在<IfModule mod_php5.c>最后一行加入
[root@localhost zabbix-server-mysql-3.4.15]# systemctl  restart  httpd 
[root@localhost zabbix-server-mysql-3.4.15]# systemctl  enable  httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.

修改zabbix_server 的配置数据库的文件  数据库不在一台机器上修改下

[root@web zabbix]# vim /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix   #你设置的密码

mysql   -uzabbix  -pzabbix   -h  localhost

访问  http://47.103.59.22/zabbix/

全部显示OK即可

输入密码直接下一步

直接下一步

 

下一步

下一步

输入账号密码一般默默认为Admin密码你自己的

OK了

 

是不是很简单呢,后期慢慢更新!

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值