您好,登錄后才能下訂單哦!
本文將為大家詳細介紹安裝部署zabbix監控系統的教程,內容詳細步驟清晰,細節處理妥當,希望大家通過這篇文章有所收獲,我們先來看看配置步驟:
1. 修改主機名
vim /etc/hostname ,修改為zabbix-server
2. 網卡配置
vim /etc/sysconfig/network-scripts/ifcfg-eno16780032
3. 關閉防火墻和selinux
systemctl stop firewalld.service
systemctl disable firewalld.service
4. 關閉selinux
vim /etc/selinux/config,修改為:SELINUX=disabled
5. 初始化系統(內核優化等,非必選)
6. 配置yum源
rpm -Uvh https://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
yum clean all
yum makecache
7. 安裝zabbix服務端
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
8. 啟動zabbix-server zabbix-agent httpd
systemctl restart zabbix-server zabbix-agent httpd
systemctl enable zabbix-server zabbix-agent httpd
9. 下載數據庫服務端和客戶端
wget https://cdn.mysql.com/archives/mysql-5.6/MySQL-server-5.6.43-1.el7.x86_64.rpm
wget https://cdn.mysql.com//Downloads/MySQL-5.6/MySQL-client-5.6.43-1.el7.x86_64.rpm
10. 數據庫服務端和客戶端安裝
rpm -ivh MySQL-server-5.6.43-1.el7.x86_64.rpm --force -nodeps
rpm -ivh MySQL-client-5.6.43-1.el7.x86_64.rpm --force --nodeps
11. 創建相關目錄及目錄授權
mkdir -p /data/mysql/
chown -R mysql.mysql /data/mysql/
12. 修改數據庫配置文件
vim /etc/my.cnf
[client]
port = 3306
socket = /data/mysql/mysql.sock
[mysqld]
user = mysql
port = 3306
character-set-server = utf8
default-storage-engine = InnoDB
socket = /data/mysql/mysql.sock
pid-file = /data/mysql/mysql.pid
# DATA STORAGE #
datadir = /data/mysql/
innodb_data_file_path = ibdata1:1024M:autoextend
innodb_data_home_dir = /data/mysql/
innodb_log_group_home_dir = /data/mysql/
# LOGGING #
log-error = /data/mysql/mysql-error.log
log-queries-not-using-indexes = 0
slow-query-log = 1
long_query_time = 2
slow-query-log-file = /data/mysql/mysql-slow.log
lower_case_table_names = 1
skip-grant-tables
13.初始化數據庫
/usr/bin/mysql_install_db --user=mysql --datadir=/data/mysql --pid-file=/data/mysql/mysql.pid
14. 啟動數據庫及設置root密碼
/etc/init.d/mysql restart
mysqladmin -h 127.0.0.1 -uroot -p password
15. 登錄數據庫,mysql -uroot -p
16. 創建zabbix數據庫 zabbix數據庫的密碼為zabbix
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'
17. 導入數據庫
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
18. 編輯Zabbix前端PHP配置,主要是更改時區
vim /etc/httpd/conf.d/zabbix.conf
修改此行:php_value date.timezone Asia/Shanghai
systemctl restart httpd
19. 瀏覽器訪問并配置
http://192.168.8.133/zabbix/
20. 修改為中文界面
在Adminstration-->Users下面找到對應的用戶,點進去,找到Language,選擇Chinese(zh_CN),更新后,刷新頁面即可切換為中文界面。
21. zabbix客戶端安裝配置
centos7:
rpm -Uvh https://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
yum -y install zabbix-agent
systemctl enable zabbix-agent
sed -i 's/Server=127.0.0.1/Server=192.168.8.133/' /etc/zabbix/zabbix_agentd.conf
sed -i 's/ServerActive=127.0.0.1/ServerActive==192.168.8.133/' /etc/zabbix/zabbix_agentd.conf
echo "192.168.8.133 Zabbix server" >> /etc/hosts
systemctl restart zabbix-agent
centos6:
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/6/x86_64/zabbix-release-3.4-1.el6.noarch.rpm
yum install zabbix-agent
chkconfig zabbix-agent on
sed -i 's/Server=127.0.0.1/Server=192.168.8.133/' /etc/zabbix/zabbix_agentd.conf
sed -i 's/ServerActive=127.0.0.1/ServerActive==192.168.8.133/' /etc/zabbix/zabbix_agentd.conf
echo "192.168.8.133 Zabbix server" >> /etc/hosts
service zabbix-agent start
配置zabbix-server服務器的hosts
vim /etc/hosts
包含服務端和所有客戶端的主機
根據監控需要完成監控項目的配置
看完這篇文章,你們學會安裝部署zabbix監控系統了嗎?如果還想學到更多技能或想了解更多相關內容,歡迎關注億速云行業資訊頻道,感謝各位的閱讀。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。