kapacitor docker容器启动报错:open server: open service *influxdb.Service: failed to link subscription on s

 

新拉的kapacitor镜像,本地influxdb和telegraf也是使用容器的方式正常运行起来了,当docker run  kapacitor几秒之后,kapacitor就退出了。exited(1).

influxdb和kapacitor安装在同一台服务器上。

挂载公司原有的kapacitor配置文件来运行kapacitor,也还是报同样的错误。

 

查看日志

open server: open service *influxdb.Service: failed to link subscription on s
'##:::'##::::'###::::'########:::::'###:::::'######::'####:'########::'#######::'########::
 ##::'##::::'## ##::: ##.... ##:::'## ##:::'##... ##:. ##::... ##..::'##.... ##: ##.... ##:
 ##:'##::::'##:. ##:: ##:::: ##::'##:. ##:: ##:::..::: ##::::: ##:::: ##:::: ##: ##:::: ##:
 #####::::'##:::. ##: ########::'##:::. ##: ##:::::::: ##::::: ##:::: ##:::: ##: ########::
 ##. ##::: #########: ##.....::: #########: ##:::::::: ##::::: ##:::: ##:::: ##: ##.. ##:::
 ##:. ##:: ##.... ##: ##:::::::: ##.... ##: ##::: ##:: ##::::: ##:::: ##:::: ##: ##::. ##::
 ##::. ##: ##:::: ##: ##:::::::: ##:::: ##:. ######::'####:::: ##::::. #######:: ##:::. ##:
..::::..::..:::::..::..:::::::::..:::::..:::......:::....:::::..::::::.......:::..:::::..::
2019/09/03 05:26:56 Using configuration at: /etc/kapacitor/kapacitor.conf
[run] 2019/09/03 05:26:56 I! Kapacitor starting, version 1.3.3, branch HEAD, commit ce586f35e89e75a1779e2b493caba15d66295a15
[run] 2019/09/03 05:26:56 I! Go version go1.7.5
[srv] 2019/09/03 05:26:56 I! Kapacitor hostname: 71e10cbeff3b
[srv] 2019/09/03 05:26:56 I! ClusterID: 8853ea0f-070e-4ec5-b80b-45bbbd58bd35 ServerID: d117a18e-80c7-4288-a534-59f300ec727b
[task_master:main] 2019/09/03 05:26:56 I! opened
[httpd] 2019/09/03 05:27:56 I! Closed HTTP service
[httpd] 2019/09/03 05:27:56 I! Closed HTTP service
[task_master:main] 2019/09/03 05:27:56 I! closed
[run] 2019/09/03 05:27:56 E! open server: open service *influxdb.Service: failed to link subscription on startup: canceled
run: open server: open service *influxdb.Service: failed to link subscription on startup: canceled

相关issue:https://github.com/influxdata/kapacitor/issues/1372

但是还是无法解决我的问题.

由于日志里面只打印了info级别,于是修改kapacitor.conf里面日志级别

[logging]
  file = "STDERR"
  level = "DEBUG"  // 把默认的INFO修改为DEBUG

看到debug信息,是说没有连上influxdb服务地址

[influxdb] 2019/09/03 06:24:12 D! linking subscriptions for cluster default
[influxdb] 2019/09/03 06:24:13 D! failed to connect to InfluxDB, retrying...  Get http://10.10.13.80:8086/ping: dial tcp 10.10.13.80:8086: getsockopt: no route to host
[influxdb] 2019/09/03 06:24:14 D! failed to connect to InfluxDB, retrying...  Get http://10.10.13.80:8086/ping: dial tcp 10.10.13.80:8086: getsockopt: no route to host
[influxdb] 2019/09/03 06:24:15 D! failed to connect to InfluxDB, retrying...  Get http://10.10.13.80:8086/ping: dial tcp 10.10.13.80:8086: getsockopt: no route to host
[influxdb] 2019/09/03 06:24:16 D! failed to connect to InfluxDB, retrying...  Get http://10.10.13.80:8086/ping: dial tcp 10.10.13.80:8086: getsockopt: no route to host

知道了,原来是网络模式不一样。

通过docker inspect查看原有的kapacitor服务可以看到是使用的host模式。

参考:https://docs.docker.com/network/host/

通过指定--network host,即kapacitor容器使用的是宿主机的ip地址,由于pakacitor默认会绑定9092端口,使用host后,kapacitor可以在宿主机的9092端口使用。此时使用-p 配置的端口映射不生效。

docker run --network host --name kapacitor -d docker.io/kapacitor:1.5

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值