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

did i cluster deploy right? #76

Open
szx007 opened this issue Mar 19, 2020 · 8 comments
Open

did i cluster deploy right? #76

szx007 opened this issue Mar 19, 2020 · 8 comments

Comments

@szx007
Copy link

szx007 commented Mar 19, 2020

i wan't to deploy a cluster
steps:
start router
./router

start node1
/Users/kris/go/bin/hmq --clusterport 8099 --router :9888 --port 1883
mosquitto_sub -t testtest -p 1883

start node2
/Users/kris/go/bin/hmq --clusterport 8090 --router :9888 --port 1884
mosquitto_sub -t testtest -p 1883

pub message
mosquitto_pub -p 1884 -t testtest -m "22"

but only node2 recv message
did i cluster run right way?

@chowyu08
Copy link
Contributor

could you show the log of router?

@szx007
Copy link
Author

szx007 commented Mar 19, 2020

2020-03-19 18:28:22 INFO server.go :start listener on 0.0.0.0:9888

2020-03-19 18:33:23 INFO server.go :receive conn from client , clientID = c5eb95c4-3cd3-41cf-854c-c5c7a2cd4d92 keepAlive: 60
2020-03-19 18:33:23 DEBUG message.go :recv broker info: PUBLISH: dup: false qos: 0 retain: false rLength: 101 topicName: broker000100101info MessageID: 0 payload: {"brokerID":"c5eb95c4-3cd3-41cf-854c-c5c7a2cd4d92","brokerUrl":"127.0.0.1:8099"} brokerID = c5eb95c4-3cd3-41cf-854c-c5c7a2cd4d92
2020-03-19 18:33:30 INFO server.go :receive conn from client , clientID = 9e54e6aa-b16d-4ae9-989f-c290b572a331 keepAlive: 60
2020-03-19 18:33:30 DEBUG message.go :recv broker info: PUBLISH: dup: false qos: 0 retain: false rLength: 101 topicName: broker000100101info MessageID: 0 payload: {"brokerID":"9e54e6aa-b16d-4ae9-989f-c290b572a331","brokerUrl":"127.0.0.1:8090"} brokerID = 9e54e6aa-b16d-4ae9-989f-c290b572a331

@szx007
Copy link
Author

szx007 commented Mar 19, 2020

image

@chowyu08
Copy link
Contributor

chowyu08 commented Mar 20, 2020

node1 and node2 are same host?

broker ip is:127.0.0.1

c.info.localIP, _, _ = net.SplitHostPort(c.conn.LocalAddr().String())

@chowyu08
Copy link
Contributor

你的集群建立好像是在你发消息之后,集群不好缓存消息目前

@NasinLin
Copy link

@chowyu08 我也是照上面做法做,node2 無法 subscribe node1 的消息。

@jannson
Copy link
Contributor

jannson commented May 5, 2020

很早就 stat 了作者的项目,一直没机会用。今天看到这个问题就尝试定位了下问题,不能用的原因:
1.

https://github.com/fhmq/hmq/blob/master/broker/broker.go#L276

这个位置没较验通过,少了版本号与版本 ID

func (c *client) ProcessSubscribe(packet *packets.SubscribePacket) {

其次是这里,没有处理 REMOTE 的情况,导致 broadcast 过来的消息没被处理。

想尝试修复下,发现还有其它问题,所以无法提交 PR

@jannson
Copy link
Contributor

jannson commented May 5, 2020

修复并测试成功,代码已经提交,请作者确认:

#86

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

4 participants