curator4和elasticsearch之间的连接运行到两个容器中

时间:2016-12-23 20:59:35

标签: elasticsearch docker elasticsearch-curator

我使用plindelauf / curator4映像连接并运行在另一个容器中运行的Elasticsearch的操作。 docker ps给出:

CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS              PORTS                                                                        NAMES
ac97b5674524        plindelauf/curator4                  "/opt/docker-entrypoi"   6 seconds ago       Up 5 seconds                                                                                     curator
e584c9b090c8        vagrant-registry.vm:5000/sslserver   "python /sslServer/ss"   23 hours ago        Up 23 hours         0.0.0.0:12121->12121/tcp                                                     sslserver
20eee9943664        kibana:4                             "/docker-entrypoint.s"   23 hours ago        Up 23 hours         0.0.0.0:5601->5601/tcp                                                       kibana
8c462586982e        logstash:2                           "/docker-entrypoint.s"   23 hours ago        Up 23 hours         0.0.0.0:5044->5044/tcp, 0.0.0.0:12201->12201/tcp, 0.0.0.0:12201->12201/udp   logstash
c971fa3e357b        elasticsearch:2                      "/docker-entrypoint.s"   23 hours ago        Up

我用

运行容器
$ docker run -d -e INTERVAL_IN_MINUTES=5 -v /home/vagrant/configs:/opt/config --link elasticsearch:elasticsearch --name curator plindelauf/curator4

一切看起来都不错但是当我尝试运行Curator手册时,我看到以下错误

root@ac97b5674524:/opt# curator --config /opt/config/curator.yml /opt/config/actionfile.yml
Traceback (most recent call last):
  File "/usr/local/bin/curator", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/curator/curator.py", line 5, in main
    cli()
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/curator/cli.py", line 215, in cli
    client = get_client(**client_args)
  File "/usr/local/lib/python2.7/site-packages/curator/utils.py", line 566, in get_client
    'Error: {0}'.format(e)
elasticsearch.exceptions.ElasticsearchException: Unable to create client connection to Elasticsearch.  Error: ConnectionError(<urllib3.connection.HTTPConnection object at 0x7f144c062f90>: Failed to establish a new connection: [Errno 111] Connection refused) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7f144c062f90>: Failed to establish a new connection: [Errno 111] Connection refused)

我相信--link是正确的。我是新手,所以我不知道发生了什么。我不确定是否必须为策展人提供配置文件。如果是的话,请告诉我。

1 个答案:

答案 0 :(得分:0)

确定。在我的情况下,问题只是curator.yml中给定的ip。当我将127.0.0.1更改为弹性运行的ip时,问题解决了