From dfa20538f43ac5e978acbe9df67cf46bdfe6cd23 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Sat, 11 May 2024 12:03:29 +0800 Subject: [PATCH] add etcd --- config/discovery.yml | 7 +++++-- pkg/common/discoveryregister/discoveryregister.go | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/config/discovery.yml b/config/discovery.yml index 3d96ff9b6..6e0922ede 100644 --- a/config/discovery.yml +++ b/config/discovery.yml @@ -1,13 +1,16 @@ + enable: "etcd" etcd: - rootDirectory: openim - address: [ localhost:12379 ] + schema: openim + address: [ http://localhost:2379 ] username: '' password: '' + zookeeper: schema: openim address: [ localhost:12181 ] username: '' password: '' + diff --git a/pkg/common/discoveryregister/discoveryregister.go b/pkg/common/discoveryregister/discoveryregister.go index c2deb6cf2..dbf16eda0 100644 --- a/pkg/common/discoveryregister/discoveryregister.go +++ b/pkg/common/discoveryregister/discoveryregister.go @@ -46,7 +46,7 @@ func NewDiscoveryRegister(zookeeperConfig *config.ZooKeeper, share *config.Share case kubenetesConst: return kubernetes.NewK8sDiscoveryRegister(share.RpcRegisterName.MessageGateway) case etcdConst: - return getcd.NewSvcDiscoveryRegistry("etcd", []string{"http://localhost:2379"}) + return getcd.NewSvcDiscoveryRegistry("etcd", []string{"localhost:2379"}) case directConst: //return direct.NewConnDirect(config) default: