1. log.io 설치
On RHEL/CentOS 7
1 |
# yum install http://fedora.mirrors.telekom.ro/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm |
On RHEL/CentOS 6
1 2 3 4 5 |
--------------------- On RHEL/CentOS 6.x - 32 Bit --------------------- # yum install http://fedora.mirrors.telekom.ro/pub/epel/6/i386/epel-release-6-8.noarch.rpm --------------------- On RHEL/CentOS 6.x - 64 Bit --------------------- # yum install http://fedora.mirrors.telekom.ro/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm |
Step 2: Install Node.js
1 2 3 |
# yum install npm nodejs # npm install -g log.io --user “root” |
5. 설치 완료 폴더 확인
1 2 3 4 5 6 |
# pwd [Make sure you are on the right path] # cd .log.io/ # ls # vi harvester.conf |
1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
exports.config = { nodeName: "xinet.kr", logStreams: { audit: [ "/var/log/audit/audit.log" ], messages: [ "/var/log/messages" ], secure: [ "/var/log/secure" ], btmp: [ "/var/log/btmp" ], maillog: [ "/var/log/maillog" ], httpd: [ "/usr/local/apache/logs/access_log" ] }, server: { host: '0.0.0.0', port: 28777 } } ~ |
패스워드 설정
1 |
# vi web_server.conf |
9. 방화벽 포트 허용
1 2 |
# firewall-cmd --add-port=28778/tcp --permanent # firewall-cmd --reload |
Note: RHEL/CentOS 6.x users can open port 28778 on iptable firewall.
Step 5: log.io 시작
1 2 3 4 5 |
------------ First start server, put it in background and press Enter key ------------ # log.io-server & ------------ Start log harvester in background ------------ # log.io-harvester & |
1 |
http://192.168.1.20:28778 |
1 |
# pkill node |
Step 6:시작 스크립트 설정 파일 등록
1 2 |
# nano /usr/local/bin/log.io # chmod +x /usr/local/bin/log.io |
Add the following excerpt to this script file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#!/bin/bash start() { echo "Starting log.io process..." /usr/bin/log.io-server & /usr/bin/log.io-harvester & } stop() { echo "Stopping io-log process..." pkill node } status() { echo "Status io-log process..." netstat -tlp | grep node } case "$1" in start) start ;; stop) stop ;; status) status ;; *) echo "Usage: start|stop|status" ;; Esac |
14. 시작 상태 정지
1 2 3 |
# log.io start # log.io status # log.io stop |