无法 运行 CLI/SHELL 用于 influxdb docker 图像
Not able to run CLI/SHELL for influxdb docker image
我正在尝试为一个小项目注入数据库。在 ubuntu 17.04 上遵循以下 link 到 运行 docker 图片。 https://hub.docker.com/_/influxdb/
使用以下命令启动容器,influxdb 完美启动。
foo@ubuntu:~/software/influxdb$sudo docker run -p 8086:8`enter code here`086 -v $PWD:/var/lib/influxdb influxdb
为 CLI/SHELL 执行以下命令时出现错误。
foo@ubuntu:~/software/influxdb$ sudo docker run --rm --link=influxdb -it influxdb influx -host influxdb
docker: Error response from daemon: Cannot link to a non running container: /influxdb AS /epic_lumiere/influxdb.
foo@ubuntu:~/software/influxdb$ sudo docker exec -it influxdb influx
Error response from daemon: Container c04706b2bbcd5cfa70f66d156f1b8f513f2214d5bf2f7a0dd3ff517b45774e08 is not running
注意:influxdb 是 运行ning 很好,我可以使用 http 连接到它。
foo@ubuntu:~/software/influxdb$ sudo docker run -p 8086:8086 -v $PWD:/var/lib/influxdb influxdb
[I] 2018-02-21T08:21:12Z InfluxDB starting, version 1.4.3, branch 1.4, commit 60d27e6995558f38a39e90b35a92cbac080310a3
[I] 2018-02-21T08:21:12Z Go version go1.9.2, GOMAXPROCS set to 4
[I] 2018-02-21T08:21:12Z Using configuration at: /etc/influxdb/influxdb.conf
[I] 2018-02-21T08:21:12Z Using data dir: /var/lib/influxdb/data service=store
[I] 2018-02-21T08:21:12Z reading file /var/lib/influxdb/wal/_internal/monitor/1/_00001.wal, size 877606 engine=tsm1 service=cacheloader
[I] 2018-02-21T08:21:12Z reading file /var/lib/influxdb/wal/_internal/monitor/1/_00002.wal, size 0 engine=tsm1 service=cacheloader
[I] 2018-02-21T08:21:12Z /var/lib/influxdb/data/_internal/monitor/1 opened in 88.565658ms service=store
[I] 2018-02-21T08:21:12Z opened service service=subscriber
[I] 2018-02-21T08:21:12Z Starting monitor system service=monitor
[I] 2018-02-21T08:21:12Z 'build' registered for diagnostics monitoring service=monitor
[I] 2018-02-21T08:21:12Z 'runtime' registered for diagnostics monitoring service=monitor
[I] 2018-02-21T08:21:12Z 'network' registered for diagnostics monitoring service=monitor
[I] 2018-02-21T08:21:12Z 'system' registered for diagnostics monitoring service=monitor
[I] 2018-02-21T08:21:12Z Starting precreation service with check interval of 10m0s, advance period of 30m0s service=shard-precreation
[I] 2018-02-21T08:21:12Z Starting snapshot service service=snapshot
[I] 2018-02-21T08:21:12Z Starting continuous query service service=continuous_querier
[I] 2018-02-21T08:21:12Z Starting HTTP service service=httpd
[I] 2018-02-21T08:21:12Z Authentication enabled:false service=httpd
[I] 2018-02-21T08:21:12Z Listening on HTTP:[::]:8086 service=httpd
[I] 2018-02-21T08:21:12Z Starting retention policy enforcement service with check interval of 30m0s service=retention
[I] 2018-02-21T08:21:12Z Listening for signals
[I] 2018-02-21T08:21:12Z Sending usage statistics to usage.influxdata.com
[I] 2018-02-21T08:21:12Z Storing statistics in database '_internal' retention policy 'monitor', at interval 10s service=monitor
[httpd] 172.17.0.1 - - [21/Feb/2018:08:22:28 +0000] "HEAD /ping HTTP/1.1" 204 0 "-" "curl/7.52.1" 5ad8ee44-16e0-11e8-8001-000000000000 3075
[I] 2018-02-21T08:51:12Z Retention policy shard deletion check commencing. service=retention
[I] 2018-02-21T09:13:48Z SHOW DATABASES service=query
[httpd] 172.17.0.1 - - [21/Feb/2018:09:13:48 +0000] "GET /query?q=show+databases HTTP/1.1" 200 109 "-" "curl/7.52.1" 86ae24be-16e7-11e8-8002-000000000000 3423
在此先感谢您的帮助。
foo@ubuntu:~/software/influxdb$ sudo docker ps -a | grep influxdb
[sudo] password for foo:
5e73d087fc19 influxdb "/entrypoint.sh infl…" About an hour ago Created sleepy_lumiere
18acacfc6377 influxdb "/entrypoint.sh infl…" 5 days ago Up 5 days 0.0.0.0:8086->8086/tcp loving_benz
97d935acebd7 influxdb "/entrypoint.sh infl…" 5 days ago Exited (255) 5 days ago 0.0.0.0:8086->8086/tcp happy_agnesi
5d6491f9f143 influxdb "/entrypoint.sh infl…" 5 days ago Exited (255) 5 days ago 0.0.0.0:8086->8086/tcp wizardly_bhabha
7d30f3891672 influxdb "/entrypoint.sh infl…" 7 days ago Exited (0) 6 days ago elastic_booth
2a5451537561 influxdb "/entrypoint.sh infl…" 7 days ago Exited (255) 7 days ago 0.0.0.0:8086->8086/tcp flamboyant_ride6
646581f7bcf9 influxdb "/entrypoint.sh infl…" 7 days ago Exited (0) 7 days ago competent_blackwell
c04706b2bbcd influxdb "/entrypoint.sh infl…" 8 days ago Created influxdb
97fcd152046d influxdb "/entrypoint.sh infl…" 8 days ago Exited (0) 7 days ago flamboyant_tereshkova
ee562bceaa51 influxdb "/entrypoint.sh infl…" 8 days ago Exited (0) 8 days ago objective_cray
问题已解决,以下是我需要执行的命令 运行 cli/shell for influxdb(感谢 rajiv)
foo@ubuntu:~/software/influxdb$sudosudo docker run --rm --link=<container_name> -it influxdb influx -host <container_name>
您必须 运行 使用 influxdb 容器的实际名称,即 loving_benz。下面的命令应该可以工作。
sudo docker run --rm --link=loving_benz -it influxdb influx -host
loving_benz
我正在尝试为一个小项目注入数据库。在 ubuntu 17.04 上遵循以下 link 到 运行 docker 图片。 https://hub.docker.com/_/influxdb/
使用以下命令启动容器,influxdb 完美启动。
foo@ubuntu:~/software/influxdb$sudo docker run -p 8086:8`enter code here`086 -v $PWD:/var/lib/influxdb influxdb
为 CLI/SHELL 执行以下命令时出现错误。
foo@ubuntu:~/software/influxdb$ sudo docker run --rm --link=influxdb -it influxdb influx -host influxdb
docker: Error response from daemon: Cannot link to a non running container: /influxdb AS /epic_lumiere/influxdb.
foo@ubuntu:~/software/influxdb$ sudo docker exec -it influxdb influx
Error response from daemon: Container c04706b2bbcd5cfa70f66d156f1b8f513f2214d5bf2f7a0dd3ff517b45774e08 is not running
注意:influxdb 是 运行ning 很好,我可以使用 http 连接到它。
foo@ubuntu:~/software/influxdb$ sudo docker run -p 8086:8086 -v $PWD:/var/lib/influxdb influxdb
[I] 2018-02-21T08:21:12Z InfluxDB starting, version 1.4.3, branch 1.4, commit 60d27e6995558f38a39e90b35a92cbac080310a3
[I] 2018-02-21T08:21:12Z Go version go1.9.2, GOMAXPROCS set to 4
[I] 2018-02-21T08:21:12Z Using configuration at: /etc/influxdb/influxdb.conf
[I] 2018-02-21T08:21:12Z Using data dir: /var/lib/influxdb/data service=store
[I] 2018-02-21T08:21:12Z reading file /var/lib/influxdb/wal/_internal/monitor/1/_00001.wal, size 877606 engine=tsm1 service=cacheloader
[I] 2018-02-21T08:21:12Z reading file /var/lib/influxdb/wal/_internal/monitor/1/_00002.wal, size 0 engine=tsm1 service=cacheloader
[I] 2018-02-21T08:21:12Z /var/lib/influxdb/data/_internal/monitor/1 opened in 88.565658ms service=store
[I] 2018-02-21T08:21:12Z opened service service=subscriber
[I] 2018-02-21T08:21:12Z Starting monitor system service=monitor
[I] 2018-02-21T08:21:12Z 'build' registered for diagnostics monitoring service=monitor
[I] 2018-02-21T08:21:12Z 'runtime' registered for diagnostics monitoring service=monitor
[I] 2018-02-21T08:21:12Z 'network' registered for diagnostics monitoring service=monitor
[I] 2018-02-21T08:21:12Z 'system' registered for diagnostics monitoring service=monitor
[I] 2018-02-21T08:21:12Z Starting precreation service with check interval of 10m0s, advance period of 30m0s service=shard-precreation
[I] 2018-02-21T08:21:12Z Starting snapshot service service=snapshot
[I] 2018-02-21T08:21:12Z Starting continuous query service service=continuous_querier
[I] 2018-02-21T08:21:12Z Starting HTTP service service=httpd
[I] 2018-02-21T08:21:12Z Authentication enabled:false service=httpd
[I] 2018-02-21T08:21:12Z Listening on HTTP:[::]:8086 service=httpd
[I] 2018-02-21T08:21:12Z Starting retention policy enforcement service with check interval of 30m0s service=retention
[I] 2018-02-21T08:21:12Z Listening for signals
[I] 2018-02-21T08:21:12Z Sending usage statistics to usage.influxdata.com
[I] 2018-02-21T08:21:12Z Storing statistics in database '_internal' retention policy 'monitor', at interval 10s service=monitor
[httpd] 172.17.0.1 - - [21/Feb/2018:08:22:28 +0000] "HEAD /ping HTTP/1.1" 204 0 "-" "curl/7.52.1" 5ad8ee44-16e0-11e8-8001-000000000000 3075
[I] 2018-02-21T08:51:12Z Retention policy shard deletion check commencing. service=retention
[I] 2018-02-21T09:13:48Z SHOW DATABASES service=query
[httpd] 172.17.0.1 - - [21/Feb/2018:09:13:48 +0000] "GET /query?q=show+databases HTTP/1.1" 200 109 "-" "curl/7.52.1" 86ae24be-16e7-11e8-8002-000000000000 3423
在此先感谢您的帮助。
foo@ubuntu:~/software/influxdb$ sudo docker ps -a | grep influxdb
[sudo] password for foo:
5e73d087fc19 influxdb "/entrypoint.sh infl…" About an hour ago Created sleepy_lumiere
18acacfc6377 influxdb "/entrypoint.sh infl…" 5 days ago Up 5 days 0.0.0.0:8086->8086/tcp loving_benz
97d935acebd7 influxdb "/entrypoint.sh infl…" 5 days ago Exited (255) 5 days ago 0.0.0.0:8086->8086/tcp happy_agnesi
5d6491f9f143 influxdb "/entrypoint.sh infl…" 5 days ago Exited (255) 5 days ago 0.0.0.0:8086->8086/tcp wizardly_bhabha
7d30f3891672 influxdb "/entrypoint.sh infl…" 7 days ago Exited (0) 6 days ago elastic_booth
2a5451537561 influxdb "/entrypoint.sh infl…" 7 days ago Exited (255) 7 days ago 0.0.0.0:8086->8086/tcp flamboyant_ride6
646581f7bcf9 influxdb "/entrypoint.sh infl…" 7 days ago Exited (0) 7 days ago competent_blackwell
c04706b2bbcd influxdb "/entrypoint.sh infl…" 8 days ago Created influxdb
97fcd152046d influxdb "/entrypoint.sh infl…" 8 days ago Exited (0) 7 days ago flamboyant_tereshkova
ee562bceaa51 influxdb "/entrypoint.sh infl…" 8 days ago Exited (0) 8 days ago objective_cray
问题已解决,以下是我需要执行的命令 运行 cli/shell for influxdb(感谢 rajiv)
foo@ubuntu:~/software/influxdb$sudosudo docker run --rm --link=<container_name> -it influxdb influx -host <container_name>
您必须 运行 使用 influxdb 容器的实际名称,即 loving_benz。下面的命令应该可以工作。
sudo docker run --rm --link=loving_benz -it influxdb influx -host loving_benz