全部产品
云市场

服务端升级注意事项(3.3.X到3.4.X)

更新时间:2020-02-20 16:14:50

一、需要开放端口

需要开放 1935 端口。

二、镜像更新

1、参考步骤四数据备份,备份好服务端的数据

2、停止当前的镜像服务

  1. [root@linux ~]# cd ~/server
  2. [root@linux ~]# sudo docker-compose -f docker-compose.yml stop

3、删除部署

  1. [root@linux ~]# sudo docker-compose -f docker-compose.yml rm
  2. [root@linux ~]# docker system prune
  3. [root@linux ~]# docker volume prune

4、增加文件路径,创建文件夹

  1. sudo mkdir -p /private/rpadata/data/srs

5、导入新的镜像

  1. cd ~/server
  2. sudo docker load -i cs-docker.tar

6、确定docker-compose.yml文件

查看docker-compose.yml文件中的镜像版本号,版本号与导入的新的镜像版本号一致

  1. 查看docker-compose.yml文件中的镜像版本号
  2. cat docker-compose.yml

7、启动docker镜像

  1. sudo docker-compose -f docker-compose.yml up -d

三、连接数据库,更新数据库

1.连接MySQL数据库
2.选择rpa数据库。
使用mysql> use rpa;
再执行如下命令:

  1. SET NAMES utf8mb4;
  2. SET FOREIGN_KEY_CHECKS = 0;
  3. -- ----------------------------
  4. -- Table structure for app_video_record
  5. -- ----------------------------
  6. CREATE TABLE `app_video_record` (
  7. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  8. `group_id` bigint(11) NOT NULL,
  9. `record_uuid` varchar(40) DEFAULT NULL,
  10. `task_uuid` varchar(40) DEFAULT NULL,
  11. `app_name` varchar(255) DEFAULT NULL,
  12. `app_uuid` varchar(40) DEFAULT NULL,
  13. `client_uuid` varchar(40) DEFAULT NULL,
  14. `status` varchar(20) DEFAULT NULL,
  15. `result` varchar(4000) DEFAULT NULL,
  16. `begin_time` datetime NOT NULL,
  17. `end_time` datetime DEFAULT NULL,
  18. `creator` bigint(20) DEFAULT NULL,
  19. `modifier` bigint(20) DEFAULT NULL,
  20. `gmt_create` datetime DEFAULT NULL,
  21. `gmt_modified` datetime DEFAULT NULL,
  22. `is_deleted` tinyint(4) DEFAULT '0',
  23. PRIMARY KEY (`id`) USING BTREE,
  24. UNIQUE KEY `pk_uuid` (`record_uuid`) USING BTREE COMMENT 'uuid',
  25. KEY `idx_app_id` (`app_uuid`) USING BTREE COMMENT 'appUid',
  26. KEY `idx_app_name` (`app_name`(100)) USING BTREE COMMENT 'app_name',
  27. KEY `fk_task_uuid` (`task_uuid`) USING BTREE COMMENT 'task_id'
  28. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='视频记录表';
  29. -- ----------------------------
  30. -- Table structure for app_video_record
  31. -- ----------------------------
  32. CREATE TABLE `app_video_config` (
  33. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  34. `app_id` bigint(20) NOT NULL,
  35. `is_record` tinyint(4) NOT NULL,
  36. `creator` bigint(20) DEFAULT NULL,
  37. `modifier` bigint(20) DEFAULT NULL,
  38. `gmt_create` datetime DEFAULT NULL,
  39. `gmt_modified` datetime DEFAULT NULL,
  40. `is_deleted` tinyint(4) DEFAULT NULL,
  41. PRIMARY KEY (`id`)
  42. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='应用录屏设置表';
  43. CREATE TABLE `group_video_config` (
  44. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  45. `group_id` bigint(20) DEFAULT NULL,
  46. `config` varchar(500) DEFAULT NULL,
  47. `creator` bigint(20) DEFAULT NULL,
  48. `modifier` bigint(20) DEFAULT NULL,
  49. `gmt_create` datetime DEFAULT NULL,
  50. `gmt_modified` datetime DEFAULT NULL,
  51. `is_deleted` tinyint(4) DEFAULT NULL,
  52. PRIMARY KEY (`id`)
  53. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='组织录屏设置表';
  54. SET FOREIGN_KEY_CHECKS = 1;
  1. -- 初始数据配置
  2. insert into `resource`(code,type,name,creator,modifier,gmt_create,gmt_modified,is_deleted)
  3. values('currentVideo','page','实时录屏',1,1,now(),now(),0);
  4. insert into `resource`(code,type,name,creator,modifier,gmt_create,gmt_modified,is_deleted)
  5. values('pastVideo','page','录屏回看',1,1,now(),now(),0);
  6. insert into `resource`(code,type,name,creator,modifier,gmt_create,gmt_modified,is_deleted)
  7. values('videoSetting','page','录屏设置',1,1,now(),now(),0);
  8. insert into `menu`(code,name,order_seq,creator,modifier,gmt_create,gmt_modified,is_deleted)
  9. values('videoQuery','录屏管理',10,1,1,now(),now(),0);
  10. insert into authority(name,resource_id,option_id,creator,modifier,gmt_create,gmt_modified,is_deleted)
  11. SELECT '实时录屏',( select id from resource WHERE code= 'currentVideo' ),
  12. ( SELECT id FROM `option` WHERE CODE = 'operate' ),
  13. 1,1,now( ),now( ),0
  14. FROM DUAL;
  15. insert into authority(name,resource_id,option_id,creator,modifier,gmt_create,gmt_modified,is_deleted)
  16. SELECT '录屏回看',( select id from resource WHERE code= 'pastVideo' ),
  17. ( SELECT id FROM `option` WHERE CODE = 'operate' ),
  18. 1,1,now( ),now( ),0
  19. FROM DUAL;
  20. insert into authority(name,resource_id,option_id,creator,modifier,gmt_create,gmt_modified,is_deleted)
  21. SELECT '录屏设置',( select id from resource WHERE code= 'videoSetting' ),
  22. ( SELECT id FROM `option` WHERE CODE = 'operate' ),
  23. 1,1,now( ),now( ),0
  24. FROM DUAL;
  25. insert into `menu_has_authority`(menu_id,auth_id,order_seq,creator,modifier,gmt_create,gmt_modified,is_deleted)
  26. SELECT ( SELECT id FROM `menu` WHERE CODE = 'videoQuery' ),( SELECT id FROM `authority` where resource_id in(select id from resource WHERE code= 'currentVideo' )),1,1,1,now( ),now( ),0
  27. FROM DUAL;
  28. insert into `menu_has_authority`(menu_id,auth_id,order_seq,creator,modifier,gmt_create,gmt_modified,is_deleted)
  29. SELECT ( SELECT id FROM `menu` WHERE CODE = 'videoQuery' ),( SELECT id FROM `authority` where resource_id in(select id from resource WHERE code= 'pastVideo' )),2,1,1,now( ),now( ),0
  30. FROM DUAL;
  31. insert into `menu_has_authority`(menu_id,auth_id,order_seq,creator,modifier,gmt_create,gmt_modified,is_deleted)
  32. SELECT ( SELECT id FROM `menu` WHERE CODE = 'videoQuery' ),( SELECT id FROM `authority` where resource_id in(select id from resource WHERE code= 'videoSetting' )),3,1,1,now( ),now( ),0
  33. FROM DUAL;
  34. insert into `role_has_authority`(`role_id`, `auth_id`, `creator`, `modifier`, `gmt_create`, `gmt_modified`, `is_deleted`)
  35. select id,(select id from authority where name ='实时录屏' ) as auth_id ,1,1,now(),now(),0
  36. from role
  37. where role_flag = 'superAdmin';
  38. insert into `role_has_authority`(`role_id`, `auth_id`, `creator`, `modifier`, `gmt_create`, `gmt_modified`, `is_deleted`)
  39. select id,(select id from authority where name ='录屏回看' ) as auth_id ,1,1,now(),now(),0
  40. from role
  41. where role_flag = 'superAdmin';
  42. insert into `role_has_authority`(`role_id`, `auth_id`, `creator`, `modifier`, `gmt_create`, `gmt_modified`, `is_deleted`)
  43. select id,(select id from authority where name ='录屏设置' ) as auth_id ,1,1,now(),now(),0
  44. from role
  45. where role_flag = 'superAdmin';