2017-07-25 135 views
0

我想使用elastalert作爲碼頭容器使用撰寫。 以下是我的dokcer,撰寫文件elastalert定義: elastalert:ivankrizsan/elastalert泊塢窗圖像錯誤

image: ivankrizsan/elastalert 
container_name: elastalert 
restart: unless-stopped 
privileged: true 
links: 
    - es:elasticsearchhost 
ports: 
    - "3030:3030"    
cap_add: 
    - SYS_TIME 
    - SYS_NICE 
volumes: 
    - /etc/elastalert/config:/opt/config 
    - /etc/elastalert/rules:/opt/rules 
    - /etc/elastalert/logs:/opt/logs 
    - /etc/elastalert:/opt/elastalert 
environment: 
    - ELASTICSEARCH_HOST=es 
    - ELASTICSEARCH_PORT=9200 

我收到以下錯誤:

Container timezone not modified 
{ 
"name" : "Stunner", 
"cluster_name" : "elasticsearch", 
"cluster_uuid" : "jqqJxdQZRP6cLJPBd0Usdg", 
"version" : { 
"number" : "2.4.5", 
"build_hash" : "c849dd13904f53e63e88efc33b2ceeda0b6a1276", 
"build_timestamp" : "2017-04-24T16:18:17Z", 
"build_snapshot" : false, 
"lucene_version" : "5.5.4" 
}, 
"tagline" : "You Know, for Search" 
} 
Creating Elastalert index in Elasticsearch... 
Traceback (most recent call last): 
File "/usr/bin/elastalert-create-index", line 6, in <module> 
from pkg_resources import load_entry_point 
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 3019, in <module> 
@_call_aside 
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 3003, in _call_aside 
f(args, *kwargs) 
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 3032, in _initialize_master_working_set 
working_set = WorkingSet._build_master() 
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 655, in _build_master 
ws.require(requires) 
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 963, in require 
needed = self.resolve(parse_requirements(requirements)) 
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 849, in resolve 
raise DistributionNotFound(req, requirers) 
pkg_resources.DistributionNotFound: The 'elastalert' distribution was not found and is required by the application 
+2

請修改問題,使其更具可讀性。 – Ayushya

回答

0

我能解決這個問題。泊塢窗,撰寫配置,其工作對我來說:

elastalert:

image: ivankrizsan/elastalert 

container_name: elastalert 

restart: unless-stopped 

privileged: true 

links: 
     - es:elasticsearchhost 

cap_add: 

- SYS_TIME 

- SYS_NICE 

volumes:  

    - /etc/elastalert/config:/opt/config 

    - /etc/elastalert/rules:/opt/rules 

    - /etc/elastalert/logs:/opt/logs  

environment: 

    - ELASTICSEARCH_HOST=es 

    - ELASTICSEARCH_PORT=9200