kylin v10+ arm64 + zabbix 6.0安装
·
环境:arm64
# hostnamectl
Static hostname: ecs-7kw0hn02xbd1m8
Icon name: computer-vm
Chassis: vm
Machine ID: 3f0f3bc29f155997acf0f3a356a5531e
Boot ID: ce9e7f873bed4f74bccc6eef37492db8
Virtualization: kvm
Operating System: Kylin Linux Advanced Server V10 (Lance)
Kernel: Linux 4.19.90-52.42.v2207.ky10.aarch64
Architecture: arm64
一、基础配置
1.配置yum源
# cd /etc/yum.repos.d/
# vi kylin.repo
[kylin]
name=Kylin Linux Advanced Server V10 - $basearch
baseurl=http://update.cs2c.com.cn:8080/NS/V10/V10SP2/os/adv/lic/base/$basearch/
gpgcheck=1
enabled=1
gpgkey=http://update.cs2c.com.cn:8080/NS/V10/V10SP2/os/adv/lic/RPM-GPG-KEY-kylin
# vi zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://repo.zabbix.com/zabbix/6.0/rhel/8/$basearch
enabled=1
gpgcheck=0
gpgkey=https://repo.zabbix.com/zabbix-official-repo.key
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=https://repo.zabbix.com/non-supported/rhel/8/$basearch
enabled=1
gpgkey=https://repo.zabbix.com/zabbix-official-repo.key
gpgcheck=0
2.安装mysql 8.0
2.1 下载docker
下载地址: https://mirrors.aliyun.com/docker-ce/linux/static/stable/aarch64/?spm=a2c6h.25603864.0.0.654c4ccaPxer04
2.2 安装docker
su - root
# tar -zxvf docker-27.4.0.tgz
docker/
docker/containerd
docker/docker-proxy
docker/dockerd
docker/docker-init
docker/runc
docker/docker
docker/ctr
docker/containerd-shim
docker/containerd-shim-runc-v2
# cp docker/* /usr/bin/
2.3配置
# vi /etc/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd --config-file /etc/docker/daemon.json
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
2.4启动服务
# chmod +x /etc/systemd/system/docker.service
# systemctl daemon-reload
# systemctl start docker.service
# systemctl enable docker.service
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /etc/systemd/system/docker.service.
# docker ps -a
2.5配置daemon.json
# vi /etc/docker/damon.json
{
"registry-mirrors": [
"https://dockerhub.icu",
"https://docker.ckyl.me",
"https://docker.awsl9527.cn",
"https://docker.m.daocloud.io",
"https://docker.laoex.link"
]
}
2.6 重新加载
systemctl daemon-reload
systemctl restart docker
2.7 拉取镜像
# docker pull mysql:8.0
2.8 运行mysql
# 创建网关
# docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 zabbix-net
容器安装mysql8.0 指定端口,指定ip
# docker run --name zabbix6-server-mysql -t \
-e MYSQL_DATABASE="zabbix6-server-mysql" \
-e MYSQL_USER="zabbix" \
-e MYSQL_PASSWORD="Root_123!" \
-e MYSQL_ROOT_PASSWORD="Root_123!" \
--network=zabbix-net \
-p 33064:3306 \
--ip 172.20.240.46 \
-d mysql:8.0 \
--character-set-server=utf8 --collation-server=utf8_bin \
--default-authentication-plugin=mysql_native_password
2.9 mysql 登录
# mysql -uroot -P 3306 -p -h 172.20.240.46
二、zabbix server 安装
1.安装
查看可用版本
# yum list zabbix-proxy-mysql --showduplicates
# yum install zabbix-server-mysql-6.0.37-release1.el8 zabbix-web-mysql-6.0.37-release1.el8 zabbix-nginx-conf-6.0.37-release1.el8 zabbix-sql-scripts-6.0.37-release1.el8 zabbix-selinux-policy-6.0.37-release1.el8 -y
2.导入zabbix server 库
# mysql -uroot -p -h 172.20.240.46
password
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by 'Root_123!';
mysql> create user 'zabbix'@'%' identified by 'Root_123!';
mysql> grant all privileges on zabbix.* to zabbix@'%';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;
# zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix -h 172.20.240.46
# mysql -uroot -p -h 172.20.240.46
password
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;
3.配置
# vi /etc/zabbix/zabbix_server.conf
ListenPort=10053
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
SocketDir=/var/run/zabbix
DBHost=172.20.240.46
DBName=zabbix
DBUser=zabbix
DBPassword=Root_123!
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000
# sed -i '/^server {/a listen 80;' /etc/nginx/conf.d/zabbix.conf
# sed -i '/^listen 80;/a server_name 10.138.66.32;' /etc/nginx/conf.d/zabbix.conf
# systemctl restart zabbix-server nginx php-fpm
# vi /usr/lib/systemd/system/zabbix-server.service
在[Service]下新增第一个
Environment="LD_PRELOAD=/usr/lib64/libnetsnmp.so.40"
# systemctl daemon-reload
# systemctl restart zabbix-server
4.页面配置–安装
三、zabbix proxy 安装
1.安装zabbix proxy
# yum list zabbix-proxy-mysql --showduplicates
# yum install zabbix-proxy-mysql-6.0.37-release1.el8 zabbix-sql-scripts-6.0.37-release1.el8 zabbix-selinux-policy-6.0.37-release1.el8 -y
2.导入zabbix proxy 库
# mysql -uroot -p -h 172.20.240.46
password
mysql> create database zabbix_proxy character set utf8mb4 collate utf8mb4_bin;
#上面创建了,这个可以不创建
mysql> create user zabbix@localhost identified by 'Root_123!';
#上面创建了,这个可以不创建
mysql> create user 'zabbix'@'%' identified by 'Root_123!';
mysql> grant all privileges on zabbix_proxy.* to zabbix@'%';
mysql> grant all privileges on zabbix_proxy.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;
#cat /usr/share/zabbix-sql-scripts/mysql/proxy.sql | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix_proxy -h 172.20.240.46
# mysql -uroot -p -h 172.20.240.46
password
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;
3.配置
# vi /etc/zabbix/zabbix_proxy.conf
ProxyMode=0
#Server=10.138.66.32
Server=10.1.18.232:10051
#ServerPort=10051
Hostname=zabbix60-proxy
LogFile=/var/log/zabbix/zabbix_proxy.log
LogFileSize=0
PidFile=/var/log/zabbix/zabbix_proxy.pid
SocketDir=/var/log/zabbix
#DBType=mysql
DBHost=172.20.240.46
DBName=zabbix6-proxy
DBPort=3306
DBUser=zabbix
DBPassword=Root_123!
ConfigFrequency=60
DataSenderFrequency=5
ListenPort=10051
# systemctl restart zabbix-proxy
# vi /usr/lib/systemd/system/zabbix-proxy.service
在[Service]下新增第一个
Environment="LD_PRELOAD=/usr/lib64/libnetsnmp.so.40"
将PidFile这个修改为如下
PidFile=/var/log/zabbix/zabbix_proxy.pid
# systemctl daemon-reload
# systemctl restart zabbix-proxy
测试是否有问题
# /usr/sbin/zabbix_proxy -c /etc/zabbix/zabbix_proxy.conf -V
# /usr/sbin/zabbix_proxy -V
4.页面配置
四、zabbix agent2 安装
1.下载
# cd soft
# wget https://repo.zabbix.com/zabbix/6.0/rhel/8/aarch64/zabbix-agent2-6.0.37-release1.el8.aarch64.rpm
# wget https://repo.zabbix.com/zabbix/6.0/rhel/8/aarch64/zabbix-agent2-plugin-mongodb-6.0.37-release1.el8.aarch64.rpm
# wget https://repo.zabbix.com/zabbix/6.0/rhel/8/aarch64/zabbix-agent2-plugin-postgresql-6.0.37-release1.el8.aarch64.rpm
2.安装
# rpm -ivh zabbix-agent2*.rpm
3.配置
# vi /etc/zabbix/zabbix_agent2.conf
PidFile=/var/run/zabbix/zabbix_agent2.pid
LogFile=/var/log/zabbix/zabbix_agent2.log
LogFileSize=0
Server=10.138.66.32
ServerActive=10.138.66.32:10051
HostMetadata=Linux
ListenPort=10050
Include=./zabbix_agent2.d/plugins.d/*.conf
4.重启zabbix_agent2
systemctl restart zabbix-agent2
systemctl enable zabbix-agent2
更多推荐
所有评论(0)