Skip to content

turms-gateway服务端启动失败,Error creating bean with name 'adminApiRateLimitingManager' defined in file #1596

@21xiaoye

Description

@21xiaoye

使用环境

  • temurin21
  • mongoDB8.0
  • Redis-server6.0.16
  • Ubuntu 22.04.5 LTS(windows11 wsl2)

我能成功启动turms-gateway服务端,但是在启动turms-server服务端时遇到了以下错误,虽然我在issues中看到有人遇到了同样的错误,但是这些方法好像并不能帮我解决错误,也许是我操作有误。
c7bd4969b02d48480963101d538cb22
dc19982955ce0222c6f163fd89e02da
以下是我的turms-gateway的application-dev.yml

spring:
  netty:
    leak-detection: paranoid

############################### Turms ###############################

turms:
  cluster:
    connection:
      server:
        port-auto-increment: true
    shared-config:
      mongo:
        uri: mongodb://localhost:27017/turms-config-dev
  logging:
    console:
      enabled: true
  plugin:
    js:
      debug:
        enabled: true
  service:
    admin-api:
      debug:
        enabled: true
    client-api:
      logging:
        included-notification-categories:
          - category: all
    fake:
      enabled: true
    message:
      check-if-target-active-and-not-deleted: false
    mongo:
      admin:
        uri: mongodb://localhost:27017/turms-dev
      user:
        uri: mongodb://localhost:27017/turms-dev
      group:
        uri: mongodb://localhost:27017/turms-dev
      conversation:
        uri: mongodb://localhost:27017/turms-dev
      message:
        uri: mongodb://localhost:27017/turms-dev
        tiered-storage:
          enabled: true
          tiers:
            hot:
              days: 30
              shards:
                - shard01
            warm:
              days: 60
              shards:
                - shard01
            cold:
              days: 270
              shards:
                - shard01
            frozen:
              shards:
                - shard01
turms-plugin:
  minio:
    retry:
      enabled: false

在整个项目中我只修改了application.yml中的action为dev,然后修改了turms-server-common模块中RedisProperties类关于Redis的url,对于Mongodb的url,我曾修改为

uri: mongodb://localhost:27017,localhost:27018,localhost:27019/turms-dev?replicaSet=rs1

形式,但是在启动的时候还是遇到了相同的问题,在错误输出的最后新增了以下错误信息。
caused by: com.mongodb.MongoTimeoutException: Timed out while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=REPLICA_SET, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING}, {address=localhost:27018, type=UNKNOWN, state=CONNECTING}, {address=localhost:27019, type=UNKNOWN, state=CONNECTING}]
如果我采用这种分片集群url的格式,我连turms-gateway服务端都无法启动。
在最开始运行项目的时候,因为我的Redis版本太低运行Lua脚本的时候导致turms-gateway服务启动不成功,所以我想是不是Mongodb的版本太高导致的错误。

以下为我的Mongodb.conf
8698141d151b32c739fa14c47de0c53
我使用Navicat Premium 16l使用Shard Cluster分片集群的格式连接我的mongodb是能够连接成功的。
以下是我的Mongodb运行状况
14185bc4aa863e680c7508b60dc732c

以下为我的疑问:
我使用mlaunch创建mongodb分片集群,我不能使用wsl中ubuntu的Ip地址连接MongoDB,使用localhost或者127.0.0.1时能够连接成功。

希望这些错误信息能够有所帮助,同时我非常感谢作者能够开源这么好的项目,这是我目前见过的开源im-java项目中最好的项目。

看完docs对我也有很大的帮助,让我得以有机会学习这个项目的设计理念和工程思维,这是我在书本中无法学习到的,所以我需要在开发环境中运行这个项目进行更深一步的学习。

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionHow to do something

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions