mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-25 20:52:11 +08:00
Merge remote-tracking branch 'origin/main'
# Conflicts: # config/config.yaml
This commit is contained in:
commit
43dfd3eab6
37
.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md
vendored
Normal file
37
.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
name: 🐞 Bug
|
||||
about: File a bug/issue
|
||||
title: '[BUG] <title>'
|
||||
labels: Bug, Needs Triage
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Note: Please search to see if an issue already exists for the bug you encountered.
|
||||
-->
|
||||
|
||||
### Environment:
|
||||
<!-- linux? windows? or Mac?
|
||||
Example:
|
||||
- OS: Ubuntu 20.04 -->
|
||||
|
||||
### Physical Memory Capacity:
|
||||
<!-- 8G or above is better -->
|
||||
|
||||
### Docker Image:
|
||||
<!-- Did you pull the docker image before execute docker images -->
|
||||
|
||||
### Code Version:
|
||||
<!-- Did you pull code from github? Make sure the code is up to date-->
|
||||
|
||||
### 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. -->
|
||||
|
||||
|
||||
### screenshot:
|
||||
<!---->
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,6 +4,6 @@ logs
|
||||
components
|
||||
logs
|
||||
out-test
|
||||
.github
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
```
|
||||
|
||||

|
||||
|
||||
@ -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
|
||||
@ -17,18 +18,23 @@ services:
|
||||
mongodb:
|
||||
image: mongo:4.0
|
||||
ports:
|
||||
- 27017:27017
|
||||
- 37017:27017
|
||||
container_name: mongo
|
||||
volumes:
|
||||
- ./components/mongodb/data:/data/db
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
- ./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
|
||||
|
||||
#TZ: Asia/Shanghai
|
||||
restart: always
|
||||
|
||||
redis:
|
||||
image: redis
|
||||
ports:
|
||||
- 6379:6379
|
||||
- 16379:6379
|
||||
container_name: redis
|
||||
volumes:
|
||||
- ./components/redis/data:/data
|
||||
@ -82,38 +88,15 @@ 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:v1.0.5
|
||||
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
|
||||
- ./script:/Open-IM-Server/script
|
||||
|
||||
restart: always
|
||||
depends_on:
|
||||
- kafka
|
||||
|
||||
11
script/build_image.sh
Normal file
11
script/build_image.sh
Normal file
@ -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
|
||||
@ -1,33 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
echo "docker-compose ps..........................."
|
||||
docker-compose ps
|
||||
|
||||
source ./style_info.cfg
|
||||
sleep 20
|
||||
|
||||
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
|
||||
|
||||
@ -1,24 +1,11 @@
|
||||
#!/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
|
||||
|
||||
#fixme prevents the openIM service exit after execution in the docker container
|
||||
tail -f /dev/null
|
||||
|
||||
20
script/env_check.sh
Normal file
20
script/env_check.sh
Normal file
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user