Skip to content

Commit

Permalink
etcd naming and discovery 539 (#544)
Browse files Browse the repository at this point in the history
* etcd naming and discovery

* etcd naming and discovery

* etcd naming and discovery

* etcd naming and discovery

* etcd naming and discovery

* etcd naming and discovery

* etcd naming and discovery

* etcd naming and discovery

* etcd naming and discovery

* etcd naming and discovery

* etcd naming and discovery

* etcd naming and discovery

* merge

* merge

* merge

* merge

* merge
  • Loading branch information
skiffer-git committed May 23, 2024
1 parent 275fca3 commit 26416d2
Show file tree
Hide file tree
Showing 21 changed files with 168 additions and 116 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/
COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/
COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/

RUN go get github.com/openimsdk/[email protected].9
RUN go get github.com/openimsdk/[email protected].13

# Set the command to run when the container starts
ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"]
13 changes: 13 additions & 0 deletions config/discovery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
enable: "etcd"
etcd:
rootDirectory: openim
address: [ localhost:12379 ]
username: ''
password: ''

zookeeper:
schema: openim
address: [ localhost:12181 ]
username: ''
password: ''

8 changes: 0 additions & 8 deletions config/zookeeper.yml

This file was deleted.

49 changes: 23 additions & 26 deletions deployments/helm-charts/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ config:
listenIP:

rpc:
registerIP: #作为rpc启动时,注册到zookeeper的IP,api/gateway能访问到此ip和对应的rpcPort中的端口
listenIP: #默认为0.0.0.0
registerIP:
listenIP:

rpcPort:
openImAdminPort: [ 80 ]
Expand All @@ -61,25 +61,23 @@ config:
openImAdminName: openimchat-admin-rpc:80
openImChatName: openimchat-chat-rpc:80

# 没有配置表示和OpenIM一致
mysql:
address: [ im-mysql:3306 ] #目前仅支持单机
username: root #用户名
password: openIM123 #密码
#database: openIM_v2 #不建议修改
maxOpenConn: 1000 #最大连接数
maxIdleConn: 100 #最大空闲连接数
maxLifeTime: 60 #连接可以重复使用的最长时间(秒)
logLevel: 4 #日志级别 1=slient 2=error 3=warn 4=info
slowThreshold: 500 #慢语句阈值 (毫秒)
address: [ im-mysql:3306 ]
username: root
password: openIM123
#database: openIM_v2
maxOpenConn: 1000
maxIdleConn: 100
maxLifeTime: 60
logLevel: 4
slowThreshold: 500
database: openim_enterprise

# 没有配置表示和OpenIM一致
log:
storageLocation: ../_output/logs/ #存放目录
rotationTime: 24 #日志旋转时间
remainRotationCount: 2 #日志数量
remainLogLevel: 6 #日志级别 6表示全都打印,
storageLocation: ../_output/logs/
rotationTime: 24
remainRotationCount: 2
remainLogLevel: 6
isStdout: true
isJson: false
withStack: false
Expand All @@ -91,22 +89,21 @@ config:
expire: 86400

verifyCode:
validTime: 300 # 验证码有效时间
validCount: 5 # 验证码有效次数
uintTime: 86400 # 单位时间间隔
maxCount: 10 # 单位时间内最大获取次数
superCode: "666666" # 超级验证码(只有use为空时使用)
len: 6 # 验证码长度
use: "" # 使用的验证码服务(use: "ali")
validTime: 300
validCount: 5
uintTime: 86400
maxCount: 10
superCode: "666666"
len: 6
use: ""
ali:
endpoint: "dysmsapi.aliyuncs.com"
accessKeyId: ""
accessKeySecret: ""
signName: ""
verificationCodeTemplateCode: ""

# 获取ip的header,没有配置直接获取远程地址
#proxyHeader: "X-Forwarded-For"


adminList:
- adminID: admin1
Expand Down
14 changes: 11 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21.2
require (
github.com/gin-gonic/gin v1.9.1
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/uuid v1.6.0
github.com/jinzhu/copier v0.4.0 // indirect
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect
Expand All @@ -25,9 +25,9 @@ require (
require (
github.com/livekit/protocol v1.10.1
github.com/mitchellh/mapstructure v1.5.0
github.com/openimsdk/gomake v0.0.9
github.com/openimsdk/gomake v0.0.13
github.com/openimsdk/protocol v0.0.63
github.com/openimsdk/tools v0.0.49-alpha.3
github.com/openimsdk/tools v0.0.49-alpha.18
github.com/redis/go-redis/v9 v9.5.1
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.18.2
Expand All @@ -48,6 +48,8 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/clbanning/mxj/v2 v2.5.6 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
Expand All @@ -59,6 +61,7 @@ require (
github.com/go-playground/validator/v10 v10.18.0 // indirect
github.com/go-zookeeper/zk v1.0.3 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand Down Expand Up @@ -100,6 +103,9 @@ require (
github.com/xuri/nfp v0.0.0-20230819163627-dc951e3ffe1a // indirect
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.etcd.io/etcd/api/v3 v3.5.13 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.13 // indirect
go.etcd.io/etcd/client/v3 v3.5.13 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/arch v0.3.0 // indirect
Expand All @@ -109,6 +115,8 @@ require (
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
Expand Down
Loading

0 comments on commit 26416d2

Please sign in to comment.