From dd5a6aeee9c2fbc9887660fda6b98df1dcf2d4a8 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Mon, 22 Nov 2021 20:54:36 +0800 Subject: [PATCH 01/23] configure update --- config/config.yaml | 17 ++++++++------- docker-compose.yaml | 51 ++++++++++++++------------------------------- 2 files changed, 26 insertions(+), 42 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 9f7969466..05159f0b9 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -1,14 +1,14 @@ # The class cannot be named by Pascal or camel case. # If it is not used, the corresponding structure will not be set, # and it will not be read naturally. -serverversion: 1.0.2 +serverversion: 1.0.3 #---------------Infrastructure configuration---------------------# etcd: etcdSchema: openIM etcdAddr: [ 127.0.0.1:2379 ] mysql: - dbMysqlAddress: [ 127.0.0.1:3306 ] + dbMysqlAddress: [ 127.0.0.1:13306 ] dbMysqlUserName: root dbMysqlPassword: openIM dbMysqlDatabaseName: openIM @@ -19,18 +19,18 @@ mysql: dbMaxLifeTime: 120 mongo: - dbAddress: [ 127.0.0.1:27017 ] + dbAddress: [ 127.0.0.1:37017 ] dbDirect: false dbTimeout: 10 dbDatabase: openIM dbSource: admin - dbUserName: - dbPassword: + dbUserName: openIM + dbPassword: openIM dbMaxPoolSize: 20 dbRetainChatRecords: 7 redis: - dbAddress: 127.0.0.1:6379 + dbAddress: 127.0.0.1:16379 dbMaxIdle: 128 dbMaxActive: 0 dbIdleTimeout: 120 @@ -123,6 +123,7 @@ push: appKey: cf47465a368f24c659608e7e masterSecret: 02204efe3f3832947a236ee5 pushUrl: "https://api.jpush.cn/v3/push" + pushIntent: "intent:#Intent;component=io.openim.app.enterprisechat/io.openim.app.enterprisechat.MainActivity;end" manager: appManagerUid: ["openIM123456","openIM654321"] secrets: ["openIM1","openIM2"] @@ -142,4 +143,6 @@ tokenpolicy: messagecallback: callbackSwitch: false - callbackUrl: "http://www.xxx.com/msg/judge" \ No newline at end of file + callbackUrl: "http://www.xxx.com/msg/judge" + #TimeOut use second as unit + callbackTimeOut: 10 diff --git a/docker-compose.yaml b/docker-compose.yaml index 1d64dcd9f..cbdc6a27b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,7 +5,8 @@ services: mysql: image: mysql:5.7 ports: - - 3306:3306 + - 13306:3306 + - 23306:33060 container_name: mysql volumes: - ./components/mysql/data:/var/lib/mysql @@ -15,20 +16,25 @@ services: restart: always mongodb: - image: mongo:4.0 + image: mongo:5.0 ports: - - 27017:27017 + - 37017:27017 container_name: mongo volumes: - - ./components/mongodb/data:/data/db + - ./components/mongodb/data/db:/data/db + - ./components/mongodb/data/logs:/data/logs + - ./components/mongodb/data/conf:/etc/mongo environment: - TZ: Asia/Shanghai + - MONGO_INITDB_ROOT_USERNAME=openIM + - MONGO_INITDB_ROOT_PASSWORD=openIM + + #TZ: Asia/Shanghai restart: always redis: image: redis ports: - - 6379:6379 + - 16379:6379 container_name: redis volumes: - ./components/redis/data:/data @@ -82,38 +88,13 @@ services: restart: always command: /usr/local/bin/etcd --name etcd0 --data-dir /etcd-data --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379 --listen-peer-urls http://0.0.0.0:2380 --initial-advertise-peer-urls http://0.0.0.0:2380 --initial-cluster etcd0=http://0.0.0.0:2380 --initial-cluster-token tkn --initial-cluster-state new - - #fixme-----build from dockerfile--------- - # open-im-server: - # image: open_im_server - # container_name: open-im-server - # volumes: - # - ./logs:/Open-IM-Server/logs - # - ./config/config.yaml:/Open-IM-Server/config/config.yaml - # restart: always - # build: - # context: . - # dockerfile: deploy.Dockerfile - # depends_on: - # - mysql - # - mongodb - # - redis - # - kafka - # - etcd - # network_mode: "host" - # logging: - # driver: json-file - # options: - # max-size: "1g" - # max-file: "2" - - #fixme----build from docker hub------ - open-im-server: - image: lyt1123/open_im_server - container_name: open-im-server + open_im_server: + image: openim/open_im_server + container_name: open_im_server volumes: - ./logs:/Open-IM-Server/logs - ./config/config.yaml:/Open-IM-Server/config/config.yaml + - ./db/sdk:/Open-IM-Server/db/sdk restart: always depends_on: - kafka From c678e25071130d0726d84fc3b8e8ad9f6785fff0 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 23 Nov 2021 08:49:40 +0800 Subject: [PATCH 02/23] mongo:4.0 --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index cbdc6a27b..75ffcabea 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -16,7 +16,7 @@ services: restart: always mongodb: - image: mongo:5.0 + image: mongo:4.0 ports: - 37017:27017 container_name: mongo From befad40c8c696d274d98e5c89feeb4c7a7a82585 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 23 Nov 2021 10:46:11 +0800 Subject: [PATCH 03/23] open-im-server -> open_im_server --- script/docker_check_service.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/docker_check_service.sh b/script/docker_check_service.sh index e380cb3fb..c987f3d8b 100644 --- a/script/docker_check_service.sh +++ b/script/docker_check_service.sh @@ -6,7 +6,7 @@ docker_compose_components=( etcd mongo mysql - open-im-server + open_im_server redis kafka zookeeper From 2619495a4db01a66d3d68a1dc58a8c20759007b6 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 23 Nov 2021 15:31:13 +0800 Subject: [PATCH 04/23] sleep 15 --- script/docker_start_all.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script/docker_start_all.sh b/script/docker_start_all.sh index 839a46688..143accb88 100644 --- a/script/docker_start_all.sh +++ b/script/docker_start_all.sh @@ -12,13 +12,14 @@ need_to_start_server_shell=( timer_start.sh ) -#fixme The 10 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started -sleep 10 for i in ${need_to_start_server_shell[*]}; do chmod +x $i ./$i done +#fixme The 15 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started +sleep 15 + #fixme prevents the openIM service exit after execution in the docker container tail -f /dev/null From 589c3ebf8956e43fbe3742b3c255666566ffa985 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Wed, 24 Nov 2021 09:50:38 +0800 Subject: [PATCH 05/23] 0.0.0.0 --- config/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.yaml b/config/config.yaml index 05159f0b9..5ac564915 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -57,7 +57,7 @@ kafka: # otherwise the configuration ip is preferred serverip: -api: +api: 0.0.0.0 openImApiPort: [ 10000 ] sdk: openImSdkWsPort: [ 30000 ] From 99da85a39c1016ac0b8229d5f2395a01ef45848c Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Wed, 24 Nov 2021 10:10:40 +0800 Subject: [PATCH 06/23] sleep 10 15 --- docker-compose.yaml | 2 ++ script/docker_start_all.sh | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 75ffcabea..07b52e51b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -95,6 +95,8 @@ services: - ./logs:/Open-IM-Server/logs - ./config/config.yaml:/Open-IM-Server/config/config.yaml - ./db/sdk:/Open-IM-Server/db/sdk + - ./script:/Open-IM-Server/script + restart: always depends_on: - kafka diff --git a/script/docker_start_all.sh b/script/docker_start_all.sh index 143accb88..5d0c19b2e 100644 --- a/script/docker_start_all.sh +++ b/script/docker_start_all.sh @@ -12,13 +12,14 @@ need_to_start_server_shell=( timer_start.sh ) +#fixme The 10 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started +sleep 10 for i in ${need_to_start_server_shell[*]}; do chmod +x $i ./$i done -#fixme The 15 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started sleep 15 #fixme prevents the openIM service exit after execution in the docker container From 355c9adda10c45fe7c96ab30e679899b413c4d53 Mon Sep 17 00:00:00 2001 From: skiffer-git <72860476+skiffer-git@users.noreply.github.com> Date: Thu, 25 Nov 2021 13:58:06 +0800 Subject: [PATCH 07/23] Update config.yaml --- config/config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 5ac564915..51d6451b8 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -55,9 +55,9 @@ kafka: # The service ip default is empty, # automatically obtain the machine's valid network card ip as the service ip, # otherwise the configuration ip is preferred -serverip: +serverip: 0.0.0.0 -api: 0.0.0.0 +api: openImApiPort: [ 10000 ] sdk: openImSdkWsPort: [ 30000 ] From a90f01a24ebe040b21088ca5be471e2178764d40 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Thu, 25 Nov 2021 17:07:31 +0800 Subject: [PATCH 08/23] config --- config/config.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 51d6451b8..218281af3 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -130,10 +130,7 @@ manager: secret: tuoyun -multiloginpolicy: - onlyOneTerminalAccess: false - mobileAndPCTerminalAccessButOtherTerminalKickEachOther: true - allTerminalAccess: false +multiloginpolicy: 1 #token config tokenpolicy: From 06e37617ab9327c248d95c804c30f05051f8ad58 Mon Sep 17 00:00:00 2001 From: skiffer-git <72860476+skiffer-git@users.noreply.github.com> Date: Thu, 25 Nov 2021 19:15:17 +0800 Subject: [PATCH 09/23] Update docker-compose.yaml --- docker-compose.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 07b52e51b..cff7a21be 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -24,9 +24,9 @@ services: - ./components/mongodb/data/db:/data/db - ./components/mongodb/data/logs:/data/logs - ./components/mongodb/data/conf:/etc/mongo - environment: - - MONGO_INITDB_ROOT_USERNAME=openIM - - MONGO_INITDB_ROOT_PASSWORD=openIM + # environment: + # - MONGO_INITDB_ROOT_USERNAME=openIM + # - MONGO_INITDB_ROOT_PASSWORD=openIM #TZ: Asia/Shanghai restart: always From e4c0c68c3428eb163eba2e4a1ad09cfd75dcea3c Mon Sep 17 00:00:00 2001 From: skiffer-git <72860476+skiffer-git@users.noreply.github.com> Date: Thu, 25 Nov 2021 19:16:41 +0800 Subject: [PATCH 10/23] Update config.yaml --- config/config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 218281af3..5441dd383 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -24,8 +24,8 @@ mongo: dbTimeout: 10 dbDatabase: openIM dbSource: admin - dbUserName: openIM - dbPassword: openIM + dbUserName: + dbPassword: dbMaxPoolSize: 20 dbRetainChatRecords: 7 From 4eb799ddaa76cdf75a703ee4c65ab09b0d9aa0b7 Mon Sep 17 00:00:00 2001 From: skiffer-git <72860476+skiffer-git@users.noreply.github.com> Date: Fri, 26 Nov 2021 12:11:49 +0800 Subject: [PATCH 11/23] Create ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..c6a998ef8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,35 @@ + + + +### Environment +- [x] Autosize Version: +- [x] Target Android Version: +- [x] Device Model: +- [x] Device Resolution: +- [x] Design Size On AndroidManifest: + + +### Bug Description: + + + +### Log: + +```log + + +``` + + +### Screenshot + + + +### Related Code: +```java + + +``` + + +### Others: From 55217e5a61089af4b5129ca275d98f3d891c09f0 Mon Sep 17 00:00:00 2001 From: skiffer-git <72860476+skiffer-git@users.noreply.github.com> Date: Fri, 26 Nov 2021 12:14:36 +0800 Subject: [PATCH 12/23] Update ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 75 +++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index c6a998ef8..f23d7530d 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,35 +1,40 @@ - - - -### Environment -- [x] Autosize Version: -- [x] Target Android Version: -- [x] Device Model: -- [x] Device Resolution: -- [x] Design Size On AndroidManifest: - - -### Bug Description: - - - -### Log: - -```log - - -``` - - -### Screenshot - - - -### Related Code: -```java - - -``` - - -### Others: +--- +name: 🐞 Bug +about: File a bug/issue +title: '[BUG] ' +labels: Bug, Needs Triage +assignees: '' + +--- + +<!-- +Note: Please search to see if an issue already exists for the bug you encountered. +--> + +### Current Behavior: +<!-- A concise description of what you're experiencing. --> + +### Expected Behavior: +<!-- A concise description of what you expected to happen. --> + +### Steps To Reproduce: +<!-- +Example: steps to reproduce the behavior: +1. In this environment... +2. With this config... +3. Run '...' +4. See error... +--> + +### Environment: +<!-- +Example: +- OS: Ubuntu 20.04 +- Node: 13.14.0 +- npm: 7.6.3 +--> + +### Anything else: +<!-- +Links? References? Anything that will give us more context about the issue that you are encountering! +--> From 82b4bec6ec08fb293efbca41bea526717c9e9ccc Mon Sep 17 00:00:00 2001 From: skiffer-git <72860476+skiffer-git@users.noreply.github.com> Date: Fri, 26 Nov 2021 12:20:32 +0800 Subject: [PATCH 13/23] Create ISSUE_TEMPLATE --- .github/ISSUE_TEMPLATE | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/ISSUE_TEMPLATE diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/.github/ISSUE_TEMPLATE @@ -0,0 +1 @@ + From 7cb5e5bcd4c3ea2e6ca510a9ee612324f33e32b9 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Fri, 26 Nov 2021 12:28:13 +0800 Subject: [PATCH 14/23] add issue template --- .github/ISSUE_TEMPLATE | 1 - .github/{ => workflows/ISSUE_TEMPLATE}/ISSUE_TEMPLATE.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE rename .github/{ => workflows/ISSUE_TEMPLATE}/ISSUE_TEMPLATE.md (99%) diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE deleted file mode 100644 index 8b1378917..000000000 --- a/.github/ISSUE_TEMPLATE +++ /dev/null @@ -1 +0,0 @@ - diff --git a/.github/ISSUE_TEMPLATE.md b/.github/workflows/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md similarity index 99% rename from .github/ISSUE_TEMPLATE.md rename to .github/workflows/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md index f23d7530d..a5c7ea33d 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/workflows/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md @@ -37,4 +37,4 @@ Example: ### Anything else: <!-- Links? References? Anything that will give us more context about the issue that you are encountering! ---> +--> \ No newline at end of file From 9581b71f38d15e5afe83fdcbccde09443f1b9128 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Fri, 26 Nov 2021 13:07:37 +0800 Subject: [PATCH 15/23] add issue template --- .github/{workflows => }/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md | 0 .gitignore | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/{workflows => }/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md (100%) diff --git a/.github/workflows/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md similarity index 100% rename from .github/workflows/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md rename to .github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md diff --git a/.gitignore b/.gitignore index 532c7da35..3d19cc7b8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,6 @@ logs components logs out-test -.github + From cc0e280ec07e3f6010a02b8467e50b74ffb27087 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Fri, 26 Nov 2021 13:50:39 +0800 Subject: [PATCH 16/23] add issue template --- .github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md | 43 +++++++++++------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md index a5c7ea33d..95ec6b3a2 100644 --- a/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md @@ -11,30 +11,27 @@ assignees: '' Note: Please search to see if an issue already exists for the bug you encountered. --> -### Current Behavior: -<!-- A concise description of what you're experiencing. --> +### Environment: +<!-- linux? windows? or Mac? +Example: +- OS: Ubuntu 20.04 --> -### Expected Behavior: -<!-- A concise description of what you expected to happen. --> +### Physical Memory Capacity: +<!-- 8G or above is better --> -### Steps To Reproduce: -<!-- -Example: steps to reproduce the behavior: -1. In this environment... -2. With this config... -3. Run '...' -4. See error... ---> +### Docker Image: +<!-- Did you pull the docker image before execute docker images --> -### Environment: -<!-- -Example: -- OS: Ubuntu 20.04 -- Node: 13.14.0 -- npm: 7.6.3 ---> +### Code Version: +<!-- Did you pull code from github? Make sure the code is up to date--> -### Anything else: -<!-- -Links? References? Anything that will give us more context about the issue that you are encountering! ---> \ No newline at end of file +### Component installation: +<!-- Has etcd, mysql, mongodb, redis or Kafka been installed on the server before Open-IM-Server deployment--> + + +### Log File: +<!-- view log file(logs/openIM.log) content. --> + + +### Anything else screenshot: +<!----> \ No newline at end of file From 863d26477f6513751007d85decc9c0e2faaec073 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Fri, 26 Nov 2021 13:51:26 +0800 Subject: [PATCH 17/23] add issue template --- .github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md index 95ec6b3a2..15fe98c2c 100644 --- a/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md @@ -33,5 +33,5 @@ Example: <!-- view log file(logs/openIM.log) content. --> -### Anything else screenshot: +### screenshot: <!----> \ No newline at end of file From 2f529cfc0e0c75c56fea79ff1810a2890f4deee9 Mon Sep 17 00:00:00 2001 From: skiffer-git <72860476+skiffer-git@users.noreply.github.com> Date: Fri, 26 Nov 2021 17:13:16 +0800 Subject: [PATCH 18/23] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ad3aa2129..4964bacb5 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ All images are available at https://hub.docker.com/r/lyt1123/open_im_server 4. Start docker-compose with one click(Docker automatically pulls all images) ``` + cd Open-IM-Server docker-compose up -d ``` @@ -99,6 +100,7 @@ All images are available at https://hub.docker.com/r/lyt1123/open_im_server ``` ./docker_check_service.sh + ./check_all.sh ``` ![OpenIMServersondockerpng](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/Open-IM-Servers-on-docker.png) From c4d84fb6288e417eee6f2f042c27f11f888d04fe Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Wed, 1 Dec 2021 12:06:21 +0800 Subject: [PATCH 19/23] script --- script/env_check.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 script/env_check.sh diff --git a/script/env_check.sh b/script/env_check.sh new file mode 100644 index 000000000..6af30a37b --- /dev/null +++ b/script/env_check.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +source ./style_info.cfg +echo -e "check environment......................................." + +SYSTEM=`uname -s` +if [ $SYSTEM != "Linux" ] ; then + echo -e ${RED_PREFIX}"Warning: Currently only Linux is supported"${COLOR_SUFFIX} +else + echo -e ${GREEN_PREFIX} "Linux system is ok"${COLOR_SUFFIX} +fi + +echo -e "check memory............................................" +available=`free -m | grep Mem | awk '{print $NF}'` +if [ $available -lt 2000 ] ; then + echo -e ${RED_PREFIX}"Warning: Your memory not enough, available is: " "$available"m${COLOR_SUFFIX}"\c" + echo -e ${RED_PREFIX}", must be greater than 2000m"${COLOR_SUFFIX} +else + echo -e ${GREEN_PREFIX} "Memory is ok, available is: "$available"m${COLOR_SUFFIX}" +fi + From efc08efa3471e904ef7571c99e006c87aadd1ffb Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Wed, 1 Dec 2021 13:57:28 +0800 Subject: [PATCH 20/23] script --- script/docker_check_service.sh | 34 +++++----------------------------- script/docker_start_all.sh | 17 +---------------- 2 files changed, 6 insertions(+), 45 deletions(-) diff --git a/script/docker_check_service.sh b/script/docker_check_service.sh index c987f3d8b..f65dda3cc 100644 --- a/script/docker_check_service.sh +++ b/script/docker_check_service.sh @@ -1,33 +1,9 @@ #!/usr/bin/env bash +echo "docker-compose ps....................." +docker-compose ps -source ./style_info.cfg +sleep 10 -docker_compose_components=( - etcd - mongo - mysql - open_im_server - redis - kafka - zookeeper -) +echo "check OpenIM.........................." +./check_all.sh -component_server_count=0 - -for ((i = 0; i < ${#docker_compose_components[*]}; i++)); do - component_server="docker-compose ps|grep -w ${docker_compose_components[$i]}|grep Up" - count="${component_server}|wc -l" - - if [ $(eval ${count}) -gt 0 ]; then - echo -e "${SKY_BLUE_PREFIX}docker-compose ${docker_compose_components[$i]} is Up!${COLOR_SUFFIX}" - let component_server_count+=1 - else - echo -e "${RED_PREFIX} ${docker_compose_components[$i]} start failed!${COLOR_SUFFIX}" - fi -done - -if [ ${component_server_count} -eq 7 ]; then - echo -e "${YELLOW_PREFIX}\ndocker-compose all services is Up!${COLOR_SUFFIX}" -else - echo -e "${RED_PREFIX}\nsome docker-compose services start failed,please check red logs on console ${COLOR_SUFFIX}" -fi diff --git a/script/docker_start_all.sh b/script/docker_start_all.sh index 5d0c19b2e..f1a1fd859 100644 --- a/script/docker_start_all.sh +++ b/script/docker_start_all.sh @@ -1,24 +1,9 @@ #!/usr/bin/env bash -#fixme This script is the total startup script -#fixme The full name of the shell script that needs to be started is placed in the need_to_start_server_shell array - -#fixme Put the shell script name here -need_to_start_server_shell=( - start_rpc_service.sh - msg_gateway_start.sh - push_start.sh - msg_transfer_start.sh - sdk_svr_start.sh - timer_start.sh -) #fixme The 10 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started sleep 10 -for i in ${need_to_start_server_shell[*]}; do - chmod +x $i - ./$i -done +./start_all.sh sleep 15 From efda5fec63d078549b479cc152525aa099dcaf5a Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Wed, 1 Dec 2021 14:25:30 +0800 Subject: [PATCH 21/23] script --- script/start_rpc_service.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/start_rpc_service.sh b/script/start_rpc_service.sh index 9491a4fe8..5b59107d5 100644 --- a/script/start_rpc_service.sh +++ b/script/start_rpc_service.sh @@ -53,6 +53,6 @@ for ((i = 0; i < ${#service_filename[*]}; i++)); do nohup ./${service_filename[$i]} -port $j >>../logs/openIM.log 2>&1 & sleep 1 pid="netstat -ntlp|grep $j |awk '{printf \$7}'|cut -d/ -f1" - echo -e "${RED_PREFIX}${service_filename[$i]} Service is started,port number:$j pid:$(eval $pid)$COLOR_SUFFIX" + # echo -e "${RED_PREFIX}${service_filename[$i]} Service is started,port number:$j pid:$(eval $pid)$COLOR_SUFFIX" done done From 4f4b0d9e32432ec012dce7b01f93efd7e79c67f3 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Wed, 1 Dec 2021 14:38:19 +0800 Subject: [PATCH 22/23] config --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index cff7a21be..7e58df7af 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -89,7 +89,7 @@ services: command: /usr/local/bin/etcd --name etcd0 --data-dir /etcd-data --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379 --listen-peer-urls http://0.0.0.0:2380 --initial-advertise-peer-urls http://0.0.0.0:2380 --initial-cluster etcd0=http://0.0.0.0:2380 --initial-cluster-token tkn --initial-cluster-state new open_im_server: - image: openim/open_im_server + image: openim/open_im_server:v1.0.5 container_name: open_im_server volumes: - ./logs:/Open-IM-Server/logs From e6f73d7946fb7ecd63a5c86d1c8c55194b31b289 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Wed, 1 Dec 2021 14:52:28 +0800 Subject: [PATCH 23/23] script --- script/build_image.sh | 11 +++++++++++ script/docker_check_service.sh | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 script/build_image.sh diff --git a/script/build_image.sh b/script/build_image.sh new file mode 100644 index 000000000..ad37e24e4 --- /dev/null +++ b/script/build_image.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +image=openim/open_im_server:v1.0.5 +rm Open-IM-Server -rf +git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive +cd Open-IM-Server +git checkout tuoyun +cd cmd/Open-IM-SDK-Core/ +git checkout tuoyun +cd ../../ +docker build -t $image . -f deploy.Dockerfile +docker push $image \ No newline at end of file diff --git a/script/docker_check_service.sh b/script/docker_check_service.sh index f65dda3cc..3484c458d 100644 --- a/script/docker_check_service.sh +++ b/script/docker_check_service.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash -echo "docker-compose ps....................." +echo "docker-compose ps..........................." docker-compose ps -sleep 10 +sleep 20 -echo "check OpenIM.........................." +echo "check OpenIM................................." ./check_all.sh