환경
OCI instance - oracle linux 8.7
DB - MYSQL 8
Web Server - Apache 2.4
zabbix version - 5.0 LTS
"지금 작성한 글은 Web Server와 DB가 모두 생성되어 기동된 상태임을 베이스로 작성됨."
1. rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
2. dnf(yum) clean all
3. mysql DB 서버 생성 및 기동 / 확인
systemctl start mysqld
systemctl status mysqld
4. mysql -uroot -p
# mysql 접속 후 아래 내용 추가
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'password'; # 본인 패스워드로 설정
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;
5. 위에 생성한 user인 zabbix에 스키마 생성
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
6. zabbix server configuration 설정
# /etc/zabbix/zabbix_server.conf
# zabbix_server.conf 에 연결할 DB (mysql)의 DBPassword를 넣는다.
vi /etc/zabbix/zabbix_server.conf # 열고 ' /DBPassword ' 찾고 아래와 같이 본인 DB user 패스워드를 넣고 :wq
DBPassword=welcome1!@!@
7. 스키마 임폴트 했으면 log_bin_trust_function_creators는 disable
# Disable log_bin_trust_function_creators option after importing database schema.
데이터베이스 스키마를 가져온 후에 해당 옵션을 비활성화 하라는 의미.
이 옵션을 활성화 시키면 사용자가 해당 함수를 실행시키는 권한을 가지게 되어 보안위협이 크다.
그래서 스키마를 가져와서 옵션 비활성화 하는 게 좋다.
# mysql -uroot -p
password
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;
8. PHP 설정
# vi /etc/php-fpm.d/zabbix.conf 내부에서 타임존 변경
php_value[date.timezone] = Asia/Seoul
9. zabbix server 'start or restart' 및 'enable'
현재 기동 중인 상태를 보고 싶으면 'status'
# systemctl status zabbix-agent.service zabbix-server.service httpd.service mysqld.service
● zabbix-agent.service - Zabbix Agent
Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2023-03-15 05:47:13 GMT; 2h 6min ago
Process: 1618075 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 1618078 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 1618081 (zabbix_agentd)
Tasks: 6 (limit: 5565)
Memory: 2.3M
CGroup: /system.slice/zabbix-agent.service
├─1618081 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
├─1618082 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
├─1618083 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
├─1618084 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
├─1618085 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
└─1618086 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
Mar 15 05:47:13 servertest1 systemd[1]: Starting Zabbix Agent...
Mar 15 05:47:13 servertest1 systemd[1]: Started Zabbix Agent.
● zabbix-server.service - Zabbix Server
Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2023-03-15 06:10:36 GMT; 1h 43min ago
Process: 1617890 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 1632285 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 1632287 (zabbix_server)
Tasks: 1 (limit: 5565)
Memory: 1.2M
CGroup: /system.slice/zabbix-server.service
└─1632287 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
Mar 15 06:10:36 servertest1 systemd[1]: Starting Zabbix Server...
Mar 15 06:10:36 servertest1 systemd[1]: Started Zabbix Server.
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Drop-In: /usr/lib/systemd/system/httpd.service.d
└─php-fpm.conf
Active: active (running) since Wed 2023-03-15 05:47:14 GMT; 2h 6min ago
Docs: man:httpd.service(8)
Main PID: 1618109 (httpd)
Status: "Total requests: 619; Idle/Busy workers 100/0;Requests/sec: 0.0813; Bytes served/sec: 632 B/sec"
Tasks: 278 (limit: 5565)
Memory: 21.7M
CGroup: /system.slice/httpd.service
├─1618109 /usr/sbin/httpd -DFOREGROUND
├─1618110 /usr/sbin/httpd -DFOREGROUND
├─1618111 /usr/sbin/httpd -DFOREGROUND
├─1618112 /usr/sbin/httpd -DFOREGROUND
├─1618113 /usr/sbin/httpd -DFOREGROUND
└─1625835 /usr/sbin/httpd -DFOREGROUND
Mar 15 05:47:14 servertest1 systemd[1]: Starting The Apache HTTP Server...
Mar 15 05:47:14 servertest1 systemd[1]: Started The Apache HTTP Server.
Mar 15 05:47:14 servertest1 httpd[1618109]: Server configured, listening on: port 80
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2023-03-15 06:47:51 GMT; 1h 6min ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 1654597 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 1654651 (mysqld)
Status: "Server is operational"
Tasks: 44 (limit: 5565)
Memory: 202.3M
CGroup: /system.slice/mysqld.service
└─1654651 /usr/sbin/mysqld
Mar 15 06:47:44 servertest1 systemd[1]: Starting MySQL Server...
Mar 15 06:47:51 servertest1 systemd[1]: Started MySQL Server.
10. 모두 띄워졌으면 "localhost/zabbix" 로 접속
'Monitoring > Zabbix' 카테고리의 다른 글
[zabbix] zbx_trends_sh 프로세스가 생기는 이유 /LogFormat 지시어 (0) | 2023.06.30 |
---|