Skip to content

批改ES

1.软件介绍

mysql 版本 5.7.36-0ubuntu0.18.04.1-log

shell
docker run -itd -p 3331:3306 --name mysql5.7.36 \
--restart always --privileged=true \
-v $PWD/conf:/etc/mysql/conf.d -v $PWD/mysql_data:/var/lib/mysql   \
-e MYSQL_ROOT_PASSWORD=mypassword \
-e TZ=Asia/Shanghai mysql:5.7.36
docker run -itd -p 3331:3306 --name mysql5.7.36 \
--restart always --privileged=true \
-v $PWD/conf:/etc/mysql/conf.d -v $PWD/mysql_data:/var/lib/mysql   \
-e MYSQL_ROOT_PASSWORD=mypassword \
-e TZ=Asia/Shanghai mysql:5.7.36

镜像安装配置

参考 https://shimo.im/docs/hKkyvgGDPdXgHkrQ

shell
#ubuntu kylin的/etc/resolv.conf重启恢复问题
vim /etc/systemd/resolved.conf
#改为 DNS=你的dns server
service systemd-resolved restart
#ubuntu kylin的/etc/resolv.conf重启恢复问题
vim /etc/systemd/resolved.conf
#改为 DNS=你的dns server
service systemd-resolved restart

配置全ssl

server {
    listen        80;
    listen     443 ssl;
    server_name  mj.penly.cn;
    root   /data/app/vue.pigai.org/other/;
    ssl_certificate       /data/ssl/certs/live/penly.cn/fullchain.pem;
    ssl_certificate_key  /data/ssl/certs/live/penly.cn/privkey.pem;

    location / {
        index index.html;
        autoindex  off;
        proxy_read_timeout 300;
        proxy_connect_timeout 300;
        proxy_buffering off;
        proxy_pass  http://127.0.0.1:3001;
        break;
    }
}
server {
    listen        80;
    listen     443 ssl;
    server_name  mj.penly.cn;
    root   /data/app/vue.pigai.org/other/;
    ssl_certificate       /data/ssl/certs/live/penly.cn/fullchain.pem;
    ssl_certificate_key  /data/ssl/certs/live/penly.cn/privkey.pem;

    location / {
        index index.html;
        autoindex  off;
        proxy_read_timeout 300;
        proxy_connect_timeout 300;
        proxy_buffering off;
        proxy_pass  http://127.0.0.1:3001;
        break;
    }
}

数据库迁移 innod 利用copy方式恢复

https://www.cnblogs.com/gjc592/p/9257613.html

sh

[mysqld]
init_connect='SET NAMES utf8'
character_set_server=utf8
 
[client]
default-character-set=utf8 


CREATE TABLE `member` (
  `user_id` int(11) NOT NULL AUTO_INCREMENT,
  `password` char(32) NOT NULL,
  `email` char(100) NOT NULL,
  `user_name` char(100) NOT NULL,
  `email_check` tinyint(1) NOT NULL DEFAULT '0',
  `ctime` int(10) NOT NULL,
  `teacher_or_student` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0未定义,1为老师,2为学生',
  `userinfo` text NOT NULL COMMENT '将老师学生的信息冗余系列化到该字段',
  `img` varchar(50) NOT NULL,
  `lastlogin` int(11) NOT NULL COMMENT '上次登录时间',
  `score` int(11) NOT NULL COMMENT '积分',
  `ifprice` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0未付费,1付费用户',
  `end_time` int(11) DEFAULT NULL COMMENT '付费截止日期',
  `ip` varchar(20) NOT NULL,
  `lg_cnt` int(11) NOT NULL,
  `is_nju` int(1) NOT NULL DEFAULT '0' COMMENT '0表示非,1表示是而且资料来源nju,2是nju上有数据但资料不是那边的',
  `nju_user_id` int(11) NOT NULL,
  `renzheng` tinyint(1) NOT NULL DEFAULT '0' COMMENT '认证',
  `pay` float(8,2) NOT NULL COMMENT '付费',
  `tj_name` varchar(60) NOT NULL COMMENT '推荐人',
  `gt_time` int(10) NOT NULL,
  `tz_type` int(2) NOT NULL COMMENT '客户提醒方式',
  `is_del` tinyint(1) NOT NULL COMMENT '1代表删除 0未删除',
  `uc_user_id` int(11) NOT NULL COMMENT 'uc_center 的用户id',
  `school_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0注册上来, 1中小学有强对于关系 2中小学没有强关系',
  `school_id` int(11) NOT NULL COMMENT '当时导入进来的用户 d_school 中的 school_id',
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `user_name` (`user_name`),
  KEY `email` (`email`),
  KEY `is_del` (`is_del`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8

CREATE TABLE `eng_essay` (
  `essay_id` int(11) NOT NULL AUTO_INCREMENT,
  `request_id` int(11) NOT NULL DEFAULT '0' COMMENT 'FK, 作文题目ID',
  `author_id` int(11) NOT NULL DEFAULT '0' COMMENT 'FK, 本文作者',
  `internal_idx` int(11) DEFAULT NULL COMMENT '内部题号,比如第3道翻译题',
  `title` varchar(255) NOT NULL COMMENT '标题',
  `essay` text COMMENT '学生答案',
  `essay_html` text NOT NULL COMMENT '保存用户的html资料',
  `tm` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id` int(11) NOT NULL COMMENT '用户id',
  `sent_cnt` int(6) NOT NULL DEFAULT '0' COMMENT '句子数',
  `token_cnt` int(6) NOT NULL DEFAULT '0' COMMENT '词汇谁',
  `len` int(11) NOT NULL,
  `ctime` int(10) NOT NULL,
  `stu_number` varchar(32) NOT NULL COMMENT '学号',
  `stu_name` varchar(60) NOT NULL COMMENT '姓名',
  `stu_class` varchar(60) NOT NULL COMMENT '班级',
  `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '-2自删除 -1教师删除 0保存,1已提交,2教师批改,3系统批改',
  `score` float unsigned NOT NULL COMMENT '教师评分',
  `qw_score` float NOT NULL DEFAULT '0' COMMENT '期望分',
  `sy_score` float NOT NULL COMMENT '当人工打分后,保留当时的系统分',
  `pigai` varchar(255) NOT NULL COMMENT '教师简短批改',
  `pigai_time` int(10) NOT NULL COMMENT '批改时间',
  `gram_score` double NOT NULL COMMENT '地道度',
  `is_pigai` tinyint(1) NOT NULL DEFAULT '0',
  `version` int(4) NOT NULL DEFAULT '1' COMMENT '版本号',
  `cate` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0: student essday; 1: fanwen ; 2: testing doc',
  `src` varchar(20) NOT NULL DEFAULT '' COMMENT 'essday src, cet4/cet6',
  `tid` int(11) NOT NULL DEFAULT '0',
  `fid` int(11) NOT NULL DEFAULT '0',
  `tag` varchar(255) NOT NULL DEFAULT '' COMMENT 'some memo info',
  `is_chang` tinyint(1) NOT NULL,
  `jianyi` text NOT NULL,
  `anly_cnt` int(6) NOT NULL,
  `mp3` varchar(10) NOT NULL,
  PRIMARY KEY (`essay_id`),
  KEY `uid` (`user_id`),
  KEY `request_id` (`request_id`),
  KEY `type` (`type`),
  KEY `request_id_2` (`request_id`,`score`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;


CREATE TABLE `eng_essay_request` (
  `request_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '题目编号',
  `internal_idx` smallint(6) DEFAULT '0' COMMENT '存放 公式吧',
  `essay_title` varchar(255) DEFAULT NULL COMMENT '作文题目',
  `essay_topic` text COMMENT '作文题目或汉译英题目',
  `essay_level` varchar(20) DEFAULT NULL COMMENT '水平层次,如 band4,band6,toefl',
  `essay_type` varchar(10) DEFAULT NULL COMMENT '类型,如作文、汉译英',
  `src` varchar(50) DEFAULT NULL COMMENT '来源',
  `tags` varchar(100) DEFAULT NULL COMMENT '标签',
  `grade` varchar(30) DEFAULT NULL COMMENT '年级',
  `major` varchar(30) DEFAULT NULL COMMENT '专业',
  `year` int(11) DEFAULT NULL COMMENT '年份',
  `create_time` int(11) DEFAULT NULL,
  `valid_begin_time` int(11) DEFAULT NULL,
  `valid_end_time` int(11) DEFAULT NULL,
  `tm` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id` int(11) NOT NULL COMMENT '添加教师的uid',
  `teacher_name` varchar(30) NOT NULL COMMENT '教师姓名',
  `essay_cnt` int(6) NOT NULL DEFAULT '0' COMMENT '答作文人数',
  `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '存在的状态:0默认,-1删除 4长篇作文',
  `gram_score` double NOT NULL COMMENT '地道度',
  `is_zpigai` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0 一次都未批改 1pigai过病情系统处理过 2批改系统未处理 ',
  `did` int(11) NOT NULL COMMENT 'summary writing 的did',
  `qw_avg` int(4) NOT NULL COMMENT '均分',
  `qw_hight` int(4) NOT NULL COMMENT '高分',
  `qw_low` int(4) NOT NULL COMMENT '低分',
  `is_qw` int(1) NOT NULL COMMENT '是否显示期望分',
  `cat_id` int(4) NOT NULL COMMENT '类别',
  `version` tinyint(1) NOT NULL,
  `img` varchar(200) NOT NULL,
  `is_chang` tinyint(1) NOT NULL,
  `manfen` float(5,2) NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`request_id`),
  KEY `user_id` (`user_id`),
  KEY `create_time` (`create_time`),
  KEY `type` (`type`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;


CREATE TABLE `eng_rq_ying` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `f_request_id` int(10) NOT NULL COMMENT '旧request_id',
  `request_id` int(10) NOT NULL COMMENT '新request_id',
  `ctime` int(10) NOT NULL COMMENT '时间',
  `type` int(11) NOT NULL DEFAULT '0',
  `user_id` int(11) NOT NULL COMMENT '创建者的user_id',
  PRIMARY KEY (`id`),
  UNIQUE KEY `request_id` (`request_id`),
  KEY `f_request_id` (`f_request_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8


alter table member_info  discard tablespace;
alter table member_info import tablespace;

alter table member  discard tablespace;
alter table member import tablespace;


alter table eng_essay  discard tablespace;
alter table eng_essay import tablespace;

alter table eng_essay_request  discard tablespace;
alter table eng_essay_request import tablespace;


alter table eng_rq_ying  discard tablespace;
alter table eng_rq_ying import tablespace;

alter table eng_essay_attr  discard tablespace;
alter table eng_essay_attr import tablespace; 

"url" : "jdbc:mysql://45.113.201.68:3306/pigai_org",
"url" : "jdbc:mysql://49.234.25.98:3331/pigai_org",

+---------------------+
| Tables_in_pigai_org |
+---------------------+
| eng_essay           |
| eng_essay_attr      |
| eng_essay_request   |
| eng_rq_cat          |
| eng_rq_ying         |
| member              |
| member_info         |
| school              |
| user_invite         |
+---------------------+
9 rows in set (0.00 sec)

[mysqld]
init_connect='SET NAMES utf8'
character_set_server=utf8
 
[client]
default-character-set=utf8 


CREATE TABLE `member` (
  `user_id` int(11) NOT NULL AUTO_INCREMENT,
  `password` char(32) NOT NULL,
  `email` char(100) NOT NULL,
  `user_name` char(100) NOT NULL,
  `email_check` tinyint(1) NOT NULL DEFAULT '0',
  `ctime` int(10) NOT NULL,
  `teacher_or_student` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0未定义,1为老师,2为学生',
  `userinfo` text NOT NULL COMMENT '将老师学生的信息冗余系列化到该字段',
  `img` varchar(50) NOT NULL,
  `lastlogin` int(11) NOT NULL COMMENT '上次登录时间',
  `score` int(11) NOT NULL COMMENT '积分',
  `ifprice` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0未付费,1付费用户',
  `end_time` int(11) DEFAULT NULL COMMENT '付费截止日期',
  `ip` varchar(20) NOT NULL,
  `lg_cnt` int(11) NOT NULL,
  `is_nju` int(1) NOT NULL DEFAULT '0' COMMENT '0表示非,1表示是而且资料来源nju,2是nju上有数据但资料不是那边的',
  `nju_user_id` int(11) NOT NULL,
  `renzheng` tinyint(1) NOT NULL DEFAULT '0' COMMENT '认证',
  `pay` float(8,2) NOT NULL COMMENT '付费',
  `tj_name` varchar(60) NOT NULL COMMENT '推荐人',
  `gt_time` int(10) NOT NULL,
  `tz_type` int(2) NOT NULL COMMENT '客户提醒方式',
  `is_del` tinyint(1) NOT NULL COMMENT '1代表删除 0未删除',
  `uc_user_id` int(11) NOT NULL COMMENT 'uc_center 的用户id',
  `school_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0注册上来, 1中小学有强对于关系 2中小学没有强关系',
  `school_id` int(11) NOT NULL COMMENT '当时导入进来的用户 d_school 中的 school_id',
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `user_name` (`user_name`),
  KEY `email` (`email`),
  KEY `is_del` (`is_del`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8

CREATE TABLE `eng_essay` (
  `essay_id` int(11) NOT NULL AUTO_INCREMENT,
  `request_id` int(11) NOT NULL DEFAULT '0' COMMENT 'FK, 作文题目ID',
  `author_id` int(11) NOT NULL DEFAULT '0' COMMENT 'FK, 本文作者',
  `internal_idx` int(11) DEFAULT NULL COMMENT '内部题号,比如第3道翻译题',
  `title` varchar(255) NOT NULL COMMENT '标题',
  `essay` text COMMENT '学生答案',
  `essay_html` text NOT NULL COMMENT '保存用户的html资料',
  `tm` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id` int(11) NOT NULL COMMENT '用户id',
  `sent_cnt` int(6) NOT NULL DEFAULT '0' COMMENT '句子数',
  `token_cnt` int(6) NOT NULL DEFAULT '0' COMMENT '词汇谁',
  `len` int(11) NOT NULL,
  `ctime` int(10) NOT NULL,
  `stu_number` varchar(32) NOT NULL COMMENT '学号',
  `stu_name` varchar(60) NOT NULL COMMENT '姓名',
  `stu_class` varchar(60) NOT NULL COMMENT '班级',
  `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '-2自删除 -1教师删除 0保存,1已提交,2教师批改,3系统批改',
  `score` float unsigned NOT NULL COMMENT '教师评分',
  `qw_score` float NOT NULL DEFAULT '0' COMMENT '期望分',
  `sy_score` float NOT NULL COMMENT '当人工打分后,保留当时的系统分',
  `pigai` varchar(255) NOT NULL COMMENT '教师简短批改',
  `pigai_time` int(10) NOT NULL COMMENT '批改时间',
  `gram_score` double NOT NULL COMMENT '地道度',
  `is_pigai` tinyint(1) NOT NULL DEFAULT '0',
  `version` int(4) NOT NULL DEFAULT '1' COMMENT '版本号',
  `cate` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0: student essday; 1: fanwen ; 2: testing doc',
  `src` varchar(20) NOT NULL DEFAULT '' COMMENT 'essday src, cet4/cet6',
  `tid` int(11) NOT NULL DEFAULT '0',
  `fid` int(11) NOT NULL DEFAULT '0',
  `tag` varchar(255) NOT NULL DEFAULT '' COMMENT 'some memo info',
  `is_chang` tinyint(1) NOT NULL,
  `jianyi` text NOT NULL,
  `anly_cnt` int(6) NOT NULL,
  `mp3` varchar(10) NOT NULL,
  PRIMARY KEY (`essay_id`),
  KEY `uid` (`user_id`),
  KEY `request_id` (`request_id`),
  KEY `type` (`type`),
  KEY `request_id_2` (`request_id`,`score`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;


CREATE TABLE `eng_essay_request` (
  `request_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '题目编号',
  `internal_idx` smallint(6) DEFAULT '0' COMMENT '存放 公式吧',
  `essay_title` varchar(255) DEFAULT NULL COMMENT '作文题目',
  `essay_topic` text COMMENT '作文题目或汉译英题目',
  `essay_level` varchar(20) DEFAULT NULL COMMENT '水平层次,如 band4,band6,toefl',
  `essay_type` varchar(10) DEFAULT NULL COMMENT '类型,如作文、汉译英',
  `src` varchar(50) DEFAULT NULL COMMENT '来源',
  `tags` varchar(100) DEFAULT NULL COMMENT '标签',
  `grade` varchar(30) DEFAULT NULL COMMENT '年级',
  `major` varchar(30) DEFAULT NULL COMMENT '专业',
  `year` int(11) DEFAULT NULL COMMENT '年份',
  `create_time` int(11) DEFAULT NULL,
  `valid_begin_time` int(11) DEFAULT NULL,
  `valid_end_time` int(11) DEFAULT NULL,
  `tm` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id` int(11) NOT NULL COMMENT '添加教师的uid',
  `teacher_name` varchar(30) NOT NULL COMMENT '教师姓名',
  `essay_cnt` int(6) NOT NULL DEFAULT '0' COMMENT '答作文人数',
  `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '存在的状态:0默认,-1删除 4长篇作文',
  `gram_score` double NOT NULL COMMENT '地道度',
  `is_zpigai` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0 一次都未批改 1pigai过病情系统处理过 2批改系统未处理 ',
  `did` int(11) NOT NULL COMMENT 'summary writing 的did',
  `qw_avg` int(4) NOT NULL COMMENT '均分',
  `qw_hight` int(4) NOT NULL COMMENT '高分',
  `qw_low` int(4) NOT NULL COMMENT '低分',
  `is_qw` int(1) NOT NULL COMMENT '是否显示期望分',
  `cat_id` int(4) NOT NULL COMMENT '类别',
  `version` tinyint(1) NOT NULL,
  `img` varchar(200) NOT NULL,
  `is_chang` tinyint(1) NOT NULL,
  `manfen` float(5,2) NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`request_id`),
  KEY `user_id` (`user_id`),
  KEY `create_time` (`create_time`),
  KEY `type` (`type`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;


CREATE TABLE `eng_rq_ying` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `f_request_id` int(10) NOT NULL COMMENT '旧request_id',
  `request_id` int(10) NOT NULL COMMENT '新request_id',
  `ctime` int(10) NOT NULL COMMENT '时间',
  `type` int(11) NOT NULL DEFAULT '0',
  `user_id` int(11) NOT NULL COMMENT '创建者的user_id',
  PRIMARY KEY (`id`),
  UNIQUE KEY `request_id` (`request_id`),
  KEY `f_request_id` (`f_request_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8


alter table member_info  discard tablespace;
alter table member_info import tablespace;

alter table member  discard tablespace;
alter table member import tablespace;


alter table eng_essay  discard tablespace;
alter table eng_essay import tablespace;

alter table eng_essay_request  discard tablespace;
alter table eng_essay_request import tablespace;


alter table eng_rq_ying  discard tablespace;
alter table eng_rq_ying import tablespace;

alter table eng_essay_attr  discard tablespace;
alter table eng_essay_attr import tablespace; 

"url" : "jdbc:mysql://45.113.201.68:3306/pigai_org",
"url" : "jdbc:mysql://49.234.25.98:3331/pigai_org",

+---------------------+
| Tables_in_pigai_org |
+---------------------+
| eng_essay           |
| eng_essay_attr      |
| eng_essay_request   |
| eng_rq_cat          |
| eng_rq_ying         |
| member              |
| member_info         |
| school              |
| user_invite         |
+---------------------+
9 rows in set (0.00 sec)