v1.1.0
This commit is contained in:
BIN
bin/open-im-media-server
Executable file
BIN
bin/open-im-media-server
Executable file
Binary file not shown.
BIN
bin/open-im-signal-server
Executable file
BIN
bin/open-im-signal-server
Executable file
Binary file not shown.
48
config/config.yaml
Normal file
48
config/config.yaml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
port: 7880 #不用修改,默认即可
|
||||||
|
|
||||||
|
redis:
|
||||||
|
address: 127.0.0.1:16379 #和IM保持一致
|
||||||
|
db: 1 #不用修改,默认即可
|
||||||
|
password: openIM123 #和IM保持一致
|
||||||
|
|
||||||
|
rtc:
|
||||||
|
# udp_port: 7882 #不用修改,默认即可,开放此外网udp端口
|
||||||
|
port_range_start: 50000
|
||||||
|
port_range_end: 60000
|
||||||
|
tcp_port: 7881 #不用修改,默认即可,开放此外网tcp端口
|
||||||
|
use_external_ip: true #不用修改,默认即可
|
||||||
|
node_ip: 127.0.0.1 #需要修改为部署机器的外网IP
|
||||||
|
|
||||||
|
keys:
|
||||||
|
APIGPW3gnFTzqHH: 23ztfSqsfQ8hKkHzHTl3Z4bvaxro0snjk5jwbp5p6Q3 #测试环境不修改,生产环境修改,生成方式scripts目录下执行./gen_key.sh
|
||||||
|
|
||||||
|
room:
|
||||||
|
auto_create: false
|
||||||
|
enable_remote_unmute: true #会议系统,不用修改,默认即可
|
||||||
|
empty_timeout: 72000 #如果视频会议的房间中人数为0,超过这个时间(秒)就自动关闭房间,不用修改,默认即可
|
||||||
|
|
||||||
|
rpc:
|
||||||
|
zookeeper:
|
||||||
|
schema: openim #默认即可
|
||||||
|
zkAddr: [ 127.0.0.1:2181 ] #单机部署时,默认即可
|
||||||
|
userName:
|
||||||
|
password:
|
||||||
|
port: 11300 #不用修改 默认即可
|
||||||
|
live_url: ws://127.0.0.1:7880 #用户能通过此ip:7880访问 或者配置nginx 类似wss://web.rentsoft.cn/open_rtc
|
||||||
|
live_url_inner: ws://127.0.0.1:7880
|
||||||
|
address: 0.0.0.0 #不用修改 默认即可
|
||||||
|
external_ip: 127.0.0.1 #IM服务器能通过此ip:11300访问到的此服务器,不一定是外网ip,如果为空,则获取本机ip
|
||||||
|
register_name:
|
||||||
|
openImRtcName: Rtc
|
||||||
|
openImMsgName: Msg #不用修改,默认即可
|
||||||
|
storage_location: ../logs
|
||||||
|
|
||||||
|
file:
|
||||||
|
enable_file_save: false #是否保持音视频文件 如果为true则要配置s3,同时需要配置recorder.yaml
|
||||||
|
s3:
|
||||||
|
access_key: root #和IM保持一致
|
||||||
|
secret: openIM123 #和IM保持一致
|
||||||
|
region: us-east-1 #和IM保持一致
|
||||||
|
endpoint: http://127.0.0.1:10005 #和IM保持一致
|
||||||
|
bucket: video #需先手动创建
|
||||||
|
layout: single-speaker
|
||||||
25
config/recorder.yaml
Normal file
25
config/recorder.yaml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
log_level: debug #日志级别
|
||||||
|
api_key: APIGPW3gnFTzqHH #和config.yaml保持一致
|
||||||
|
api_secret: 23ztfSqsfQ8hKkHzHTl3Z4bvaxro0snjk5jwbp5p6Q3 #和config.yaml保持一致
|
||||||
|
ws_url: ws://127.0.0.1:7880 #和config.yaml保持一致 需要连接到音视频服务的7880端口
|
||||||
|
insecure: false
|
||||||
|
|
||||||
|
template_base: http://172.20.40.77:9096
|
||||||
|
|
||||||
|
redis:
|
||||||
|
address: 127.0.0.1:16379 #和config.yaml保持一致
|
||||||
|
username: #和config.yaml保持一致
|
||||||
|
password: openIM123 #和config.yaml保持一致
|
||||||
|
db: 1 #和config.yaml保持一致
|
||||||
|
|
||||||
|
s3:
|
||||||
|
access_key: root #和config.yaml保持一致
|
||||||
|
secret: openIM123 #和config.yaml保持一致
|
||||||
|
region: us-east-1 #和config.yaml保持一致
|
||||||
|
endpoint: http://127.0.0.1:10005 #和config.yaml保持一致
|
||||||
|
bucket: video #和config.yaml保持一致
|
||||||
|
|
||||||
|
cpu_cost:
|
||||||
|
room_composite_cpu_cost: 3.0 #默认即可
|
||||||
|
track_composite_cpu_cost: 2.0 #默认即可
|
||||||
|
track_cpu_cost: 1.0 #默认即可
|
||||||
70
open-im-media-server-Deployment.md
Normal file
70
open-im-media-server-Deployment.md
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
# open-im-media-server音视频服务部署文档
|
||||||
|
|
||||||
|
## 1.解压
|
||||||
|
|
||||||
|
tar -zxvf open-im-media-server.tar.gz
|
||||||
|
|
||||||
|
## 2. 开放端口
|
||||||
|
|
||||||
|
| RTC端口 | 说明 | 操作 |
|
||||||
|
| --------- | -------------------- | -------------------------------------------------- |
|
||||||
|
| TCP: 7880 | ws协议,通话房间管理 | 端口放行或nginx反向代理(参考第5部分),关闭防火墙 |
|
||||||
|
| TCP: 7881 | 音视频通话 | 端口放行,关闭防火墙 |
|
||||||
|
| UDP: 7882 | 音视频通话 | 端口放行,关闭防火墙 |
|
||||||
|
|
||||||
|
## 3. 配置说明
|
||||||
|
|
||||||
|
```
|
||||||
|
查看config/config.ymal配置项说明
|
||||||
|
```
|
||||||
|
|
||||||
|
## 4.修改scripts/re_start.sh启动脚本
|
||||||
|
|
||||||
|
```
|
||||||
|
nohup ../bin/open-im-media-server --config ../config/config.yaml --node-ip 127.0.0.1 >> ../logs/open_im_media.log 2>&1 &
|
||||||
|
修改127.0.0.1为本机网外ip, 注意一定是本机所在的外网ip,不要通过nginx反代
|
||||||
|
```
|
||||||
|
|
||||||
|
## 5.关于nginx配置模板
|
||||||
|
|
||||||
|
```
|
||||||
|
upstream im_open_rtc{
|
||||||
|
server 127.0.0.1:7880; #rtc 音视频通话 服务器地址 根据部署情况可指定多台
|
||||||
|
}
|
||||||
|
|
||||||
|
location ^~/open_rtc/ { #7880 rtc
|
||||||
|
|
||||||
|
listen 443;
|
||||||
|
server_name web.rentsoft.cn; #1 web im 端 域名
|
||||||
|
ssl on;
|
||||||
|
ssl_certificate /etc/nginx/conf.d/ssl/web.xx.xx.crt; #2 证书
|
||||||
|
ssl_certificate_key /etc/nginx/conf.d/ssl/web.xx.xx.key; #3 证书
|
||||||
|
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "Upgrade";
|
||||||
|
proxy_set_header X-real-ip $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
proxy_pass http://im_open_rtc/;
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### 6.启动、停止
|
||||||
|
|
||||||
|
```
|
||||||
|
启动服务
|
||||||
|
scripts下执行
|
||||||
|
chmod +x re_start.sh
|
||||||
|
nohup ./re_start.sh >> ../logs/restart.log 2>&1 &
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
停止服务
|
||||||
|
scripts下执行
|
||||||
|
chmod +x stop.sh
|
||||||
|
./stop.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
3
scripts/gen_key.sh
Normal file
3
scripts/gen_key.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
../bin/open-im-media-server generate-keys
|
||||||
27
scripts/start.sh
Normal file
27
scripts/start.sh
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
echo 5000000 > /proc/sys/net/core/rmem_max
|
||||||
|
ulimit -n 10000
|
||||||
|
|
||||||
|
echo "start openIM rtc server........"
|
||||||
|
|
||||||
|
logs_dir="../logs"
|
||||||
|
|
||||||
|
if [ ! -d "$logs_dir" ]; then
|
||||||
|
mkdir -p "$logs_dir"
|
||||||
|
fi
|
||||||
|
|
||||||
|
time=`date +"%Y-%m-%d %H:%M:%S"`
|
||||||
|
echo "==========================================================">>../logs/open_im_media.log 2>&1 &
|
||||||
|
echo "==========================================================">>../logs/open_im_media.log 2>&1 &
|
||||||
|
echo "==========================================================">>../logs/open_im_media.log 2>&1 &
|
||||||
|
echo "==========server start time:${time}===========">>../logs/open_im_media.log 2>&1 &
|
||||||
|
echo "==========================================================">>../logs/open_im_media.log 2>&1 &
|
||||||
|
echo "==========================================================">>../logs/open_im_media.log 2>&1 &
|
||||||
|
echo "==========================================================">>../logs/open_im_media.log 2>&1 &
|
||||||
|
|
||||||
|
echo "start media server">>../logs/open_im_media.log 2>&1 &
|
||||||
|
cd ../bin
|
||||||
|
nohup ./open-im-media-server --config ../config/config.yaml --node-ip 127.0.0.1 >> ../logs/open_im_media.log 2>&1 &
|
||||||
|
|
||||||
|
echo "start signal server">>../logs/open_im_media.log 2>&1 &
|
||||||
|
nohup ./open-im-signal-server --config ../config/config.yaml >> ../logs/open_im_media.log 2>&1 &
|
||||||
19
scripts/stop.sh
Normal file
19
scripts/stop.sh
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
service_names=(
|
||||||
|
'open-im-media-server'
|
||||||
|
'open-im-signal-server'
|
||||||
|
)
|
||||||
|
|
||||||
|
for i in ${service_names[*]}; do
|
||||||
|
#Check whether the service exists
|
||||||
|
name="ps -aux |grep -w $i |grep -v grep"
|
||||||
|
count="${name}| wc -l"
|
||||||
|
if [ $(eval ${count}) -gt 0 ]; then
|
||||||
|
pid="${name}| awk '{print \$2}'"
|
||||||
|
echo -e "${SKY_BLUE_PREFIX}Killing service:$i pid:$(eval $pid)${COLOR_SUFFIX}"
|
||||||
|
#kill the service that existed
|
||||||
|
kill -9 $(eval $pid)
|
||||||
|
echo -e "${SKY_BLUE_PREFIX}service:$i was killed ${COLOR_SUFFIX}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user