FoloToy / folotoy-server-self-hosting

Config files for self-hosting the FoloToy Server. Documents: https://docs.folotoy.com
https://tool.folotoy.com
GNU General Public License v3.0
457 stars 85 forks source link

docker compose pull 更新之后服务端mqtt一直reconnect #56

Closed xhuohai closed 11 months ago

xhuohai commented 11 months ago

log如下: folotoy-server-self-hosting-folotoy-1 | socket.gaierror: [Errno -2] Name or service not known folotoy-server-self-hosting-folotoy-1 | 2023-11-04 14:10:02,072 - INFO - Sleep 2s to reconnect folotoy-server-self-hosting-folotoy-1 | 2023-11-04 14:10:04,076 - ERROR - Run error: [Errno -2] Name or service not known folotoy-server-self-hosting-folotoy-1 | Traceback (most recent call last): folotoy-server-self-hosting-folotoy-1 | File "core/folotoy_app.py", line 159, in core.folotoy_app.FolotoyApp.start folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 914, in connect folotoy-server-self-hosting-folotoy-1 | return self.reconnect() folotoy-server-self-hosting-folotoy-1 | ^^^^^^^^^^^^^^^^ folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 1044, in reconnect folotoy-server-self-hosting-folotoy-1 | sock = self._create_socket_connection() folotoy-server-self-hosting-folotoy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection folotoy-server-self-hosting-folotoy-1 | return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source) folotoy-server-self-hosting-folotoy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/socket.py", line 827, in create_connection folotoy-server-self-hosting-folotoy-1 | for res in getaddrinfo(host, port, 0, SOCK_STREAM): folotoy-server-self-hosting-folotoy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/socket.py", line 962, in getaddrinfo folotoy-server-self-hosting-folotoy-1 | for res in _socket.getaddrinfo(host, port, family, type, proto, flags): folotoy-server-self-hosting-folotoy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ folotoy-server-self-hosting-folotoy-1 | socket.gaierror: [Errno -2] Name or service not known folotoy-server-self-hosting-folotoy-1 | 2023-11-04 14:10:04,076 - INFO - Sleep 2s to reconnect

docker_compose.yml中除了各种key和ip的修改,还把原来的端口映射注释掉,直接改成了netwok_mode: host

lewangdev commented 11 months ago

好像emqx启动失败了

lewangdev commented 11 months ago

发一下docker-compose.yml的配置

xhuohai commented 11 months ago

yml

version: '3' services: emqx: image: emqx/emqx:latest restart: always network_mode: host nginx: image: nginx:latest restart: always ports:

lewangdev commented 11 months ago

修改了上游的dns了吗?日志显示找不到域名

Name or service not known

docker的dns默认继承自 /etc/resolv.conf

xhuohai commented 11 months ago

修改了上游的dns了吗?日志显示找不到域名

Name or service not known

docker的dns默认继承自 /etc/resolv.conf

主机和folotoy容器的/etc/resolv.conf我都检查过了,在里面加了8.8.8.8等nameserver,而且在folotoy容器里ping了几个域名都是正常的

lewangdev commented 11 months ago

修改了上游的dns了吗?日志显示找不到域名

Name or service not known

docker的dns默认继承自 /etc/resolv.conf

主机和folotoy容器的/etc/resolv.conf我都检查过了,在里面加了8.8.8.8等nameserver,而且在folotoy容器里ping了几个域名都是正常的

xhuohai commented 11 months ago

修改了上游的dns了吗?日志显示找不到域名

Name or service not known

docker的dns默认继承自 /etc/resolv.conf

主机和folotoy容器的/etc/resolv.conf我都检查过了,在里面加了8.8.8.8等nameserver,而且在folotoy容器里ping了几个域名都是正常的

  • ping emqx 看看能不能通
  • 用浏览器访问18083端口看看能否打开

在容器的/etc/hosts里面加了127.0.0.1 emqx,现在可以了,感谢