forked from zhp8341/flink-streaming-platform-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflink_web_docker.sql
235 lines (216 loc) · 15.9 KB
/
flink_web_docker.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
CREATE DATABASE IF NOT EXISTS flink_web_docker default charset utf8 COLLATE utf8_general_ci;
use flink_web_docker;
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for alart_log
-- ----------------------------
DROP TABLE IF EXISTS `alart_log`;
CREATE TABLE `alart_log` (
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
`job_config_id` bigint(11) NOT NULL COMMENT 'job_config的id 如果0代表的是测试,',
`job_name` varchar(255) DEFAULT NULL,
`message` varchar(512) DEFAULT NULL COMMENT '消息内容',
`type` tinyint(1) NOT NULL COMMENT '1:钉钉',
`status` tinyint(1) NOT NULL COMMENT '1:成功 0:失败',
`fail_log` text COMMENT '失败原因',
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`edit_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`creator` varchar(32) DEFAULT 'sys',
`editor` varchar(32) DEFAULT 'sys',
PRIMARY KEY (`id`),
KEY `index_job_config_id` (`job_config_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='告警发送情况日志';
-- ----------------------------
-- Table structure for ip_status
-- ----------------------------
DROP TABLE IF EXISTS `ip_status`;
CREATE TABLE `ip_status` (
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
`ip` varchar(64) NOT NULL COMMENT 'ip',
`status` int(11) NOT NULL COMMENT '1:运行 -1:停止 ',
`last_time` datetime DEFAULT NULL COMMENT '最后心跳时间',
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`edit_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`creator` varchar(32) NOT NULL DEFAULT 'sys',
`editor` varchar(32) NOT NULL DEFAULT 'sys',
PRIMARY KEY (`id`),
UNIQUE KEY `index_uk_ip` (`ip`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='web服务运行ip';
-- ----------------------------
-- Records of ip_status
-- ----------------------------
BEGIN;
INSERT INTO `ip_status` VALUES (1, '172.17.0.2', 1, '2021-09-24 23:46:00', 0, '2021-09-24 23:38:59', '2021-09-24 23:45:59', 'sys', 'sys');
COMMIT;
-- ----------------------------
-- Table structure for job_alarm_config
-- ----------------------------
DROP TABLE IF EXISTS `job_alarm_config`;
CREATE TABLE `job_alarm_config` (
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
`job_id` bigint(11) unsigned NOT NULL COMMENT 'job_config主表id',
`type` tinyint(1) NOT NULL COMMENT '类型 1:钉钉告警 2:url回调 3:异常自动拉起任务',
`version` int(11) NOT NULL DEFAULT '0' COMMENT '更新版本号 ',
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`edit_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`creator` varchar(32) DEFAULT 'sys',
`editor` varchar(32) DEFAULT 'sys',
PRIMARY KEY (`id`),
KEY `uk_index_job_id` (`job_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='告警辅助配置表';
-- ----------------------------
-- Table structure for job_config
-- ----------------------------
DROP TABLE IF EXISTS `job_config`;
CREATE TABLE `job_config` (
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
`job_name` varchar(64) NOT NULL COMMENT '任务名称',
`deploy_mode` varchar(64) NOT NULL COMMENT '提交模式: standalone 、yarn 、yarn-session ',
`flink_run_config` varchar(512) NOT NULL COMMENT 'flink运行配置',
`flink_sql` mediumtext NOT NULL COMMENT 'sql语句',
`flink_checkpoint_config` varchar(512) DEFAULT NULL COMMENT 'checkPoint配置',
`job_id` varchar(64) DEFAULT NULL COMMENT '运行后的任务id',
`is_open` tinyint(1) NOT NULL COMMENT '1:开启 0: 关闭',
`status` tinyint(1) NOT NULL COMMENT '1:运行中 0: 停止中 -1:运行失败',
`ext_jar_path` varchar(2048) DEFAULT NULL COMMENT 'udf地址已经连接器jar 如http://xxx.xxx.com/flink-streaming-udf.jar',
`last_start_time` datetime DEFAULT NULL COMMENT '最后一次启动时间',
`last_run_log_id` bigint(11) DEFAULT NULL COMMENT '最后一次日志',
`version` int(11) NOT NULL DEFAULT '0' COMMENT '更新版本号 用于乐观锁',
`job_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '任务类型 0:sql 1:自定义jar',
`custom_args` varchar(128) DEFAULT NULL COMMENT '启动jar可能需要使用的自定义参数',
`custom_main_class` varchar(128) DEFAULT NULL COMMENT '程序入口类',
`custom_jar_url` varchar(128) DEFAULT NULL COMMENT '自定义jar的http地址 如:http://ccblog.cn/xx.jar',
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`edit_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`creator` varchar(32) DEFAULT 'sys',
`editor` varchar(32) DEFAULT 'sys',
PRIMARY KEY (`id`),
KEY `uk_index` (`job_name`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='flink任务配置表';
-- ----------------------------
-- Records of job_config
-- ----------------------------
BEGIN;
INSERT INTO `job_config` VALUES (1, 'test_datagen_simple', 'LOCAL', '', 'CREATE TABLE source_table (\n f0 INT,\n f1 INT,\n f2 STRING\n) WITH (\n \'connector\' = \'datagen\',\n \'rows-per-second\'=\'5\'\n);\nCREATE TABLE print_table (\n f0 INT,\n f1 INT,\n f2 STRING\n) WITH (\n \'connector\' = \'print\'\n);\ninsert into print_table select f0,f1,f2 from source_table;\n', '', '', 1, 0, NULL, '2021-09-24 23:15:21', 227, 77, 0, NULL, NULL, NULL, 0, '2021-04-06 10:24:30', '2021-09-24 23:45:30', NULL, 'admin');
COMMIT;
-- ----------------------------
-- Table structure for job_config_history
-- ----------------------------
DROP TABLE IF EXISTS `job_config_history`;
CREATE TABLE `job_config_history` (
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
`job_config_id` bigint(11) NOT NULL COMMENT 'job_config主表Id',
`job_name` varchar(64) NOT NULL COMMENT '任务名称',
`deploy_mode` varchar(64) NOT NULL COMMENT '提交模式: standalone 、yarn 、yarn-session ',
`flink_run_config` varchar(512) NOT NULL COMMENT 'flink运行配置',
`flink_sql` mediumtext NOT NULL COMMENT 'sql语句',
`flink_checkpoint_config` varchar(512) DEFAULT NULL COMMENT 'checkPoint配置',
`ext_jar_path` varchar(2048) DEFAULT NULL COMMENT 'udf地址及连接器jar 如http://xxx.xxx.com/flink-streaming-udf.jar',
`version` int(11) NOT NULL DEFAULT '0' COMMENT '更新版本号',
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`edit_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`creator` varchar(32) DEFAULT 'sys',
`editor` varchar(32) DEFAULT 'sys',
PRIMARY KEY (`id`),
KEY `index_job_config_id` (`job_config_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='flink任务配置历史变更表';
-- ----------------------------
-- Records of job_config_history
-- ----------------------------
BEGIN;
INSERT INTO `job_config_history` VALUES (1, 1, 'test_datagen_simple', 'LOCAL', '', 'CREATE TABLE source_table (\n f0 INT,\n f1 INT,\n f2 STRING\n) WITH (\n \'connector\' = \'datagen\',\n \'rows-per-second\'=\'5\'\n);\nCREATE TABLE print_table (\n f0 INT,\n f1 INT,\n f2 STRING\n) WITH (\n \'connector\' = \'print\'\n);\ninsert into print_table select f0,f1,f2 from source_table;\n', '', NULL, 77, 0, '2021-09-24 23:45:30', '2021-09-24 23:45:30', NULL, 'admin');
COMMIT;
-- ----------------------------
-- Table structure for job_run_log
-- ----------------------------
DROP TABLE IF EXISTS `job_run_log`;
CREATE TABLE `job_run_log` (
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
`job_config_id` bigint(11) NOT NULL,
`job_name` varchar(64) NOT NULL COMMENT '任务名称',
`deploy_mode` varchar(64) NOT NULL COMMENT '提交模式: standalone 、yarn 、yarn-session ',
`job_id` varchar(64) DEFAULT NULL COMMENT '运行后的任务id',
`local_log` mediumtext COMMENT '启动时本地日志',
`run_ip` varchar(64) DEFAULT NULL COMMENT '任务运行所在的机器',
`remote_log_url` varchar(128) DEFAULT NULL COMMENT '远程日志url的地址',
`start_time` datetime DEFAULT NULL COMMENT '启动时间',
`end_time` datetime DEFAULT NULL COMMENT '启动时间',
`job_status` varchar(32) DEFAULT NULL COMMENT '任务状态',
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`edit_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`creator` varchar(32) DEFAULT 'sys',
`editor` varchar(32) DEFAULT 'sys',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='运行任务日志';
-- ----------------------------
-- Table structure for savepoint_backup
-- ----------------------------
DROP TABLE IF EXISTS `savepoint_backup`;
CREATE TABLE `savepoint_backup` (
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
`job_config_id` bigint(11) NOT NULL,
`savepoint_path` varchar(2048) NOT NULL COMMENT '地址',
`backup_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '备份时间',
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`edit_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`creator` varchar(32) DEFAULT 'sys',
`editor` varchar(32) DEFAULT 'sys',
PRIMARY KEY (`id`),
KEY `index` (`job_config_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='savepoint备份地址';
-- ----------------------------
-- Table structure for system_config
-- ----------------------------
DROP TABLE IF EXISTS `system_config`;
CREATE TABLE `system_config` (
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
`key` varchar(128) NOT NULL COMMENT 'key值',
`val` varchar(512) NOT NULL COMMENT 'value',
`type` varchar(12) NOT NULL COMMENT '类型 如:sys alarm',
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`edit_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`creator` varchar(32) NOT NULL DEFAULT 'sys',
`editor` varchar(32) NOT NULL DEFAULT 'sys',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='系统配置';
-- ----------------------------
-- Records of system_config
-- ----------------------------
BEGIN;
INSERT INTO `system_config` VALUES (1, 'flink_home', '/data/projects/flink-1.13.2/', 'SYS', 0, '2020-11-12 10:42:02', '2021-09-24 22:11:01', 'sys', 'sys');
INSERT INTO `system_config` VALUES (2, 'flink_rest_http_address', 'http://127.0.0.1:8081/', 'SYS', 0, '2020-11-04 11:23:49', '2020-12-16 20:32:33', 'sys', 'sys');
INSERT INTO `system_config` VALUES (3, 'flink_streaming_platform_web_home', '/data/projects/flink-streaming-platform-web/', 'SYS', 0, '2020-10-16 16:08:58', '2021-09-24 22:12:42', 'sys', 'sys');
COMMIT;
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户名',
`password` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '密码',
`stauts` tinyint(1) NOT NULL COMMENT '1:启用 0: 停用',
`is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1:删除 0: 未删除',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`edit_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`creator` varchar(32) COLLATE utf8mb4_bin DEFAULT 'sys',
`editor` varchar(32) COLLATE utf8mb4_bin DEFAULT 'sys',
PRIMARY KEY (`id`),
UNIQUE KEY `index_uk` (`username`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 1, 0, '2020-07-10 22:15:04', '2020-11-11 22:53:26', 'sys', 'admin');
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;