openimsdk / open-im-server

IM Chat
https://openim.io
Apache License 2.0
13.73k stars 2.42k forks source link

OpenIM-Server FAIL TO START #737

Closed Dr-Wu-Wen closed 9 months ago

Dr-Wu-Wen commented 1 year ago

What happened?

When I execute the command'/start_all.sh', it appears: ==========================start push server=========================== configFolderPath: use config /openim/Open-IM-Server/config/config.yaml use config /openim/Open-IM-Server/config/notification.yaml start Push server, port: 10170 prometheusPort: 20170 , OpenIM version: v3.0.0 panic: dial tcp 127.0.0.1:9092: connect: connection refused

goroutine 47 [running]: github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka.(MConsumerGroup).RegisterHandleAndConsumer(0xc000285e80, {0x16e8670, 0xc00011c708}) /openim/Open-IM-Server/pkg/common/kafka/consumer_group.go:63 +0x145 created by github.com/OpenIMSDK/Open-IM-Server/internal/push.(Consumer).Start /openim/Open-IM-Server/internal/push/consumer_init.go:40 +0x8f。

Note: My 'Kafka' and other components are not on the same server as OpenIM server.

What did you expect to happen?

I hope to start the service successfully。

How can we reproduce it (as minimally and precisely as possible)?

I hope to start the service successfully。

Anything else we need to know?

No response

version

```console $ {name} version # paste output here ```

Cloud provider

OS version

```console # On Linux: $ cat /etc/os-release # paste output here $ uname -a # paste output here # On Windows: C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture # paste output here ```

Install tools

Dr-Wu-Wen commented 1 year ago

my config.yaml: kafka: username: #username password: #password addr: [192.168.0.46:9092] # latestMsgToRedis: topic: "latestMsgToRedis" #It is not recommended to modify offlineMsgToMongo: topic: "offlineMsgToMongoMysql" #It is not recommended to modify msgToPush: topic: "msgToPush" #It is not recommended to modify consumerGroupID: #consumer group, it is not recommended to modify msgToRedis: redis# msgToMongo: mongo # msgToMySql: mysql# msgToPush: push #

kubbot commented 1 year ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


my config.yaml: kafka: username: #username password: #password addr: [192.168.0.46:9092] # latestMsgToRedis: topic: "latestMsgToRedis" #It is not recommended to modify offlineMsgToMongo: topic: "offlineMsgToMongoMysql" #It is not recommended to modify msgToPush: topic: "msgToPush" #It is not recommended to modify consumerGroupID: #consumer group, it is not recommended to modify msgToRedis: redis# msgToMongo: mongo # msgToMySql: mysql# msgToPush: push #

skiffer-git commented 1 year ago

Note: My 'Kafka' and other components are not on the same server as OpenIM server.

skiffer-git commented 1 year ago

@FGadvancer

kubbot commented 1 year ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@FGadvancer

FGadvancer commented 1 year ago

If you are deploying Kafka from source code, during the deployment, modify the listeners configuration in the server.properties file of Kafka to replace listeners=PLAINTEXT://192.168.1.53:9092 with your local network IP.

Dr-Wu-Wen commented 1 year ago

Not very clear! Doesn't it seem to have anything to do with Kafka? My Kafka service is deployed through Docker on 192.168.0.46, And it has started normally. But my openIM server is deployed on another server, ip: 192.168.0.208, Then, when I started the openIM server, an appeal error occurred. error log: ==========================start push server=========================== configFolderPath: use config /openim/Open-IM-Server/config/config.yaml use config /openim/Open-IM-Server/config/notification.yaml start Push server, port: 10170 prometheusPort: 20170 , OpenIM version: v3.0.0 panic: dial tcp 127.0.0.1:9092: connect: connection refused

goroutine 47 [running]: github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka.(MConsumerGroup).RegisterHandleAndConsumer(0xc000285e80, {0x16e8670, 0xc00011c708}) /openim/Open-IM-Server/pkg/common/kafka/consumer_group.go:63 +0x145 created by github.com/OpenIMSDK/Open-IM-Server/internal/push.(Consumer).Start /openim/Open-IM-Server/internal/push/consumer_init.go:40 +0x8f。

ling7334 commented 1 year ago

my exprience is check your kafka config KAFKA_ADVERTISED_LISTENERS even though kafka will startup, openim will get kafka address from advertise, it seem KAFKA_ADVERTISED_LISTENERS is set to localhost

  kafka:
    container_name: kafka
    image: wurstmeister/kafka
    restart: always
    ports:
      - 9092:9092
    networks:
      - traefik
      - private
    environment:
      TZ: Asia/Shanghai
      KAFKA_BROKER_ID: 0
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_CREATE_TOPICS: "latestMsgToRedis:8:1,msgToPush:8:1,offlineMsgToMongoMysql:8:1"
      KAFKA_ADVERTISED_LISTENERS: INSIDE://127.0.0.1:9093,OUTSIDE://192.168.0.46:9092
      KAFKA_LISTENERS: INSIDE://:9093,OUTSIDE://:9092
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT"
      KAFKA_INTER_BROKER_LISTENER_NAME: OUTSIDE
kubbot commented 11 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

cubxxw commented 11 months ago

/reset