我有一个 live rails 应用程序,我正在尝试使用它的Ruby Client安装prometheus 监控服务。
我在服务器上运行了教程,它运行良好,但一个小时后,merics url死了。
如何让它在我的实时服务器上运行?
如果我添加一个现有项目,如下所示,Prometheus 会给出“未找到”错误
I, [2015-08-31T10:54:40.274066 #3542] INFO -- : Refreshing Gem list
/PATH/shared/bundle/ruby/2.2.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require': cannot load such file -- prometheus/client/rack/collector (LoadError)
from /PATH/shared/bundle/ruby/2.2.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `block in require'
from /PATH/shared/bundle/ruby/2.2.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependency'
from /PATH/shared/bundle/ruby/2.2.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require'
from config.ru:8:in `block in <main>'
from /PATH/shared/bundle/ruby/2.2.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `instance_eval'
from /PATH/shared/bundle/ruby/2.2.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `initialize'
from config.ru:1:in `new'
from config.ru:1:in `<main>'
from /PATH/shared/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn.rb:48:in `eval'
from /PATH/shared/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn.rb:48:in `block in builder'
from /PATH/shared/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:768:in `call'
from /PATH/shared/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:768:in `build_app!'
from /PATH/shared/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:632:in `init_worker_process'
from PATH/shared/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:655:in `worker_loop'
from /PATH/shared/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:529:in `spawn_missing_workers'
from /PATH/shared/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:540:in `maintain_worker_count'
from /PATH/shared/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:294:in `join'
from /PATH/shared/bundle/ruby/2.2.0/gems/unicorn-4.9.0/bin/unicorn:126:in `<top (required)>'
from /PATH/shared/bundle/ruby/2.2.0/bin/unicorn:23:in `load'
from /PATH/shared/bundle/ruby/2.2.0/bin/unicorn:23:in `<main>'
我有两台服务器
- promethus_server
- live_server + prometheus 客户端)
live_server 和 promethus_client 位于不同的路径中。
我在服务器上手动运行 promethus 客户端:
$ rails new client
$ bundle (adding promethus-client Gem)
$ vi config.ru (add promethus lib)
$ rail s --binding=IP
这个对吗?