You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/10/11 07:54:38 UTC

[GitHub] [servicecomb-kie] ryaninvoker opened a new pull request #219: 修复Linux 本地版Kie在部分机器上报找不到private ip的错误

ryaninvoker opened a new pull request #219:
URL: https://github.com/apache/servicecomb-kie/pull/219


   #218 修复Linux 本地版Kie在部分机器上报create memberlist: Failed to get final advertise address: No private IP address found, and explicit IP not provided


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #219: 修复Linux 本地版Kie在部分机器上报找不到private ip的错误

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #219:
URL: https://github.com/apache/servicecomb-kie/pull/219#discussion_r725949984



##########
File path: server/pubsub/bus.go
##########
@@ -55,13 +56,16 @@ type Bus struct {
 func Init() {
 	once.Do(func() {
 		ac := agent.DefaultConfig()
+		sc := serf.DefaultConfig()
+		setSerfAdvertiseAddr(sc, ac.BindAddr)
 		if config.Configurations.ListenPeerAddr != "" {
 			ac.BindAddr = config.Configurations.ListenPeerAddr
 		}
 		if config.Configurations.AdvertiseAddr != "" {
 			ac.AdvertiseAddr = config.Configurations.AdvertiseAddr
+			serfAdvertiseAddr := strings.Split(config.Configurations.AdvertiseAddr, ":")

Review comment:
       为何split?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] ryaninvoker commented on a change in pull request #219: 修复Linux 本地版Kie在部分机器上报找不到private ip的错误

Posted by GitBox <gi...@apache.org>.
ryaninvoker commented on a change in pull request #219:
URL: https://github.com/apache/servicecomb-kie/pull/219#discussion_r726689967



##########
File path: server/command/command.go
##########
@@ -49,12 +49,19 @@ func ParseConfig(args []string) (err error) {
 			Usage:       "kie use this ip port to join a kie cluster, example: --peer-addr=10.1.1.10:5000",
 			Destination: &config.Configurations.PeerAddr,
 			EnvVar:      "PEER_ADDR",
-		}, cli.StringFlag{
+		},
+		cli.StringFlag{
 			Name:        "listen-peer-addr",
 			Usage:       "listen on ip port, kie receive events example: --listen-peer-addr=10.1.1.10:5000",
 			Destination: &config.Configurations.ListenPeerAddr,
 			EnvVar:      "LISTEN_PEER_ADDR",
 		},
+		cli.StringFlag{
+			Name:        "advertise-addr",
+			Usage:       "kie advertise addr, kie advertise addr example: --advertise-addr=10.1.1.10:5000",

Review comment:
       这个监听地址有2个地方使用,一个是agent的advertiseAddr 这个是ip+port 一个是serf的advertise 这个是ip,用户输入ip+port agent取完整的ip+port serf只取ip




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] ryaninvoker commented on a change in pull request #219: 修复Linux 本地版Kie在部分机器上报找不到private ip的错误

Posted by GitBox <gi...@apache.org>.
ryaninvoker commented on a change in pull request #219:
URL: https://github.com/apache/servicecomb-kie/pull/219#discussion_r725928052



##########
File path: server/resource/v1/kv_resource_test.go
##########
@@ -67,7 +67,7 @@ func init() {
 	config.Configurations = &config.Config{
 		DB:             config.DB{},
 		ListenPeerAddr: "127.0.0.1:4000",
-		AdvertiseAddr:  "127.0.0.1:4000",
+		AdvertiseAddr:  "127.0.0.1",

Review comment:
       已经改回,agentConf取完整的IP:port serfConf取前面的IP




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #219: 修复Linux 本地版Kie在部分机器上报找不到private ip的错误

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #219:
URL: https://github.com/apache/servicecomb-kie/pull/219#discussion_r726684927



##########
File path: server/command/command.go
##########
@@ -49,12 +49,19 @@ func ParseConfig(args []string) (err error) {
 			Usage:       "kie use this ip port to join a kie cluster, example: --peer-addr=10.1.1.10:5000",
 			Destination: &config.Configurations.PeerAddr,
 			EnvVar:      "PEER_ADDR",
-		}, cli.StringFlag{
+		},
+		cli.StringFlag{
 			Name:        "listen-peer-addr",
 			Usage:       "listen on ip port, kie receive events example: --listen-peer-addr=10.1.1.10:5000",
 			Destination: &config.Configurations.ListenPeerAddr,
 			EnvVar:      "LISTEN_PEER_ADDR",
 		},
+		cli.StringFlag{
+			Name:        "advertise-addr",
+			Usage:       "kie advertise addr, kie advertise addr example: --advertise-addr=10.1.1.10:5000",

Review comment:
       如果不需要port,那么usage里面的举例是不是要改下




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] ryaninvoker commented on a change in pull request #219: 修复Linux 本地版Kie在部分机器上报找不到private ip的错误

Posted by GitBox <gi...@apache.org>.
ryaninvoker commented on a change in pull request #219:
URL: https://github.com/apache/servicecomb-kie/pull/219#discussion_r725957028



##########
File path: server/pubsub/bus.go
##########
@@ -55,13 +56,16 @@ type Bus struct {
 func Init() {
 	once.Do(func() {
 		ac := agent.DefaultConfig()
+		sc := serf.DefaultConfig()
+		setSerfAdvertiseAddr(sc, ac.BindAddr)

Review comment:
       是的 经过测试 如果不设置serf的AdvertiseAddr 在部分linux机器上会出现找不到private ip的问题,默认设置为0.0.0.0,这个问题在其他使用过gossip的项目 例如alertmanager 也出现过,他们也是让给AdvertiseAddr 设置一个值来解决。




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] ryaninvoker commented on a change in pull request #219: 修复Linux 本地版Kie在部分机器上报找不到private ip的错误

Posted by GitBox <gi...@apache.org>.
ryaninvoker commented on a change in pull request #219:
URL: https://github.com/apache/servicecomb-kie/pull/219#discussion_r725963256



##########
File path: server/pubsub/bus.go
##########
@@ -55,13 +56,16 @@ type Bus struct {
 func Init() {
 	once.Do(func() {
 		ac := agent.DefaultConfig()
+		sc := serf.DefaultConfig()
+		setSerfAdvertiseAddr(sc, ac.BindAddr)
 		if config.Configurations.ListenPeerAddr != "" {
 			ac.BindAddr = config.Configurations.ListenPeerAddr
 		}
 		if config.Configurations.AdvertiseAddr != "" {
 			ac.AdvertiseAddr = config.Configurations.AdvertiseAddr
+			serfAdvertiseAddr := strings.Split(config.Configurations.AdvertiseAddr, ":")

Review comment:
       gossip会在FinalAdvertiseAddr()中调用net.ParseIP(ip)来解析 serf的advertiseAddr,他需要提供的是ip不是ip+port




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] little-cui commented on a change in pull request #219: 修复Linux 本地版Kie在部分机器上报找不到private ip的错误

Posted by GitBox <gi...@apache.org>.
little-cui commented on a change in pull request #219:
URL: https://github.com/apache/servicecomb-kie/pull/219#discussion_r725874912



##########
File path: server/config/struct.go
##########
@@ -19,14 +19,14 @@ package config
 
 //Config is yaml file struct
 type Config struct {
-	DB   DB   `yaml:"db"`
-	RBAC RBAC `yaml:"rbac"`
+	DB            DB     `yaml:"db"`
+	RBAC          RBAC   `yaml:"rbac"`
+	AdvertiseAddr string `yaml:"advertiseAddr"`

Review comment:
       使用cli方式注入




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] ryaninvoker commented on a change in pull request #219: 修复Linux 本地版Kie在部分机器上报找不到private ip的错误

Posted by GitBox <gi...@apache.org>.
ryaninvoker commented on a change in pull request #219:
URL: https://github.com/apache/servicecomb-kie/pull/219#discussion_r725957028



##########
File path: server/pubsub/bus.go
##########
@@ -55,13 +56,16 @@ type Bus struct {
 func Init() {
 	once.Do(func() {
 		ac := agent.DefaultConfig()
+		sc := serf.DefaultConfig()
+		setSerfAdvertiseAddr(sc, ac.BindAddr)

Review comment:
       是的 经过测试 如果不设置serf的Advertise 在部分linux机器上会出现找不到private ip的问题,默认设置为0.0.0.0




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] little-cui merged pull request #219: 修复Linux 本地版Kie在部分机器上报找不到private ip的错误

Posted by GitBox <gi...@apache.org>.
little-cui merged pull request #219:
URL: https://github.com/apache/servicecomb-kie/pull/219


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] ryaninvoker commented on a change in pull request #219: 修复Linux 本地版Kie在部分机器上报找不到private ip的错误

Posted by GitBox <gi...@apache.org>.
ryaninvoker commented on a change in pull request #219:
URL: https://github.com/apache/servicecomb-kie/pull/219#discussion_r725928704



##########
File path: server/config/struct.go
##########
@@ -19,14 +19,14 @@ package config
 
 //Config is yaml file struct
 type Config struct {
-	DB   DB   `yaml:"db"`
-	RBAC RBAC `yaml:"rbac"`
+	DB            DB     `yaml:"db"`
+	RBAC          RBAC   `yaml:"rbac"`
+	AdvertiseAddr string `yaml:"advertiseAddr"`

Review comment:
       已更新为按照cli配置advertiseAddr




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #219: 修复Linux 本地版Kie在部分机器上报找不到private ip的错误

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #219:
URL: https://github.com/apache/servicecomb-kie/pull/219#discussion_r725949984



##########
File path: server/pubsub/bus.go
##########
@@ -55,13 +56,16 @@ type Bus struct {
 func Init() {
 	once.Do(func() {
 		ac := agent.DefaultConfig()
+		sc := serf.DefaultConfig()
+		setSerfAdvertiseAddr(sc, ac.BindAddr)
 		if config.Configurations.ListenPeerAddr != "" {
 			ac.BindAddr = config.Configurations.ListenPeerAddr
 		}
 		if config.Configurations.AdvertiseAddr != "" {
 			ac.AdvertiseAddr = config.Configurations.AdvertiseAddr
+			serfAdvertiseAddr := strings.Split(config.Configurations.AdvertiseAddr, ":")

Review comment:
       为何split?参数内容是带port

##########
File path: server/pubsub/bus.go
##########
@@ -55,13 +56,16 @@ type Bus struct {
 func Init() {
 	once.Do(func() {
 		ac := agent.DefaultConfig()
+		sc := serf.DefaultConfig()
+		setSerfAdvertiseAddr(sc, ac.BindAddr)

Review comment:
       有必要设置默认值?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] robotLJW commented on a change in pull request #219: 修复Linux 本地版Kie在部分机器上报找不到private ip的错误

Posted by GitBox <gi...@apache.org>.
robotLJW commented on a change in pull request #219:
URL: https://github.com/apache/servicecomb-kie/pull/219#discussion_r725880671



##########
File path: server/resource/v1/kv_resource_test.go
##########
@@ -67,7 +67,7 @@ func init() {
 	config.Configurations = &config.Config{
 		DB:             config.DB{},
 		ListenPeerAddr: "127.0.0.1:4000",
-		AdvertiseAddr:  "127.0.0.1:4000",
+		AdvertiseAddr:  "127.0.0.1",

Review comment:
       为什么4000这个端口要删除




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] tianxiaoliang commented on pull request #219: 修复Linux 本地版Kie在部分机器上报找不到private ip的错误

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on pull request #219:
URL: https://github.com/apache/servicecomb-kie/pull/219#issuecomment-940864678


   提供配套文档


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org