log.io
À¥ºê¶ó¿ìÀú¸¦ ÅëÇØ ½Ç½Ã°£À¸·Î ½Ã½ºÅÛ ·Î±×¸¦ ¸ð´ÏÅ͸µÇÏ´Â ÅøÀÔ´Ï´Ù.
Âü°í URL
Å×½ºÆ® ȯ°æ
[root@CHONNOM ~]# cat /etc/redhat-release
CentOS release 6.6 (Final)
[root@CHONNOM ~]# uname -r
2.6.32-504.12.2.el6.x86_64
INSTALL
:: YUM ÀúÀå¼Ò Ãß°¡
# yum install http://fedora.mirrors.telekom.ro/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# yum install npm nodejs
:: Node.js ¿Í NPM(Node Package Manager) ÆÐÅ°Áö ¼³Ä¡
Node.js :
NPM :
# yum install npm nodejs
# npm install -g log.io --user "root"
# cd .log.io/
# ls
[root@CHONNOM .log.io]# ls
harvester.conf log_server.conf web_server.conf
3°³ÀÇ conf ÆÄÀÏÀÌ »ý¼ºµÇ¸ç °¢°¢ÀÇ ÆÄÀÏÀº ¾Æ·¡¿Í °°´Ù.
harvester.conf : ·ÎÄÃ·Î±× ÆÄÀÏ ¼³Á¤
log_server.conf : ¿ø°Ý·Î±× ÆÄÀÏ ¼³Á¤
web_server.conf : ·Î±×ÆÄÀÏ À¥¼³Á¤
:: È®ÀÎÇÒ ·Î±×ÆÄÀÏ ¼³Á¤ (harvester.conf)
--> ¿©±â¼´Â 1´ëÀÇ ¼¹ö¿¡¼ À¥¼¹ö, ·Î±×¼öÁý¼¹ö, ·Î±×ºÐ¼® ´ë»ó¼¹ö...
[root@CHONNOM .log.io]# vim harvester.conf
exports.config = {
nodeName: "application_server",
logStreams: {
audit: [
"/var/log/audit/audit.log"
],
messages: [
"/var/log/messages"
],
secure: [
"/var/log/secure"
]
},
server: {
host: '0.0.0.0',
port: 28777
}
}
[root@CHONNOM .log.io]# vim log_server.conf
exports.config = {
host: '127.0.0.1',
port: 28777
}
[root@CHONNOM .log.io]# vim web_server.conf
exports.config = {
host: '0.0.0.0',
port: 28778,
/* ¾Æ·¡ »¡°£»öÀ¸·Î µÈºÎºÐ¿¡ ¾ÆÆÄÄ¡ ÀÎÁõÀ» °É¾îµÑ À¯Àú/Æнº¿öµå ÁöÁ¤
// Enable HTTP Basic Authentication
auth: {
user: "xxxxxxxxxxxxxxx",
pass: "xxxxxxxxxxxxxxx"
},
*/
/*
// Enable HTTPS/SSL
ssl: {
key: '/path/to/privatekey.pem',
cert: '/path/to/certificate.pem'
},
*/
/*
// Restrict access to websocket (socket.io)
// Uses socket.io 'origins' syntax
restrictSocket: '*:*',
*/
/*
// Restrict access to http server (express)
restrictHTTP: [
"192.168.29.39",
"10.0.*"
]
*/
}
:: ¹æȺ® ¿ÀÇÂ
[root@CHONNOM .log.io]# iptables -A RH-Firewall-1-INPUT -p tcp --dport 28778 -j ACCEPT
:: ½ÃÀÛ/ÁßÁö ½ºÅ©¸³Æ®
[root@CHONNOM .log.io] cat > /etc/init.d/log.lo
#!/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
[root@CHONNOM] chmod +x /etc/inti.d/log.io
[root@CHONNOM] /etc/init.d/log.io start
À¥ºê¶ó¿ìÀú¸¦ ÅëÇØ ½Ç½Ã°£ ·Î±× ¸ð´ÏÅ͸µ