这是indexloc提供的服务,不要输入任何密码
Skip to content

Failed to expose service when an ambassador container already exists #200

@laukaichung

Description

@laukaichung

I have issues exposing the elasticsearch container on a remote server.

Here are the commands:

 dokku elasticsearch:create es
 dokku elasticsearch:expose es 127.0.0.1:9200 9300

The expose command produces this error:

docker: Error response from daemon: Conflict. The container name "/dokku.elasticsearch.es.ambassador" is already in use by container "b1648f0bded938e0e8deb5410484e352271e33dd73270549495dbaa9d3dfa5dc". You have to remove (or rename) that container to be able to reuse that name.

Still I try to run this command on my local machine to access the server using an ssh tunnel:

- ssh -o ExitOnForwardFailure=yes -f -N -L 9200:127.0.0.1:9200 "root@$SERVER_IP"

But the site http://127.0.0.1:9200/ still cannot be reached. I use similar methods to expose postgres and redis and they all work. No luck with elasticsearch.

This is the result of docker container ls. It looks like elasticsearch ambassador fails to be created.

CONTAINER ID   IMAGE                     COMMAND                  CREATED             STATUS             PORTS                      NAMES
4dcad31c1895   elasticsearch:7.14.1      "/bin/tini -- /usr/l…"   15 minutes ago      Up 15 minutes      9200/tcp, 9300/tcp         dokku.elasticsearch.es
ac8e6e4cb379   dokku/ambassador:0.3.3    "/entrypoint"            49 minutes ago      Up 49 minutes      127.0.0.1:6379->6379/tcp   dokku.redis.redis.ambassador
1777ef34467a   redis:6.2.6               "docker-entrypoint.s…"   49 minutes ago      Up 49 minutes      6379/tcp                   dokku.redis.redis
5b2eb4747cb7   dokku/ambassador:0.3.3    "/entrypoint"            About an hour ago   Up About an hour   127.0.0.1:5432->5432/tcp   dokku.postgres.db.ambassador
6783c6455fc5   my-pg/pg-aws:13.421   "docker-entrypoint.s…"   About an hour ago   Up About an hour   5432/tcp                   dokku.postgres.db

dokku elasticsearch:info es:

=====> es elasticsearch service information
       Config dir:          /var/lib/dokku/services/elasticsearch/es/config
       Config options:                               
       Data dir:            /var/lib/dokku/services/elasticsearch/es/data
       Dsn:                 http://dokku-elasticsearch-es:9200
       Exposed ports:       9200->127.0.0.1:9200 9300->9300 
       Id:                  8f67773673ce09189dbc4768b2a3ca80f5142bff60ab13ef89c1ac4b92852884
       Internal ip:         172.17.0.2               
       Links:               -                        
       Service root:        /var/lib/dokku/services/elasticsearch/es
       Status:              running                  
       Version:             elasticsearch:7.14.1 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions