gpt4 book ai didi

ubuntu - 无法为 influxdb docker 镜像运行 CLI/SHELL

转载 作者:太空宇宙 更新时间:2023-11-03 17:07:23 24 4
gpt4 key购买 nike

我正在尝试为一个小项目注入(inject)数据库。按照以下链接在 ubuntu 17.04 上运行 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 运行良好,我可以使用 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

问题已解决,以下是我需要执行的命令来为 influxdb 运行 cli/shell(感谢 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 - 无法为 influxdb docker 镜像运行 CLI/SHELL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48903052/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com