Centos7安装部署Zabbix3.4
1.關閉selinux和firewall
1.1檢測selinux是否關閉
[root@localhost ~]# getenforce??
Disabled???????????????????????????????????? #Disabled?為關閉
1.1.1臨時關閉
[root@localhost ~]# setenforce 0? #設置SELinux 成為enforcing模式
1.1.2永久關閉
[root@localhost ~]# vi /etc/selinux/config:???
將SELINUX=enforcing改為SELINUX=disabled?
設置后需要重啟才能生效
1.2查看默認防火墻狀態
[root@localhost ~]# firewall-cmd --state?
not running?????????? #關閉后顯示not running,開啟后顯示running
1.2.1停止firewall
[root@localhost ~]# systemctl stop firewalld.service
1.2.2禁止firewall開機啟動
[root@localhost ~]# systemctl disable firewalld.service
?
2.Zabbix3.4程序安裝
2.1配置zabbix的yum源
[root@localhost ~]# rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
2.2安裝zabbix程序包,安裝mysql、zabbxi-agent
[root@localhost ~]# yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent mariadb-server
2.3啟動mariadb并設置開機啟動,創建數據庫實例,授權
[root@localhost ~]# systemctl start mariadb???? ?#啟動mariadb
[root@localhost ~]# systemctl enable mariadb? #設置開機啟動
[root@localhost ~]# mysql????????????? ????????????? ?#登入數據庫
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;?? #創建數據庫實例
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@'%' identified by 'zabbix'; ? #授權所有主機訪問數據庫實例zabbix,用戶名/密碼:zabbix/zabbix
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; ??#授權localhost主機名訪問數據庫實例zabbix,用戶名/密碼:zabbix/zabbix
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost.localdomain identified by 'zabbix'; ?#授權localhost.localdomain主機訪問數據庫實例zabbix,用戶名/密碼:zabbix/zabbix
Query OK, 0 rows affected (0.00 sec)
導入初始模式和數據
[root@localhost ~]# cd /usr/share/doc/zabbix-server-mysql-3.4.4/ ? ? ? ? ? ? ?#進入create.sql.gz所在目錄
[root@localhost zabbix-server-mysql-3.4.4]# zcat create.sql.gz |mysql -uroot zabbix ? ?#導入出事模式
?2.4啟動zabbix-server服務
2.4.1配置zabbix-server的配置文件zabbix_server.conf
[root@localhost zabbix-server-mysql-3.4.4]# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost ? ? ? ? ?# 數據主機名
DBName=zabbix ? ? ? ? ? ?# 數據庫實例
DBUser=zabbix ? ? ? ? ? ? ?# 用戶名
DBPassword=zabbix ? ? ?# 密碼
2.4.2啟動zabbix-server服務
[root@localhost zabbix-server-mysql-3.4.4]# systemctl start zabbix-server ? ? ? ? ? #啟動zabbix-server服務
[root@localhost zabbix-server-mysql-3.4.4]# systemctl enable zabbix-server ? ? ? #設置zabbix-server服務開機自啟動
無法啟動
# systemctl start zabbix-server
Job for zabbix-server.service failed. See 'systemctl status zabbix-server.service' and 'journalctl -xn' for details.
解決方法:先檢查selinux是否關閉,關閉后,并安裝trousers軟件。再次啟動zabbix-server服務便可以啟動成功。
# yum install trousers -y
# systemctl start zabbix-server
2.5編輯Apache的配置文件,消注釋設置正確的時區
[root@localhost zabbix-server-mysql-3.4.4]#?vi /etc/httpd/conf.d/zabbix.conf
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
php_value date.timezone Asia/Shanghai
啟動httpd服務 ,設置開機啟動httpd服務
[root@localhost ~]# systemctl start httpd ? ? ? ?#啟動httpd服務?
[root@localhost ~]# systemctl enable httpd ? ?#設置開機啟動httpd服務
3.啟動zabbix-agent并設置開機自啟動
[root@localhost ~]# systemctl start zabbix-agent ? ? ? ? ?# 啟動zabbix-agent服務
[root@localhost ~]# systemctl enable zabbix-agent ? ? ? # 設置zabbix-agent服務開機自啟動
4.Zabbix Web網頁安裝
4.1.在瀏覽器輸入地址http://服務器ip/zabbix/setup.php,出現歡迎界面,點擊下一步;
4.2.出現必要條件檢測界面,正常都是OK,點擊下一步
4.3.配置DB連接,與zabbix_server.conf文件中主機、數據庫名稱、用戶名、密碼保持一致,點擊下一步
4.4.zabbix服務器詳細信息,點擊下一步
4.5.安裝前匯總,檢查信息無誤,點擊下一步安裝
4.6.安裝成功
Congratulations! You have successfully installed Zabbix frontend.
配置文件目錄
Configuration file "/etc/zabbix/web/zabbix.conf.php" created.
5zabbix網頁登錄
在瀏覽器輸入http://zabbix服務器ip/zabbix/index.php,輸入管理員用戶名Admin(區分大小寫),默認密碼zabbix,點擊登入即可。
?
轉載于:https://www.cnblogs.com/shawhe/p/9598354.html
總結
以上是生活随笔為你收集整理的Centos7安装部署Zabbix3.4的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Powerdesigner 在线打开 不
- 下一篇: VMware下Centos7快速搭建vs