心心念念的樹莓派4B 到貨了哗魂,就是這貨
一直沒時間折騰评肆,到手了才發(fā)現(xiàn)捌归,其實沒想好到底折騰啥鼠锈,編程,智能家居胀瞪,還是搞個智能小車玩玩针余,都沒有思路,于是決定還是先把系統(tǒng)裝上吧凄诞,畢竟沒裝過這種ARM處理器的板子圆雁。。帆谍。伪朽。前前后后折騰了3個晚上。汛蝙。烈涮。打住朴肺,3個晚上折騰完了,不是光裝了個系統(tǒng)??
正題:樹莓派4B 8G版 TF64GB搭建Zabbix5.2
支持樹莓派的系統(tǒng)有很多坚洽,我選擇的開源系統(tǒng)戈稿,因為是ARM處理器,下載鏡像的時候要注意讶舰,別宣稱x86或amd64的了鞍盗。選arm64或armhf,我這里最終經(jīng)過多冊嘗試跳昼,選擇的是 ubuntu-20.04.1-preinstalled-server-arm64+raspi.img.xz
般甲,因為Zabbix5.2官網(wǎng)目前支持的ARM處理器的就這個,可能我也是一知半解鹅颊,我之前服務(wù)器上就是Centos+Zabbix很穩(wěn)定敷存,但是centos沒有ARM,從最后安裝完成的結(jié)果堪伍,建議不要嘗試什么centos或其他的了锚烦,浪費時間,畢竟只是個平臺杠娱。
給樹莓派寫鏡像我就不說了挽牢,這里放張圖提示下
- 更換阿里源:
sudo vim /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu-ports/ focal main restricted
deb http://mirrors.aliyun.com/ubuntu-ports/ focal-updates main restricted
deb http://mirrors.aliyun.com/ubuntu-ports/ focal universe
deb http://mirrors.aliyun.com/ubuntu-ports/ focal-updates universe
deb http://mirrors.aliyun.com/ubuntu-ports/ focal multiverse
deb http://mirrors.aliyun.com/ubuntu-ports/ focal-updates multiverse
deb http://mirrors.aliyun.com/ubuntu-ports/ focal-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu-ports/ focal-security main restricted
deb http://mirrors.aliyun.com/ubuntu-ports/ focal-security universe
deb http://mirrors.aliyun.com/ubuntu-ports/ focal-security multiverse
- 安裝Zabbix官方源
wget https://repo.zabbix.com/zabbix/5.2/ubuntu-arm64/pool/main/z/zabbix-release/zabbix-release_5.2-1%2Bubuntu20.04_all.deb
dpkg -i zabbix-release_5.2-1+ubuntu20.04_all.deb
- 替換Zabbix阿里源如下:
deb http://mirrors.aliyun.com/zabbix/zabbix/5.2/ubuntu-arm64/ focal main
deb-src http://mirrors.aliyun.com/zabbix/zabbix/5.2/ubuntu-arm64/ focal main
- 更新系統(tǒng)
sudo apt upgrade
sudo apt update
- 安裝MySQL
sudo apt install mysql-server
sudo mysql_secure_installation
系統(tǒng)將要求您配置VALIDATE PASSWORD PLUGIN用來測試MySQL用戶密碼強度并提高安全性的密碼:
Securing 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: y
密碼驗證策略分為三個級別:低,中和強摊求。按下y如果你想設(shè)置的驗證密碼插件或任何其他鍵移動到下一個步驟:
There 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 file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
在下一個提示符下,將要求您設(shè)置MySQL root用戶的密碼:
Please set the password for root here.
New password:
Re-enter new password:
如果您設(shè)置了驗證密碼插件刘离,該腳本將向您顯示新密碼的強度室叉。鍵入y以確認密碼:
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
接下來,將要求您刪除匿名用戶硫惕,限制root用戶對本地計算機的訪問茧痕,刪除測試數(shù)據(jù)庫并重新加載特權(quán)表。您應(yīng)該回答y所有問題恼除。
要以root用戶身份登錄到MySQL服務(wù)器踪旷,請輸入:
sudo mysql
mysql > ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '需要設(shè)置的數(shù)據(jù)庫root賬戶的密碼(強密碼)';
mysql > FLUSH PRIVILEGES;
- 安裝zabbix及其相關(guān)軟件
6.1 安裝zabbix及其相關(guān)軟件
apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent!
6.2 設(shè)置數(shù)據(jù)庫
mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'zabbix對應(yīng)數(shù)據(jù)庫賬戶的密碼';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit;
6.3 導(dǎo)入zabbix數(shù)據(jù)庫表
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
6.4 修改配置文件中對應(yīng)的數(shù)據(jù)庫zabbix賬戶的密碼
sudo vim /etc/zabbix/zabbix_server.conf
DBPassword=password
6.5 啟動zabbix服務(wù)器并添加啟動項
sudo systemctl restart zabbix-server zabbix-agent apache2
sudo systemctl enable zabbix-server zabbix-agent apache2
- 可能存在的問題:1.無法切換中文界面
sudo apt-get install locales -y
sudo dpkg-reconfigure locales
最后重啟服務(wù)器就可以了,時間倉粟豁辉,寫的有點不講究令野,有問題請私信!