mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Update README.md (#30)
* Update README.md * Add files via upload update config * Add files via upload update script
This commit is contained in:
parent
7c3aa7ee0b
commit
37a8ddbae6
146
docs/config.yaml
Normal file
146
docs/config.yaml
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
# 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.0
|
||||||
|
#---------------Infrastructure configuration---------------------#
|
||||||
|
etcd:
|
||||||
|
etcdSchema: openIM
|
||||||
|
etcdAddr: [ 127.0.0.1:2379 ]
|
||||||
|
|
||||||
|
mysql:
|
||||||
|
dbMysqlAddress: [ 127.0.0.1:3306 ]
|
||||||
|
dbMysqlUserName: root
|
||||||
|
dbMysqlPassword: openIM
|
||||||
|
dbMysqlDatabaseName: openIM
|
||||||
|
dbTableName: eMsg
|
||||||
|
dbMsgTableNum: 1
|
||||||
|
dbMaxOpenConns: 20
|
||||||
|
dbMaxIdleConns: 10
|
||||||
|
dbMaxLifeTime: 120
|
||||||
|
|
||||||
|
mongo:
|
||||||
|
dbAddress: [ 127.0.0.1:27017 ]
|
||||||
|
dbDirect: false
|
||||||
|
dbTimeout: 10
|
||||||
|
dbDatabase: openIM
|
||||||
|
dbSource: admin
|
||||||
|
dbUserName:
|
||||||
|
dbPassword:
|
||||||
|
dbMaxPoolSize: 20
|
||||||
|
dbRetainChatRecords: 7
|
||||||
|
|
||||||
|
redis:
|
||||||
|
dbAddress: 127.0.0.1:6379
|
||||||
|
dbMaxIdle: 128
|
||||||
|
dbMaxActive: 0
|
||||||
|
dbIdleTimeout: 120
|
||||||
|
dbPassWord: openIM
|
||||||
|
|
||||||
|
kafka:
|
||||||
|
ws2mschat:
|
||||||
|
addr: [ 127.0.0.1:9092 ]
|
||||||
|
topic: "ws2ms_chat"
|
||||||
|
ms2pschat:
|
||||||
|
addr: [ 127.0.0.1:9092 ]
|
||||||
|
topic: "ms2ps_chat"
|
||||||
|
consumergroupid:
|
||||||
|
msgToMongo: mongo
|
||||||
|
msgToMySql: mysql
|
||||||
|
msgToPush: push
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#---------------Internal service configuration---------------------#
|
||||||
|
|
||||||
|
# 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:
|
||||||
|
|
||||||
|
api:
|
||||||
|
openImApiPort: [ 10000 ]
|
||||||
|
sdk:
|
||||||
|
openImSdkWsPort: [ 30000 ]
|
||||||
|
|
||||||
|
credential:
|
||||||
|
tencent:
|
||||||
|
appID: 1302656840
|
||||||
|
region: ap-chengdu
|
||||||
|
bucket: echat-1302656840
|
||||||
|
secretID: AKIDGNYVChzIQinu7QEgtNp0hnNgqcV8vZTC
|
||||||
|
secretKey: kz15vW83qM6dBUWIq681eBZA0c0vlIbe
|
||||||
|
|
||||||
|
|
||||||
|
rpcport:
|
||||||
|
openImUserPort: [ 10100 ]
|
||||||
|
openImFriendPort: [ 10200 ]
|
||||||
|
openImOfflineMessagePort: [ 10300 ]
|
||||||
|
openImOnlineRelayPort: [ 10400 ]
|
||||||
|
openImGroupPort: [ 10500 ]
|
||||||
|
openImAuthPort: [ 10600 ]
|
||||||
|
openImPushPort: [ 10700 ]
|
||||||
|
|
||||||
|
|
||||||
|
rpcregistername:
|
||||||
|
openImUserName: User
|
||||||
|
openImFriendName: Friend
|
||||||
|
openImOfflineMessageName: OfflineMessage
|
||||||
|
openImPushName: Push
|
||||||
|
openImOnlineMessageRelayName: OnlineMessageRelay
|
||||||
|
openImGroupName: Group
|
||||||
|
openImAuthName: Auth
|
||||||
|
|
||||||
|
log:
|
||||||
|
storageLocation: ../logs/
|
||||||
|
rotationTime: 24
|
||||||
|
remainRotationCount: 5
|
||||||
|
remainLogLevel: 6
|
||||||
|
elasticSearchSwitch: false
|
||||||
|
elasticSearchAddr: [ 127.0.0.1:9201 ]
|
||||||
|
elasticSearchUser: ""
|
||||||
|
elasticSearchPassword: ""
|
||||||
|
|
||||||
|
modulename:
|
||||||
|
longConnSvrName: msg_gateway
|
||||||
|
msgTransferName: msg_transfer
|
||||||
|
pushName: push
|
||||||
|
|
||||||
|
longconnsvr:
|
||||||
|
openImWsPort: [ 17778 ]
|
||||||
|
websocketMaxConnNum: 10000
|
||||||
|
websocketMaxMsgLen: 4096
|
||||||
|
websocketTimeOut: 10
|
||||||
|
|
||||||
|
push:
|
||||||
|
tpns:
|
||||||
|
ios:
|
||||||
|
accessID: 1600018281
|
||||||
|
secretKey: 3cd68a77a95b89e5089a1aca523f318f
|
||||||
|
android:
|
||||||
|
accessID: 111
|
||||||
|
secretKey: 111
|
||||||
|
jpns:
|
||||||
|
appKey: 2783339cee4de379cc798fe1
|
||||||
|
masterSecret: 66e5f309e032c68cc668c28a
|
||||||
|
pushUrl: "https://api.jpush.cn/v3/push"
|
||||||
|
manager:
|
||||||
|
appManagerUid: ["openIM123456","openIM654321"]
|
||||||
|
secrets: ["openIM1","openIM2"]
|
||||||
|
|
||||||
|
secret: tuoyun
|
||||||
|
|
||||||
|
multiloginpolicy:
|
||||||
|
onlyOneTerminalAccess: false
|
||||||
|
mobileAndPCTerminalAccessButOtherTerminalKickEachOther: true
|
||||||
|
allTerminalAccess: false
|
||||||
|
|
||||||
|
#token config
|
||||||
|
tokenpolicy:
|
||||||
|
accessSecret: "open_im_server"
|
||||||
|
# Token effective time seconds as a unit
|
||||||
|
#Seven days 7*24*60*60
|
||||||
|
accessExpire: 604800
|
||||||
|
|
||||||
|
messagecallback:
|
||||||
|
callbackSwitch: false
|
||||||
|
callbackUrl: "http://www.xxx.com/msg/judge"
|
@ -19,13 +19,25 @@ service_port_name=(
|
|||||||
list=$(cat $config_path | grep -w ${i} | awk -F '[:]' '{print $NF}')
|
list=$(cat $config_path | grep -w ${i} | awk -F '[:]' '{print $NF}')
|
||||||
list_to_string $list
|
list_to_string $list
|
||||||
for j in ${ports_array}; do
|
for j in ${ports_array}; do
|
||||||
port=`netstat -netulp |grep ./open_im| awk '{print $4}'|grep -w ${j}|awk -F '[:]' '{print $NF}'`
|
port=$(netstat -netulp | grep ./open_im | awk '{print $4}' | grep -w ${j} | awk -F '[:]' '{print $NF}')
|
||||||
if [[ ${port} -ne ${j} ]]; then
|
if [[ ${port} -ne ${j} ]]; then
|
||||||
echo -e ${YELLOW_PREFIX}${i}${COLOR_SUFFIX}${RED_PREFIX}" service does not start normally,not initiated port is "${COLOR_SUFFIX}${YELLOW_PREFIX}${j}${COLOR_SUFFIX}
|
echo -e ${YELLOW_PREFIX}${i}${COLOR_SUFFIX}${RED_PREFIX}" service does not start normally,not initiated port is "${COLOR_SUFFIX}${YELLOW_PREFIX}${j}${COLOR_SUFFIX}
|
||||||
exit 1
|
echo -e ${RED_PREFIX}"please check ../logs/openIM.log "${COLOR_SUFFIX}
|
||||||
|
exit -1
|
||||||
else
|
else
|
||||||
echo -e ${j}${GREEN_PREFIX}" port has been listening,belongs service is "${i}${COLOR_SUFFIX}
|
echo -e ${j}${GREEN_PREFIX}" port has been listening,belongs service is "${i}${COLOR_SUFFIX}
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
#Check launched service process
|
||||||
|
check=$(ps aux | grep -w ./${msg_transfer_name} | grep -v grep | wc -l)
|
||||||
|
if [ $check -eq ${msg_transfer_service_num} ]; then
|
||||||
|
echo -e ${GREEN_PREFIX}"service has been starting,belongs service is openImMsgTransfer"${COLOR_SUFFIX}
|
||||||
|
else
|
||||||
|
echo -e ${RED_PREFIX}"openImMsgTransfer service does not start normally, num err"${COLOR_SUFFIX}
|
||||||
|
echo -e ${RED_PREFIX}"please check ../logs/openIM.log "${COLOR_SUFFIX}
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e ${YELLOW_PREFIX}"all services launch success"${COLOR_SUFFIX}
|
echo -e ${YELLOW_PREFIX}"all services launch success"${COLOR_SUFFIX}
|
||||||
|
@ -44,5 +44,5 @@ if [ $check -ge 1 ]; then
|
|||||||
echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allNewPid}${COLOR_SUFFIX}
|
echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allNewPid}${COLOR_SUFFIX}
|
||||||
echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX}
|
echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX}
|
||||||
else
|
else
|
||||||
echo -e ${YELLOW_PREFIX}${msg_gateway_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR !!! PLEASE CHECK ERROR LOG"${COLOR_SUFFIX}
|
echo -e ${YELLOW_PREFIX}${msg_gateway_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR, PLEASE CHECK openIM.log"${COLOR_SUFFIX}
|
||||||
fi
|
fi
|
||||||
|
@ -8,31 +8,29 @@ source ./path_info.cfg
|
|||||||
#Check if the service exists
|
#Check if the service exists
|
||||||
#If it is exists,kill this process
|
#If it is exists,kill this process
|
||||||
check=`ps aux | grep -w ./${msg_transfer_name} | grep -v grep| wc -l`
|
check=`ps aux | grep -w ./${msg_transfer_name} | grep -v grep| wc -l`
|
||||||
if [ $check -eq 1 ]
|
if [ $check -ge 1 ]
|
||||||
then
|
then
|
||||||
oldPid=`ps aux | grep -w ./${msg_transfer_name} | grep -v grep|awk '{print $2}'`
|
oldPid=`ps aux | grep -w ./${msg_transfer_name} | grep -v grep|awk '{print $2}'`
|
||||||
kill -9 $oldPid
|
kill -9 $oldPid
|
||||||
fi
|
fi
|
||||||
#Waiting port recycling
|
#Waiting port recycling
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
cd ${msg_transfer_binary_root}
|
cd ${msg_transfer_binary_root}
|
||||||
|
for ((i = 0; i < ${msg_transfer_service_num}; i++)); do
|
||||||
nohup ./${msg_transfer_name} >>../logs/openIM.log 2>&1 &
|
nohup ./${msg_transfer_name} >>../logs/openIM.log 2>&1 &
|
||||||
|
done
|
||||||
|
|
||||||
#Check launched service process
|
#Check launched service process
|
||||||
check=`ps aux | grep -w ./${msg_transfer_name} | grep -v grep| wc -l`
|
check=`ps aux | grep -w ./${msg_transfer_name} | grep -v grep| wc -l`
|
||||||
if [ $check -eq 1 ]
|
if [ $check -ge 1 ]
|
||||||
then
|
then
|
||||||
newPid=`ps aux | grep -w ./${msg_transfer_name} | grep -v grep|awk '{print $2}'`
|
newPid=`ps aux | grep -w ./${msg_transfer_name} | grep -v grep|awk '{print $2}'`
|
||||||
ports=`netstat -netulp | grep -w ${newPid}|awk '{print $4}'|awk -F '[:]' '{print $NF}'`
|
|
||||||
allPorts=""
|
allPorts=""
|
||||||
|
|
||||||
for i in $ports ;
|
|
||||||
do
|
|
||||||
allPorts=${allPorts}"$i "
|
|
||||||
done
|
|
||||||
echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX}
|
echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX}
|
||||||
echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${msg_transfer_name}${COLOR_SUFFIX}
|
echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${msg_transfer_name}${COLOR_SUFFIX}
|
||||||
echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${newPid}${COLOR_SUFFIX}
|
echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${newPid}${COLOR_SUFFIX}
|
||||||
echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX}
|
echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX}
|
||||||
else
|
else
|
||||||
echo -e ${YELLOW_PREFIX}${msg_transfer_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR !!! PLEASE CHECK ERROR LOG"${COLOR_SUFFIX}
|
echo -e ${YELLOW_PREFIX}${msg_transfer_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR, PLEASE CHECK openIM.log"${COLOR_SUFFIX}
|
||||||
fi
|
fi
|
||||||
|
@ -16,6 +16,7 @@ push_source_root="../src/push/"
|
|||||||
msg_transfer_name="open_im_msg_transfer"
|
msg_transfer_name="open_im_msg_transfer"
|
||||||
msg_transfer_binary_root="../bin/"
|
msg_transfer_binary_root="../bin/"
|
||||||
msg_transfer_source_root="../src/msg_transfer/"
|
msg_transfer_source_root="../src/msg_transfer/"
|
||||||
|
msg_transfer_service_num=2
|
||||||
|
|
||||||
|
|
||||||
sdk_server_name="open_im_sdk_server"
|
sdk_server_name="open_im_sdk_server"
|
||||||
|
@ -13,7 +13,7 @@ rpc_ports=($ports_array)
|
|||||||
#Check if the service exists
|
#Check if the service exists
|
||||||
#If it is exists,kill this process
|
#If it is exists,kill this process
|
||||||
check=$(ps aux | grep -w ./${push_name} | grep -v grep | wc -l)
|
check=$(ps aux | grep -w ./${push_name} | grep -v grep | wc -l)
|
||||||
if [ $check -eq 1 ]; then
|
if [ $check -ge 1 ]; then
|
||||||
oldPid=$(ps aux | grep -w ./${push_name} | grep -v grep | awk '{print $2}')
|
oldPid=$(ps aux | grep -w ./${push_name} | grep -v grep | awk '{print $2}')
|
||||||
kill -9 $oldPid
|
kill -9 $oldPid
|
||||||
fi
|
fi
|
||||||
@ -28,7 +28,7 @@ done
|
|||||||
sleep 3
|
sleep 3
|
||||||
#Check launched service process
|
#Check launched service process
|
||||||
check=$(ps aux | grep -w ./${push_name} | grep -v grep | wc -l)
|
check=$(ps aux | grep -w ./${push_name} | grep -v grep | wc -l)
|
||||||
if [ $check -eq 1 ]; then
|
if [ $check -ge 1 ]; then
|
||||||
newPid=$(ps aux | grep -w ./${push_name} | grep -v grep | awk '{print $2}')
|
newPid=$(ps aux | grep -w ./${push_name} | grep -v grep | awk '{print $2}')
|
||||||
ports=$(netstat -netulp | grep -w ${newPid} | awk '{print $4}' | awk -F '[:]' '{print $NF}')
|
ports=$(netstat -netulp | grep -w ${newPid} | awk '{print $4}' | awk -F '[:]' '{print $NF}')
|
||||||
allPorts=""
|
allPorts=""
|
||||||
@ -41,5 +41,5 @@ if [ $check -eq 1 ]; then
|
|||||||
echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${newPid}${COLOR_SUFFIX}
|
echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${newPid}${COLOR_SUFFIX}
|
||||||
echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX}
|
echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX}
|
||||||
else
|
else
|
||||||
echo -e ${YELLOW_PREFIX}${push_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR !!! PLEASE CHECK ERROR LOG"${COLOR_SUFFIX}
|
echo -e ${YELLOW_PREFIX}${push_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR, PLEASE CHECK openIM.log"${COLOR_SUFFIX}
|
||||||
fi
|
fi
|
||||||
|
@ -43,5 +43,5 @@ if [ $check -ge 1 ]; then
|
|||||||
echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allNewPid}${COLOR_SUFFIX}
|
echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allNewPid}${COLOR_SUFFIX}
|
||||||
echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX}
|
echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX}
|
||||||
else
|
else
|
||||||
echo -e ${YELLOW_PREFIX}${sdk_server_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR !!! PLEASE CHECK ERROR LOG"${COLOR_SUFFIX}
|
echo -e ${YELLOW_PREFIX}${sdk_server_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR PLEASE CHECK openIM.log"${COLOR_SUFFIX}
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user