上城網站建設百度快照推廣是什么意思
文章目錄
- 前言
- 一. 實驗環(huán)境
- 二. 安裝zabbix過程
- 2.1. 安裝zabbix源
- 2.2 安裝zabbix相關的軟件
- 2.3 安裝數據庫并啟動
- 2.4 開始初始化數據庫:
- 2.5 創(chuàng)建數據庫實例及對應的用戶
- 2.6 導入官網提供的數據
- 2.7 配置zabbix 服務的配置文件
- 2.8. 啟動服務
- 2.9 從網頁進行安裝
- 2.10 登陸zabbix
- 總結
前言
大家好,我是沐風曉月,本文主要講解在rocky9.0系統下實現zabbix6.0版本的部署。
號外:
在大佬的指導下,把csdn的專欄做了細分,目前正在更新的有以下幾個專欄,會依次進行整理和更新,如果你有更好的想法,歡迎與我交流。
這份表格后面還會繼續(xù)優(yōu)化,希望能等到你的建議:學習永無止境,茫茫人海,一起加油努力!
python全棧領跑營 | python地基-零基礎入門篇 | 萬事開頭難,先進門再說 |
---|---|---|
語法進階篇 | 主要圍繞多線程編程,正則表達式,各類項目展開 | |
爬蟲入門與實戰(zhàn) | 沒有什么是爬蟲解決不了的 | |
自動化辦公篇 | 搞定常用辦公軟件的自動化操作 | |
數據庫開發(fā)實戰(zhàn)篇 | 無數據,不運營,搞定數據庫開發(fā) | |
數據分析篇 | 待更新 | |
python web實戰(zhàn)篇 | 實現想要的網站的各種功能,擁有自己的網站 | |
人工智能篇 | 這才是我們的終極目標 | |
云原生 | DevOPS | 掌握devops技術棧,CI/CD |
微服務和服務網格(istio) | 詳盡的講解微服務架構 | |
分布式數據庫與存儲 | 分布式是高薪必備 | |
云原生周邊-組件-安全-監(jiān)控 | 云原生網絡,安全,存儲等底層技術 | |
go語言專欄 | go語言基礎-零基礎入門篇 | 萬事開頭難,先進門再說 |
語法進階篇 | 主要圍繞多線程編程,正則表達式,各類項目展開 | |
go web框架 | 沒有什么網站是不能用go實現的 | |
go二次開發(fā) | 對云原生產品做二次開發(fā) | |
數據庫開發(fā)實戰(zhàn)篇 | 無數據,不運營,搞定數據庫開發(fā) | |
數據分析篇 | 待更新 | |
go語言高并發(fā)實戰(zhàn) | 秒殺架構,高并發(fā)請求一網打盡 | |
大數據架構實戰(zhàn) | 大數據入門 | 萬事開頭難,先進門再說 |
大數據必須之Java基礎 | 沒有什么是Java解決不了的 | |
大數據其他內容 | 待更新 |
一. 實驗環(huán)境
操作系統: Rocky 9.1 版本
zabbix 版本: 6.0.4 (LTS)
數據庫版本: MySQL 8.0
?
注意:
- 本文不涉及rocky系統的安裝,想學習rocky系統的安裝可以參考之前的文章。
- rocky系統安裝成功后,默認沒有開啟ssh遠程連接,需要手動開啟。
開啟方法如圖:
關于zabbix官網對各版本的要求配圖:
確認你的實驗環(huán)境的方法:
- 操作系統:
[root@mufeng ~]# cat /etc/redhat-release
Rocky Linux release 9.1 (Blue Onyx)
-
關閉防火墻
[root@mufenggrow ~]# systemctl stop firewalld.service
-
關閉selinux
[root@mufenggrow ~]# setenforce 0
-
查看 服務器信息
[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源
系統中本身并沒有zabbix源,若你已經安裝了epel源,建議先屏蔽掉,不要使用,因為epel安裝的包會造成沖突”
rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/9/x86_64/zabbix-release-6.0-4.el9.noarch.rpm
由于zabbix官網的源比較慢,建議換成國內其他的源
sed -i "s/repo.zabbix.com/mirrors.nju.edu.cn\/zabbix/g" /etc/yum.repos.d/zabbix.repo
2.2 安裝zabbix相關的軟件
設置好zabbix源之后,開始安裝相關的軟件包:
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent -y
2.3 安裝數據庫并啟動
由于 6.0 的版本需要 mysql 8.0 以上,所以需要安裝最新的 mysql 源 ,而 類 CentOS 8 系統和 9 系統只需要將軟件源更新至最新,mysql 的版本就為 8。
所以我們只需要更新軟件包,然后使用dnf install 安裝即可。
[root@mufeng ~]# dnf -y update && dnf install mysql-server -y
安裝成功如圖:
啟動數據庫如下:
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 開始初始化數據庫:
初始化命令如下:
mysql_secure_installation
此處是執(zhí)行過程中所出現的所有的提示,大多數地方只需要輸入Y即可,比如移除匿名用戶,移除test庫等等, 另外選擇密碼的時候,可以選擇low,也就是設置簡單的密碼。
[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)建數據庫實例及對應的用戶
這一步主要是配置讓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
主要設置了以下三個值,這三個值在后面配置zabbix的配置文件的時候,還要用到。
DBUser=zabbix
DBPassword=12345678
DBName=zabbix
2.6 導入官網提供的數據
這一步是導入官網提供的sql語句,zabbix6.0和zabbix5.0提供的路徑稍微有點不同,其他的都一樣。
[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]#
查看導入的數據:
[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 服務的配置文件
在上一步驟中我們已經給數據庫設置好了用戶名和密碼,這一步我們要把上面設置好的數據庫用戶名,密碼和用戶都寫入配置文件。
先找到配置文件:
[root@mufeng mysql]# find / -name zabbix_server.conf
/etc/zabbix/zabbix_server.conf
查看修改的內容
[root@mufeng mysql]# grep -v ^# /etc/zabbix/zabbix_server.conf |grep "^DB"
DBName=zabbix
DBUser=zabbix
DBPassword=12345678
配置文件中有些內容已經存在就無需配置,比如DBname默認已經存在,就不需要在配置了。
2.8. 啟動服務
到現在為止已經全部配置完成了,接下來需要啟動http,php,zabbix-server等服務
[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 從網頁進行安裝
網頁登陸地址是IP/zabbix的格式,我這里登陸的方式: http://192.168.1.55/zabbix/setup.php
-
進入安裝界面
-
檢測各個版本是否匹配,若不匹配會有提示
-
配置DB數據庫連接, 此處的密碼是在zabbix配置文件中輸入的DBPasswd密碼
- 設置時區(qū),此時知道UTC+8 很重要,要不你還得找半天
- 安裝前的最后檢查
- 安裝完成
2.10 登陸zabbix
當出現如下圖的內容:
用戶名默認為: Admin
密碼默認為: zabbix
輸入后點擊登陸即可登陸到如下界面:
到此所有的安裝就結束了,zabbix6.0部署成功。
總結
- 💕 好啦,這就是今天要分享給大家的全部內容了,我們下期再見!
- 💕 博客主頁:mufeng.blog.csdn.net
- 💕 本文由沐風曉月原創(chuàng),首發(fā)于CSDN博客
- 💕 每一個你想要學習的念頭,都是未來的你像現在的你求救,不辜負未來,全力奔赴