1.获取uptime的源代码,并安装到服务器上
git clone git://github.com/fzaninotto/uptime.git
cd uptime
npm install
2.修改Uptime 的配置文件
修改/uptime/config/default.yaml文件
url: 'http://localhost:8082'
server: localhost # 此处是需要修改的(修改成与mongodb副本集的主库对应的IP地址)
database: uptime # 此处是需要修改的
user: root # 此处是需要修改的
password: # 此处是需要修改的
connectionString: # alternative to setting server, database, user and password separatelymonitor:
name: origin
apiUrl: 'http://localhost:8082/api' # must be accessible without a proxy
pollingInterval: 10000 # ten seconds
timeout: 5000 # five seconds
userAgent: NodeUptime/2.0 (https://github.com/fzaninotto/uptime)analyzer:
updateInterval: 60000 # one minute
qosAggregationInterval: 600000 # ten minutes
pingHistory: 8035200000 # three monthsautoStartMonitor: trueplugins:
- ./plugins/console
- ./plugins/patternMatcher
- ./plugins/httpOptions
# - ./plugins/email
3.开启守护进程
forever start app.js
相关文档参照:https://github.com/fzaninotto/uptime