2881099 / FreeIM

.NETCore websocket 实现简易、高性能、集群即时通讯组件,支持点对点通讯、群聊通讯、上线下线事件消息等众多实用性功能.
MIT License
1.45k stars 430 forks source link

发布server到服务器配置问题 #9

Open Tim1104 opened 4 years ago

Tim1104 commented 4 years ago

"ImServerOption": { "CSRedisClient": "118.25.209.177:26379,poolsize=5", "Servers": "127.0.0.1:6001;127.0.0.1:6002", "Server": "127.0.0.1:6001" }, 比如说我发布到 18.123.123.11 这个server 上。 "Servers": "127.0.0.1:6001;127.0.0.1:6002", "Server": "127.0.0.1:6001" 这两个配置文件要改成 18.123.123.11:6001,18.123.123.11:6002吗?

2881099 commented 4 years ago

是的,一致

Tim1104 commented 4 years ago

image 本地跑。连不上

2881099 commented 4 years ago

"Servers": "127.0.0.1:6001;127.0.0.1:6002", "Server": "127.0.0.1:6001" 这两个配置文件要改成 18.123.123.11:6001,18.123.123.11:6002

确保imserver运行的端口和这个一样

Tim1104 commented 4 years ago

本地试,vs 里面试,连不上

Tim1104 commented 4 years ago

image ws 服务端

2881099 commented 4 years ago

你改一下,servers server

2881099 commented 4 years ago

所有 imserver webapi 的 redis,servers 都一样

server 代表 imserver 当前属于哪个,跟名字一样

2881099 commented 4 years ago

所有 imserver webapi 的 servers 值都一样,servers 值是所有 imserver 的 server 用逗号相连

所有 imserver webapi 的 redis 一样,连得是同一redis服务器

每个 imserver 的 server 配置就是 imserver 程序的 ws 节点,ip+port,或者域名,或者域名+port 都成

Tim1104 commented 4 years ago

是一样的。也连不上ws image

2881099 commented 4 years ago

所有配置发出来,imserver怎么运行的,端口多少

Tim1104 commented 4 years ago

var config = app.ApplicationServices.GetRequiredService<IOptions>().Value; app.UseImServer(new ImServerOptions { Redis = new CSRedis.CSRedisClient(config.CSRedisClient), Servers = config.Servers.Split(";"), Server = config.Server }); "ImServerOption": { "CSRedisClient": "18.162.97.1:6379,password=cdrs1357rcp!@#,defaultDatabase=13,poolsize=100,ssl=false,writeBuffer=20480,prefix=stayplease", "Servers": "127.0.0.1:6001;127.0.0.1:6002", "Server": "127.0.0.1:6001" },

        ImHelper.Initialization(new ImClientOptions
        {
            Redis = new CSRedis.CSRedisClient("18.162.97.1:6379,password=cdrs1357rcp!@#,defaultDatabase=13,poolsize=100,ssl=false,writeBuffer=20480,prefix=stayplease"),
            Servers = new[] { "127.0.0.1:6001", "127.0.0.1:6002" }

        });
2881099 commented 4 years ago

你这咋还是一堆的127.0.0.1

2881099 commented 4 years ago

看我上面的回复,对照改

Tim1104 commented 4 years ago

在本地调试啊

Tim1104 commented 4 years ago

本地调试没有连上

2881099 commented 4 years ago

我说了半天,你的配置是个错的,肯定连不上啊

Tim1104 commented 4 years ago

我的意思现在没有发布到服务器上去,在本地调试环境。 本地用127.0.0.1

2881099 commented 4 years ago

上面说的几个,检查一下

Tim1104 commented 4 years ago

总算是搞明白了你这些配置了。

wuyaxiong123456 commented 4 years ago

萌新提问,聊天室列表无法获取,无法发送消息,错误提示一样,该如何解决?

2881099 commented 4 years ago

"Servers": "127.0.0.1:6001;127.0.0.1:6002", "Server": "127.0.0.1:6001" 这两个配置文件要改成 18.123.123.11:6001,18.123.123.11:6002

确保imserver运行的端口和这个一样

@wuyaxiong123456