上城網(wǎng)站建設(shè)百度快照推廣是什么意思
文章目錄
- 前言
- 一. 實(shí)驗(yàn)環(huán)境
- 二. 安裝zabbix過程
- 2.1. 安裝zabbix源
- 2.2 安裝zabbix相關(guān)的軟件
- 2.3 安裝數(shù)據(jù)庫并啟動(dòng)
- 2.4 開始初始化數(shù)據(jù)庫:
- 2.5 創(chuàng)建數(shù)據(jù)庫實(shí)例及對(duì)應(yīng)的用戶
- 2.6 導(dǎo)入官網(wǎng)提供的數(shù)據(jù)
- 2.7 配置zabbix 服務(wù)的配置文件
- 2.8. 啟動(dòng)服務(wù)
- 2.9 從網(wǎng)頁進(jìn)行安裝
- 2.10 登陸zabbix
- 總結(jié)
前言
大家好,我是沐風(fēng)曉月,本文主要講解在rocky9.0系統(tǒng)下實(shí)現(xiàn)zabbix6.0版本的部署。
號(hào)外:
在大佬的指導(dǎo)下,把csdn的專欄做了細(xì)分,目前正在更新的有以下幾個(gè)專欄,會(huì)依次進(jìn)行整理和更新,如果你有更好的想法,歡迎與我交流。
這份表格后面還會(huì)繼續(xù)優(yōu)化,希望能等到你的建議:學(xué)習(xí)永無止境,茫茫人海,一起加油努力!
python全棧領(lǐng)跑營 | python地基-零基礎(chǔ)入門篇 | 萬事開頭難,先進(jìn)門再說 |
---|---|---|
語法進(jìn)階篇 | 主要圍繞多線程編程,正則表達(dá)式,各類項(xiàng)目展開 | |
爬蟲入門與實(shí)戰(zhàn) | 沒有什么是爬蟲解決不了的 | |
自動(dòng)化辦公篇 | 搞定常用辦公軟件的自動(dòng)化操作 | |
數(shù)據(jù)庫開發(fā)實(shí)戰(zhàn)篇 | 無數(shù)據(jù),不運(yùn)營,搞定數(shù)據(jù)庫開發(fā) | |
數(shù)據(jù)分析篇 | 待更新 | |
python web實(shí)戰(zhàn)篇 | 實(shí)現(xiàn)想要的網(wǎng)站的各種功能,擁有自己的網(wǎng)站 | |
人工智能篇 | 這才是我們的終極目標(biāo) | |
云原生 | DevOPS | 掌握devops技術(shù)棧,CI/CD |
微服務(wù)和服務(wù)網(wǎng)格(istio) | 詳盡的講解微服務(wù)架構(gòu) | |
分布式數(shù)據(jù)庫與存儲(chǔ) | 分布式是高薪必備 | |
云原生周邊-組件-安全-監(jiān)控 | 云原生網(wǎng)絡(luò),安全,存儲(chǔ)等底層技術(shù) | |
go語言專欄 | go語言基礎(chǔ)-零基礎(chǔ)入門篇 | 萬事開頭難,先進(jìn)門再說 |
語法進(jìn)階篇 | 主要圍繞多線程編程,正則表達(dá)式,各類項(xiàng)目展開 | |
go web框架 | 沒有什么網(wǎng)站是不能用go實(shí)現(xiàn)的 | |
go二次開發(fā) | 對(duì)云原生產(chǎn)品做二次開發(fā) | |
數(shù)據(jù)庫開發(fā)實(shí)戰(zhàn)篇 | 無數(shù)據(jù),不運(yùn)營,搞定數(shù)據(jù)庫開發(fā) | |
數(shù)據(jù)分析篇 | 待更新 | |
go語言高并發(fā)實(shí)戰(zhàn) | 秒殺架構(gòu),高并發(fā)請(qǐng)求一網(wǎng)打盡 | |
大數(shù)據(jù)架構(gòu)實(shí)戰(zhàn) | 大數(shù)據(jù)入門 | 萬事開頭難,先進(jìn)門再說 |
大數(shù)據(jù)必須之Java基礎(chǔ) | 沒有什么是Java解決不了的 | |
大數(shù)據(jù)其他內(nèi)容 | 待更新 |
一. 實(shí)驗(yàn)環(huán)境
操作系統(tǒng): Rocky 9.1 版本
zabbix 版本: 6.0.4 (LTS)
數(shù)據(jù)庫版本: MySQL 8.0
?
注意:
- 本文不涉及rocky系統(tǒng)的安裝,想學(xué)習(xí)rocky系統(tǒng)的安裝可以參考之前的文章。
- rocky系統(tǒng)安裝成功后,默認(rèn)沒有開啟ssh遠(yuǎn)程連接,需要手動(dòng)開啟。
開啟方法如圖:
關(guān)于zabbix官網(wǎng)對(duì)各版本的要求配圖:
確認(rèn)你的實(shí)驗(yàn)環(huán)境的方法:
- 操作系統(tǒng):
[root@mufeng ~]# cat /etc/redhat-release
Rocky Linux release 9.1 (Blue Onyx)
-
關(guān)閉防火墻
[root@mufenggrow ~]# systemctl stop firewalld.service
-
關(guān)閉selinux
[root@mufenggrow ~]# setenforce 0
-
查看 服務(wù)器信息
[root@mufenggrow ~]# hostnamectl Static hostname: mufenggrowIcon name: computer-vmChassis: vmMachine ID: fbfae1777e0a4f338ee24764faba55ffBoot ID: 55e469d19fc44197a9ee251ca549c35eVirtualization: vmwareOperating System: Red Hat Enterprise Linux 8.0 (Ootpa)CPE OS Name: cpe:/o:redhat:enterprise_linux:8.0:GAKernel: Linux 4.18.0-80.el8.x86_64Architecture: x86-64
二. 安裝zabbix過程
2.1. 安裝zabbix源
系統(tǒng)中本身并沒有zabbix源,若你已經(jīng)安裝了epel源,建議先屏蔽掉,不要使用,因?yàn)閑pel安裝的包會(huì)造成沖突”
rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/9/x86_64/zabbix-release-6.0-4.el9.noarch.rpm
由于zabbix官網(wǎng)的源比較慢,建議換成國內(nèi)其他的源
sed -i "s/repo.zabbix.com/mirrors.nju.edu.cn\/zabbix/g" /etc/yum.repos.d/zabbix.repo
2.2 安裝zabbix相關(guān)的軟件
設(shè)置好zabbix源之后,開始安裝相關(guān)的軟件包:
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent -y
2.3 安裝數(shù)據(jù)庫并啟動(dòng)
由于 6.0 的版本需要 mysql 8.0 以上,所以需要安裝最新的 mysql 源 ,而 類 CentOS 8 系統(tǒng)和 9 系統(tǒng)只需要將軟件源更新至最新,mysql 的版本就為 8。
所以我們只需要更新軟件包,然后使用dnf install 安裝即可。
[root@mufeng ~]# dnf -y update && dnf install mysql-server -y
安裝成功如圖:
啟動(dòng)數(shù)據(jù)庫如下:
systemctl start mysqld && systemctl enable mysqld
[root@mufeng ~]# ps -aux |grep mysqld
mysql 55275 1.8 15.2 1850808 611492 ? Ssl 01:51 1:24 /usr/libexec/mysqld --basedir=/usr
root 57540 0.0 0.0 221812 2396 pts/1 S+ 03:08 0:00 grep --color=auto mysqld
[root@mufeng ~]#
2.4 開始初始化數(shù)據(jù)庫:
初始化命令如下:
mysql_secure_installation
此處是執(zhí)行過程中所出現(xiàn)的所有的提示,大多數(shù)地方只需要輸入Y即可,比如移除匿名用戶,移除test庫等等, 另外選擇密碼的時(shí)候,可以選擇low,也就是設(shè)置簡單的密碼。
[root@mufeng ~]# mysql_secure_installationSecuring the MySQL server deployment.Connecting to MySQL using a blank password.VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?Press y|Y for Yes, any other key for No: yThere are three levels of password validation policy:LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary filePlease enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0
Please set the password for root here.New password: Re-enter new password: Estimated strength of the password: 50
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y- Dropping test database...
Success.- Removing privileges on test database...
Success.Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.All done!
[root@mufeng ~]#
2.5 創(chuàng)建數(shù)據(jù)庫實(shí)例及對(duì)應(yīng)的用戶
這一步主要是配置讓zabbix用戶能夠通過localhost,使用密碼12345678 訪問 zabbix的所有表
[root@mufeng ~]# mysql -uroot -p12345678
.
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
Query OK, 1 row affected (0.00 sec)mysql> create user zabbix@localhost identified by '12345678';
Query OK, 0 rows affected (0.01 sec)mysql> grant all privileges on zabbix.* to zabbix@localhost;
Query OK, 0 rows affected (0.01 sec)mysql> set global log_bin_trust_function_creators = 1;
Query OK, 0 rows affected (0.00 sec)mysql> quit
Bye
主要設(shè)置了以下三個(gè)值,這三個(gè)值在后面配置zabbix的配置文件的時(shí)候,還要用到。
DBUser=zabbix
DBPassword=12345678
DBName=zabbix
2.6 導(dǎo)入官網(wǎng)提供的數(shù)據(jù)
這一步是導(dǎo)入官網(wǎng)提供的sql語句,zabbix6.0和zabbix5.0提供的路徑稍微有點(diǎn)不同,其他的都一樣。
[root@mufeng ~]# cd /usr/share/zabbix-sql-scripts/mysql/
[root@mufeng mysql]# ls
double.sql history_pk_prepare.sql proxy.sql server.sql.gz
[root@mufeng mysql]# zcat server.sql.gz |mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
Enter password:
[root@mufeng mysql]#
查看導(dǎo)入的數(shù)據(jù):
[root@mufeng mysql]# mysql -p12345678mysql> use zabbix
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
mysql> show tables;
+----------------------------+
| Tables_in_zabbix |
+----------------------------+
| acknowledges |
| actions |
2.7 配置zabbix 服務(wù)的配置文件
在上一步驟中我們已經(jīng)給數(shù)據(jù)庫設(shè)置好了用戶名和密碼,這一步我們要把上面設(shè)置好的數(shù)據(jù)庫用戶名,密碼和用戶都寫入配置文件。
先找到配置文件:
[root@mufeng mysql]# find / -name zabbix_server.conf
/etc/zabbix/zabbix_server.conf
查看修改的內(nèi)容
[root@mufeng mysql]# grep -v ^# /etc/zabbix/zabbix_server.conf |grep "^DB"
DBName=zabbix
DBUser=zabbix
DBPassword=12345678
配置文件中有些內(nèi)容已經(jīng)存在就無需配置,比如DBname默認(rèn)已經(jīng)存在,就不需要在配置了。
2.8. 啟動(dòng)服務(wù)
到現(xiàn)在為止已經(jīng)全部配置完成了,接下來需要啟動(dòng)http,php,zabbix-server等服務(wù)
[root@mufeng ~]# systemctl restart zabbix-server zabbix-agent httpd php-fpm
[root@mufeng ~]# systemctl enable zabbix-server zabbix-agent httpd php-fpm
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-server.service → /usr/lib/systemd/system/zabbix-server.service.
2.9 從網(wǎng)頁進(jìn)行安裝
網(wǎng)頁登陸地址是IP/zabbix的格式,我這里登陸的方式: http://192.168.1.55/zabbix/setup.php
-
進(jìn)入安裝界面
-
檢測(cè)各個(gè)版本是否匹配,若不匹配會(huì)有提示
-
配置DB數(shù)據(jù)庫連接, 此處的密碼是在zabbix配置文件中輸入的DBPasswd密碼
- 設(shè)置時(shí)區(qū),此時(shí)知道UTC+8 很重要,要不你還得找半天
- 安裝前的最后檢查
- 安裝完成
2.10 登陸zabbix
當(dāng)出現(xiàn)如下圖的內(nèi)容:
用戶名默認(rèn)為: Admin
密碼默認(rèn)為: zabbix
輸入后點(diǎn)擊登陸即可登陸到如下界面:
到此所有的安裝就結(jié)束了,zabbix6.0部署成功。
總結(jié)
- 💕 好啦,這就是今天要分享給大家的全部內(nèi)容了,我們下期再見!
- 💕 博客主頁:mufeng.blog.csdn.net
- 💕 本文由沐風(fēng)曉月原創(chuàng),首發(fā)于CSDN博客
- 💕 每一個(gè)你想要學(xué)習(xí)的念頭,都是未來的你像現(xiàn)在的你求救,不辜負(fù)未來,全力奔赴