|
官方文档:https://github.com/NarrativeScie ... 0.3.4-Build-Recipe-(Ubuntu-14.04)
The following recipe was used to build a Log.io environment on a fresh Ubuntu 14.04 install (ami-864d84ee), using node.js v0.10.29
需要使用root用户安装
1.安装node.js
node.js安装包获取,请搜索。
tar zxvf node-v0.12.7.tar.gz
cd node-v0.12.7
./configure
make && make install
2.安装npm
wget --no-check-certificate https://npmjs.org/install.sh && sh install.sh
3.防止npm被墙,使用cnpm替代
npm install -g cnpm --registry=https://registry.npm.taobao.org
4.安装log.io
cnpm install -g log.io --user 'root'
5.服务器端和客户端的配置文件都在~/.log.io/下面
6.启动服务端
nohup log.io-server &
7.配置客户端,设置日志收集来源
vi ~/.log.io/harvester.conf
exports.config = {
nodeName: "test_server_01",
logStreams: {
tomcat: [
"/home/test/local/tomcat/logs/catalina.out"
],
tomcat8030: [
"/home/test/local/tomcat8030/logs/catalina.out"
]
},
server: {
host: '0.0.0.0',
port: 28777
}
}
8.修改log.io的一处bug
vi /usr/local/lib/node_modules/log.io/lib/harvester.js
if (event === 'change') {
return fs.stat(path, function(err, stat) {
var tmp_total = !err ? (stat.size || 0) : 0;
if (tmp_total > 0) {
_this._readNewLogs(path, tmp_total, currSize);
return currSize = tmp_total;
} else {
return tmp_total;
}
});
}
9.启动客户端
nohup log.io-harvester &
|
|
|