Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster集群创建问题 #12

Closed
airdive opened this issue Oct 28, 2021 · 0 comments
Closed

cluster集群创建问题 #12

airdive opened this issue Oct 28, 2021 · 0 comments

Comments

@airdive
Copy link

airdive commented Oct 28, 2021

cluster集群属性配置:
cluster: # 集群配置
enable: ${CLUSTER_ENABLE:true} # 集群开关
url: ${CLUSTER_URL:192.168.26.123:7771,192.168.26.124:7771,192.168.25.100:7771} # 启动节点
port: ${CLUSTER_PORT:7771} # 端口 7772
node: ${CLUSTER_NODE:node-1} # 集群节点名称 唯一,123:node-2,124:node-3
namespace: ${CLUSTER_NAMESPACE:topband} # 集群空间,需要一致才能通信
集群以docker方式启动(--net host),192.168.25.100为本机节点IP,DEBUG日志可以看到与123、124建立了连接:
DEBUG r.n.resources.NewConnectionProvider - [id:43e77142, L:/192.168.25.100:55297 - R:/192.168.26.123:7771] Connected new channel
DEBUG r.n.resources.NewConnectionProvider - [id:43e77142, L:/192.168.25.100:55297 - R:/192.168.26.123:7771] onStateChange([connected], SimpleConnection{channel=[id: 0x43e77142, L:/192.168.25.100:55297 - R:/192.168.26.123:7771]})
DEBUG r.n.resources.NewConnectionProvider - [id:43e77142, L:/192.168.25.100:55297 - R:/192.168.26.123:7771] onStateChange([configured], ChannelOperations{SimpleConnection{channel=[id: 0x43e77142, L:/192.168.25.100:55297 - R:/192.168.26.123:7771]}})
DEBUG r.n.resources.NewConnectionProvider - [id:46eb97b2, L:/192.168.25.100:55298 - R:/192.168.26.124:7771] Connected new channel
DEBUG r.n.resources.NewConnectionProvider - [id:46eb97b2, L:/192.168.25.100:55298 - R:/192.168.26.124:7771] onStateChange([connected], SimpleConnection{channel=[id: 0x46eb97b2, L:/192.168.25.100:55298 - R:/192.168.26.124:7771]})
DEBUG r.n.resources.NewConnectionProvider - [id:46eb97b2, L:/192.168.25.100:55298 - R:/192.168.26.124:7771] onStateChange([configured], ChannelOperations{SimpleConnection{channel=[id: 0x46eb97b2, L:/192.168.25.100:55298 - R:/192.168.26.124:7771]}})

本地机器ScubeClusterRegistry类的spreadMessage()方法向集群传播消息时,打印cluster.otherMembers():
INFO i.g.q.registry.ScubeClusterRegistry - cluster: [topband:1eb8d9d4-ffde-4942-bc91-f133e2770cae@192.168.26.123:7771]
而124机器上打印cluster.otherMembers():[],为空
请问这是怎么回事?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants