Giter Club home page Giter Club logo

Comments (5)

Piscen avatar Piscen commented on September 26, 2024

mongo服务没问题,我用python测试是正常的 client = mongo.MongoClient("mongodb://localhost:27017/")

from turms.

JamesChenX avatar JamesChenX commented on September 26, 2024

From the following logs, your turms servers have a connection problem with localhost/127.0.0.1:27017.
It usually happens when you run turms servers in docker-compose with the default network driver (bridge), but the MongoDB servers run in the host, so they are isolated in the network, and localhost/127.0.0.1:27017 won't work for turms servers.
You can simply fix it by updating the network driver of turms servers in docker-compose to host, e.g.:

turms-service:
  network_mode: host
2024-01-26 16:25:52 caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/127.0.0.1:27017
2024-01-26 16:25:52
2024-01-26 16:25:52 caused by: java.net.ConnectException: Connection refused

from turms.

Piscen avatar Piscen commented on September 26, 2024

log.txt
加上network_mode之后连服务都无法启动了

from turms.

Piscen avatar Piscen commented on September 26, 2024

使用默认的配置,依然是Connection refused,docker network inspect turms_im_default 命令运行结果
[
{
"Name": "turms_im_default",
"Id": "9721aae5d29b4e6cab8060fb1b7aac4a2adc953462d1616b6363718c7f9966cd",
"Created": "2024-01-28T07:19:45.900257066Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.21.0.0/16",
"Gateway": "172.21.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"030d9b7e36ab3f954225027a28e71e713c196f6e4828f158bdc2506c3fe55197": {
"Name": "turms_im-redis-1",
"EndpointID": "8bd8a76ea40f3f485e13feeead37ed9a91b05dc5364f98c4ce769d5af7b870a9",
"MacAddress": "02:42:ac:15:00:05",
"IPv4Address": "172.21.0.5/16",
"IPv6Address": ""
},
"0375b50e9752b06e0060b7fb154b75b890137049b70a8632a9c833c673088a21": {
"Name": "turms_im-turms-gateway-1",
"EndpointID": "78c27d6b80861d038532940b12140048382bc5f2d03ebecfb39e11cdb7d224db",
"MacAddress": "02:42:ac:15:00:07",
"IPv4Address": "172.21.0.7/16",
"IPv6Address": ""
},
"21f2a839b3f78cf91faaa04348bff1ccac1bea5a6673e9d62d2b7fd5c5af9a1c": {
"Name": "turms_im-turms-admin-1",
"EndpointID": "8f0cfe8ce11e3c4437df51e40d8c762efad2553fabb11654c443dd29dd9ae46d",
"MacAddress": "02:42:ac:15:00:04",
"IPv4Address": "172.21.0.4/16",
"IPv6Address": ""
},
"32a647d2a77cb95d963fc22e59dcb6ef62102960d89a1a94ea44e35d18a496af": {
"Name": "turms_im-mongodb-router-1",
"EndpointID": "d3040e10e8ad681d36a54394af52717ce834705901e2ab4d2a1bebf4ffb6d1f2",
"MacAddress": "02:42:ac:15:00:06",
"IPv4Address": "172.21.0.6/16",
"IPv6Address": ""
},
"402033d4e54497ce02338aaae47c1b0d1f1a26f7a1d7c93eb421fdd9a6d02ae0": {
"Name": "turms_im-mongodb-config-1",
"EndpointID": "738bf303c4a5781fd5cdbcda446f64cf94e7ff0e3e1d4ff7c454abb916eddb6c",
"MacAddress": "02:42:ac:15:00:03",
"IPv4Address": "172.21.0.3/16",
"IPv6Address": ""
},
"5b4373c64167dc648a02adb129f954ebc61d908d6943b402b2e5149e18d06298": {
"Name": "turms_im-mongodb-shard-1",
"EndpointID": "90301f5c9db187d9628d483024211e20ea87cd200a4ece6556c3a7104946ba10",
"MacAddress": "02:42:ac:15:00:02",
"IPv4Address": "172.21.0.2/16",
"IPv6Address": ""
},
"d61121b645153f7f76112c65909dbdcdcad17570ac46a8d7410704bad68b8d12": {
"Name": "turms_im-turms-service-1",
"EndpointID": "62a28bf2d8fc8427942f345e14275c76c8b3ecf9c02c0501998194c90f8fc388",
"MacAddress": "02:42:ac:15:00:08",
"IPv4Address": "172.21.0.8/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {
"com.docker.compose.network": "default",
"com.docker.compose.project": "turms_im",
"com.docker.compose.version": "2.19.1"
}
}
]

from turms.

Piscen avatar Piscen commented on September 26, 2024

看起来确实是容器间访问有问题,管理后台的插件列表两个接口一直都是超时http://172.18.0.7:9510/plugins,http://172.18.0.8:8510/plugins,我用的最新的docker-compose.standalone.yml文件搭建的,在本地和服务器上都有这个问题,运行环境需要其他的配置么

from turms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.