ZABBIX SERVER(Monitoring 수집서버) : 10.70.101.80
ZABBIX Agent1(Monitoring 대상 서버) : 10.70.101.78
ZABBIX Agent2(Monitoring 대상 서버) : 10.70.101.79
ZABBIX server 설치 (수집서버)
#**#rpm 이용 zabbix 5.0 install**
[root@localhost ~]# rpm -Uvh <http://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm>
<https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm(을)를> 복구합니다
준비 중... ################################# [100%]
Updating / installing...
1:zabbix-release-5.0-1.el7 ################################# [ 50%]
Cleaning up / removing...
2:zabbix-release-3.4-2.el7 ################################# [100%]
[root@localhost ~]# yum -y install zabbix-server-mysql zabbix-agent
[root@localhost ~]# yum -y install centos-release-scl
[root@localhost ~]# vi /etc/yum.repos.d/zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-frontend]
name=Zabbix Official Repository frontend - $basearch
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/frontend
**enabled=1 => 1로 수정**
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=1
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1
[root@localhost ~]# yum -y install zabbix-web-mysql-scl
[root@localhost ~]# yum -y install zabbix-apache-conf-scl
Selinux 해제
[root@localhost selinux]# vi /etc/selinux/config
SELINUX=disabled
DB 설치 및 설정
##Mariadb 설치
[root@localhost ~]# vi install.sh
#!/bin/bash
PATH=$PATH:$HOME/bin
DBFILE=mariadb-10.2.12-linux-x86_64
INSTALL=/root/$DBFILE.tar.gz
DIR=/data
DATADIR=$DIR/data
LOGDIR=$DIR/log
BASEDIR=$DIR/maria
##CREATE DIRECTORY
groupadd mysql
useradd -g mysql mysql
mkdir -p $DATADIR
mkdir -p $LOGDIR
chown -R mysql.mysql $DIR
##UNZIP
tar -zxvf $INSTALL -C $DIR
mv $DIR/$DBFILE $BASEDIR
##MY.CNF
cat > /etc/my.cnf <<EOF
[mysqld]
datadir=$DATADIR
socket=/tmp/mysql.sock
log-error=$LOGDIR/mariadb.log
pid-file=$LOGDIR/mariadb.pid
symbolic-links=0
[mysqld_safe]
log-error=$LOGDIR/mariadb.log
pid-file=$LOGDIR/mariadb.pid
!includedir /etc/my.cnf.d
EOF
##INSTALL
$BASEDIR/scripts/mysql_install_db --user=mysql --basedir=$BASEDIR
[root@localhost ~]# ll
합계 448208
-rw-------. 1 root root 1464 7월 11 2019 anaconda-ks.cfg
-rw-r--r--. 1 root root 1512 7월 11 2019 initial-setup-ks.cfg
-rw-r--r--. 1 root root 694 11월 23 17:31 install.sh
-rw-r--r--. 1 root root 458949807 11월 23 17:29 mariadb-10.2.12-linux-x86_64.tar.gz
drwxr-xr-x. 2 root root 6 8월 5 2019 공개
drwxr-xr-x. 2 root root 6 8월 5 2019 다운로드
drwxr-xr-x. 2 root root 6 8월 5 2019 문서
drwxr-xr-x. 2 root root 6 8월 5 2019 바탕화면
drwxr-xr-x. 2 root root 6 8월 5 2019 비디오
drwxr-xr-x. 2 root root 6 8월 5 2019 사진
drwxr-xr-x. 2 root root 6 8월 5 2019 서식
drwxr-xr-x. 2 root root 6 8월 5 2019 음악
[root@localhost ~]# chmod +x install.sh
[root@localhost ~]# ./install.sh
[root@localhost bin]# vi /etc/my.cnf
[mysqld]
datadir=/data/data
socket=/var/lib/mysql/mysql.sock => socket을 /var/lib/mysql/mysql.sock으로 설치해야된다..
log-error=/data/log/mariadb.log
pid-file=/data/log/mariadb.pid
symbolic-links=0
[mysqld_safe]
log-error=/data/log/mariadb.log
pid-file=/data/log/mariadb.pid
!includedir /etc/my.cnf.d
## PATH 추가
[root@localhost bin]# vi ~/.bash_profile
PATH=$PATH:$HOME/bin:/data/maria/bin
## DB start
[root@localhost ~]# mysqld --user=mysql --basedir=/data/maria &
[1] 7910
[root@localhost ~]# 2021-11-23 17:39:19 139639774644032 [Note] mysqld (mysqld 10.2.12-MariaDB) starting as process 7910 ...
Zabbix-server DB 설정