安装实时查看日志工具 log.io

 

官网:http://logio.org/

一、环境

[root@centos ~]# cat /etc/system-release
CentOS release 6.5 (Final)
[root@centos ~]# uname -a
Linux centos 2.6.32-431.11.31.el6.ucloud.x86_64 #1 SMP Tue Mar 7 20:19:50 EST 2017 x86_64 x86_64 x86_64 GNU/Linux

 

二、安装

  1、安装 npm

    我使用的是epel源的rpm包,如果没有epel源,可以 yum install -y epel.repo

    

[root@centos ~]# yum install -y npm
[root@centos ~]# npm -v
1.3.6

 

 

三、安装log.io

npm install -g log.io --user "root"

 

如果安装时报如下错误:

npm http GET https://registry.npmjs.org/log.io
npm http GET https://registry.npmjs.org/log.io
npm http GET https://registry.npmjs.org/log.io
npm ERR! Error: CERT_UNTRUSTED
npm ERR!     at SecurePair.<anonymous> (tls.js:1430:32)
npm ERR!     at SecurePair.emit (events.js:92:17)
npm ERR!     at SecurePair.maybeInitFinished (tls.js:1029:10)
npm ERR!     at CleartextStream.read [as _read] (tls.js:521:13)
npm ERR!     at CleartextStream.Readable.read (_stream_readable.js:341:10)
npm ERR!     at EncryptedStream.write [as _write] (tls.js:418:25)
npm ERR!     at doWrite (_stream_writable.js:226:10)
npm ERR!     at writeOrBuffer (_stream_writable.js:216:5)
npm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:183:11)
npm ERR!     at write (_stream_readable.js:602:24)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 2.6.32-431.11.31.el6.ucloud.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "log.io" "--user" "root"
npm ERR! cwd /root
npm ERR! node -v v0.10.48
npm ERR! npm -v 1.3.6
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /root/npm-debug.log
npm ERR! not ok code 0

 

解决办法参考:https://stackoverflow.com/questions/21855035/ssl-error-cert-untrusted-while-using-npm-command

在命令行执行:

npm config set strict-ssl false

 

然后再次尝试安装log.io:

[root@centos ~]# npm install -g log.io --user "root"

 

如果成功安装会有如下文件:

[root@centos ~]# ls /root/.log.io/
harvester.conf  log_server.conf  web_server.conf
[root@centos ~]# which log.io-server 
/usr/bin/log.io-server
[root@centos ~]# which log.io-harvester
/usr/bin/log.io-harvester

 

其他详见官网:http://logio.org/

 

posted @ 2018-04-17 10:56  某某7  阅读(3266)  评论(0编辑  收藏  举报