diff --git a/README.md b/README.md
index 3e48559..56ea556 100644
--- a/README.md
+++ b/README.md
@@ -97,7 +97,7 @@ austin项目**强依赖**`MySQL`/`Redis`/(**大概需要2G内存**),**弱依
**8**、(可选)正常使用**定时任务**需要部署`xxl-job`,根据[部署文档](INSTALL.md)启动xxl的调度中心,并在`application.properteis`中填写 `austin.xxl.job.ip`和`austin.xxl.job.port`
-**9**、(可选)正常使用**分布式日志采集**需要部署`graylog`,根据[部署文档](INSTALL.md)启动`graylog`,并在`application.properteis`中填写 `austin.grayLog.ip`。
+**9**、(可选)正常使用**分布式日志采集**需要部署`graylog`,根据[部署文档](INSTALL.md)启动`graylog`,并在`application.properteis`中填写 `austin.graylog.ip`。
**10**、(可选)正常使用**系统监控**需要部署`promethus`和`grafana`,根据[部署文档](INSTALL.md)配置`grafana`图表。
diff --git a/austin-support/pom.xml b/austin-support/pom.xml
index 044423a..0abad69 100644
--- a/austin-support/pom.xml
+++ b/austin-support/pom.xml
@@ -118,6 +118,15 @@
com.github.binarywang
weixin-java-miniapp
+
+
+
+
+
+ io.github.ZhongFuCheng3y
+ hades-apollo-starter
+
+
\ No newline at end of file
diff --git a/austin-support/src/main/java/com/java3y/austin/support/utils/NacosUtils.java b/austin-support/src/main/java/com/java3y/austin/support/utils/NacosUtils.java
index 1dc6ee0..2b11efc 100644
--- a/austin-support/src/main/java/com/java3y/austin/support/utils/NacosUtils.java
+++ b/austin-support/src/main/java/com/java3y/austin/support/utils/NacosUtils.java
@@ -25,9 +25,9 @@ public class NacosUtils {
@NacosInjected
private ConfigService configService;
- @Value("${austin.nacos.group}")
+ @Value("${nacos.group}")
private String nacosGroup;
- @Value("${austin.nacos.dataId}")
+ @Value("${nacos.data-id}")
private String nacosDataId;
private final Properties properties = new Properties();
diff --git a/austin-web/src/main/java/com/java3y/austin/AustinApplication.java b/austin-web/src/main/java/com/java3y/austin/AustinApplication.java
index 93be36b..fc7e5ed 100644
--- a/austin-web/src/main/java/com/java3y/austin/AustinApplication.java
+++ b/austin-web/src/main/java/com/java3y/austin/AustinApplication.java
@@ -17,7 +17,7 @@ public class AustinApplication {
* 2、将application.properties配置文件的 austin.apollo.enabled 改为true
* 3、下方的property替换真实的ip和port
*/
- System.setProperty("apollo.config-service", "http://austin.apollo.config:5001");
+ System.setProperty("apollo.config-service", "http://austin-apollo-config:8080");
SpringApplication.run(AustinApplication.class, args);
}
}
diff --git a/austin-web/src/main/resources/application-dev.properties b/austin-web/src/main/resources/application-dev.properties
index ae16400..e0a6ac4 100644
--- a/austin-web/src/main/resources/application-dev.properties
+++ b/austin-web/src/main/resources/application-dev.properties
@@ -1,45 +1,20 @@
-# TODO please replace [must] config value
-# TODO please replace [must] config value
-# TODO please replace [must] config value
server.port=8080
-# todo [database] ip/port/username/password [must]
-austin.database.ip=austin.mysql
-austin.database.port=5004
-austin.database.username=root
-austin.database.password=root123_A
-
-# todo [redis] ip/port/password[must]
-austin.redis.ip=austin.redis
-austin.redis.port=5003
-austin.redis.password=austin
-
-# TODO choose : kafka/eventBus/rocketMq/rabbitMq, default eventBus
+# TODO choose : [kafka]/[eventBus]/[rocketMq]/[rabbitMq],recommend [eventBus] or [kafka]
austin.mq.pipeline=eventBus
-# todo [kafka] ip/port[optional], if austin.mq.pipeline=kafka [must]
-austin.kafka.ip=austin.kafka
-austin.kafka.port=9092
-
-# todo [rocketMq] [optional], if austin.mq.pipeline=rocketMq[must]
-austin.rocketmq.nameserver.ip=
-austin.rocketmq.nameserver.port=
-
-# todo [rabbitMq] [optional], if austin.mq.pipeline=rabbitMq[must]
-austin.rabbitmq.ip=
-austin.rabbitmq.port=
-
-# todo [xxl-job] switch [optional], if austin.xxl.job.enabled=true [must]
+# todo [xxl-job] switch
austin.xxl.job.enabled=false
-austin.xxl.job.ip=127.0.0.1
-austin.xxl.job.port=6767
-# todo choose: apollo/nacos switch [optional] ,if apollo and nacos both false, use local.properties
+# todo choose: [apollo]/[nacos] switch ,if [apollo] and [nacos] both false, use local.properties
austin.apollo.enabled=false
austin.nacos.enabled=false
-# todo [grayLog] ip [optional]
-austin.grayLog.ip=austin.graylog
+# TODO [hades] switch
+austin.rule.engine.enabled=false
+
+# TODO if windows os and need upload file to send message ,replace path !
+austin.business.upload.crowd.path=/Users/3y/temp
+
+
-# TODO if windows os and need upload file to send message ,replace path ![optional]
-austin.business.upload.crowd.path=/Users/3y/temp
\ No newline at end of file
diff --git a/austin-web/src/main/resources/application-test.properties b/austin-web/src/main/resources/application-test.properties
index 5ff5cc2..e583a0e 100644
--- a/austin-web/src/main/resources/application-test.properties
+++ b/austin-web/src/main/resources/application-test.properties
@@ -1,50 +1,22 @@
-# TODO please replace [must] config value
-# TODO please replace [must] config value
-# TODO please replace [must] config value
server.port=7777
-# docker mysql
-austin.database.ip=austin-mysql
-austin.database.port=3306
-austin.database.username=root
-austin.database.password=root123_A
-
-# docker redis
-austin.redis.ip=austin-redis
-austin.redis.port=6379
-austin.redis.password=austin
-
-# TODO choose : kafka/eventBus/rocketMq/rabbitMq, default eventBus
+# TODO choose : [kafka]/[eventBus]/[rocketMq]/[rabbitMq],recommend [eventBus] or [kafka]
austin.mq.pipeline=kafka
-# todo [kafka] ip/port[optional], if austin.mq.pipeline=kafka [must]
-austin.kafka.ip=austin-kafka
-austin.kafka.port=9092
-
-# todo [rocketMq] [optional], if austin.mq.pipeline=rocketMq[must]
-austin.rocketmq.nameserver.ip=
-austin.rocketmq.nameserver.port=
-
-# todo [rabbitMq] [optional], if austin.mq.pipeline=rabbitMq[must]
-austin.rabbitmq.ip=
-austin.rabbitmq.port=
-
-# todo [xxl-job] switch [optional], if austin.xxl.job.enabled=true [must]
+# todo [xxl-job] switch
austin.xxl.job.enabled=true
-austin.xxl.job.ip=austin-xxl-job
-austin.xxl.job.port=8080
-# todo choose: apollo/nacos switch [optional] ,if apollo and nacos both false, use local.properties
+# todo choose: [apollo]/[nacos] switch ,if [apollo] and [nacos] both false, use local.properties
austin.apollo.enabled=false
austin.nacos.enabled=false
-# todo [grayLog] ip [optional]
-austin.grayLog.ip=austin.graylog
+# TODO [hades] switch
+austin.rule.engine.enabled=false
-# TODO if windows os and need upload file to send message ,replace path ![optional]
+# TODO if windows os and need upload file to send message ,replace path !
austin.business.upload.crowd.path=/Users/3y/temp
-# TODO if [login use officialAccount] switch [optional], if austin.login.official.account.enable=true [must]
+# TODO if [login use officialAccount] switch [optional], if austin.login.official.account.enable=true
austin.login.official.account.enable=true
austin.login.official.account.appId=wx27f83ca10e06b325
austin.login.official.account.secret=203299484df873a18621d076db46fa99
diff --git a/austin-web/src/main/resources/application.properties b/austin-web/src/main/resources/application.properties
index 5a2ee21..5a30296 100644
--- a/austin-web/src/main/resources/application.properties
+++ b/austin-web/src/main/resources/application.properties
@@ -2,15 +2,24 @@ spring.profiles.active=dev
spring.application.name=austin
########################################## database start ##########################################
+# TODO required!
# notice:mysql version 5.7x !!!
-spring.datasource.url=jdbc:mysql://${austin.database.ip}:${austin.database.port}/austin?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
-spring.datasource.username=${austin.database.username}
-spring.datasource.password=${austin.database.password}
+spring.datasource.url=jdbc:mysql://${austin.database.ip:austin-mysql}:${austin.database.port:23306}/austin?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
+spring.datasource.username=${austin.database.username:root}
+spring.datasource.password=${austin.database.password:root123_A}
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
########################################## database end ##########################################
+########################################## redis start ##########################################
+# TODO required!
+spring.redis.host=${austin.redis.ip:austin-redis}
+spring.redis.port=${austin.redis.port:16379}
+spring.redis.password=${austin.redis.password:austin}
+########################################## redis end ##########################################
+
+
########################################## kafka start ##########################################
-spring.kafka.bootstrap-servers=${austin.kafka.ip}:${austin.kafka.port}
+spring.kafka.bootstrap-servers=${austin.kafka.ip:austin-kafka}:${austin.kafka.port:9092}
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer
@@ -31,7 +40,7 @@ austin.business.tagId.value=com.java3y.austin.3y
########################################## rocketMq start ##########################################
-rocketmq.name-server=${austin.rocketmq.nameserver.ip}:${austin.rocketmq.nameserver.port}
+rocketmq.name-server=${austin.rocketmq.nameserver.ip:}:${austin.rocketmq.nameserver.port:}
rocketmq.producer.group=unique-producer-group
austin.rocketmq.biz.consumer.group=unique-biz-consumer-group
austin.rocketmq.recall.consumer.group=unique-recall-consumer-group
@@ -39,8 +48,8 @@ austin.rocketmq.recall.consumer.group=unique-recall-consumer-group
########################################## RabbitMq start ##########################################
-spring.rabbitmq.host=${austin.rabbitmq.ip}
-spring.rabbitmq.port=${austin.rabbitmq.port}
+spring.rabbitmq.host=${austin.rabbitmq.ip:}
+spring.rabbitmq.port=${austin.rabbitmq.port:}
spring.rabbitmq.username=root
spring.rabbitmq.password=123456
spring.rabbitmq.publisher-confirm-type=correlated
@@ -50,15 +59,9 @@ austin.rabbitmq.topic.name=austinRabbit
austin.rabbitmq.exchange.name=austin.point
########################################## RabbitMq end ##########################################
-########################################## redis start ##########################################
-spring.redis.host=${austin.redis.ip}
-spring.redis.port=${austin.redis.port}
-spring.redis.password=${austin.redis.password}
-########################################## redis end ##########################################
-
########################################## xxl start ##########################################
-xxl.job.admin.addresses=http://${austin.xxl.job.ip}:${austin.xxl.job.port}/xxl-job-admin
+xxl.job.admin.addresses=http://${austin.xxl.job.ip:austin-xxl-job}:${austin.xxl.job.port:8080}/xxl-job-admin
xxl.job.admin.username=admin
xxl.job.admin.password=123456
xxl.job.executor.appname=austin
@@ -77,16 +80,22 @@ apollo.bootstrap.namespaces=boss.austin,dynamic-tp-apollo-dtp.yml
########################################## apollo end ##########################################
########################################## nacos start ##########################################
-nacos.config.server-addr=austin.nacos:8848
-nacos.config.username=nacos
-nacos.config.password=nacos
-nacos.config.namespace=9537c674-f3a6-4203-b286-ef0c36bfacb2
-
-austin.nacos.dataId=austin
-austin.nacos.group=DEFAULT_GROUP
+nacos.config.server-addr=${austin.nacos.addr.ip:austin-nacos}:${austin.nacos.addr.port:8848}
+nacos.config.username=${austin.nacos.username:nacos}
+nacos.config.password=${austin.nacos.password:nacos}
+nacos.config.namespace=${austin.nacos.namespace:7df088cb-2221-4f8d-8ce5-b37e96055ad8}
+nacos.data-id=${austin.nacos.dataId:austin}
+nacos.group=${austin.nacos.group:DEFAULT_GROUP}
nacos.config.enabled=${austin.nacos.enabled}
########################################## nacos end ##########################################
+########################################## rule Engine start ##########################################
+hades.main.config.enabled=${austin.rule.engine.enabled:false}
+hades.main.config.file-name=hades
+hades.main.config.group-name=hades
+########################################## rule Engine end ##########################################
+
+
########################################## httpUtils start ##########################################
ok.http.connect-timeout=30
ok.http.keep-alive-duration=300
@@ -108,4 +117,6 @@ management.health.rabbit.enabled=false
server.shutdown=graceful
########################################## system end ##########################################
-austin.grayLog.ip=austin.graylog
\ No newline at end of file
+########################################## log start ##########################################
+austin.grayLog.ip=${austin.graylog:austin-graylog}
+########################################## log end ##########################################
\ No newline at end of file
diff --git a/austin-web/src/main/resources/logback.xml b/austin-web/src/main/resources/logback.xml
index 68c13ad..2771f43 100644
--- a/austin-web/src/main/resources/logback.xml
+++ b/austin-web/src/main/resources/logback.xml
@@ -7,7 +7,7 @@
-
+
@@ -37,7 +37,7 @@
1000MB
- 7
+ 4
@@ -63,7 +63,7 @@
1000MB
- 7
+ 4
diff --git a/docker-compose.yml b/docker-compose.yml
index 84dcb03..c94d057 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -14,13 +14,13 @@ services:
volumes:
- ./sql/austin.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- - "23306:3306"
+ - "3306:3306"
networks:
- app
austin-redis:
image: redis:3.2
ports:
- - "16379:6379"
+ - "6379:6379"
restart: always
container_name: austin-redis
volumes:
@@ -104,6 +104,33 @@ services:
- app
depends_on:
- austin-mysql
+ austin-nacos:
+ container_name: austin-nacos-server
+ image: nacos/nacos-server:v2.1.0
+ environment:
+ - MODE=standalone
+ - PREFER_HOST_MODE=hostname
+ - SPRING_DATASOURCE_PLATFORM=mysql
+ - MYSQL_SERVICE_HOST=austin-mysql
+ - MYSQL_SERVICE_PORT=3306
+ - MYSQL_SERVICE_USER=root
+ - MYSQL_SERVICE_PASSWORD=root123_A
+ - MYSQL_SERVICE_DB_NAME=nacos_config
+ - JVM_XMS=128m
+ - JVM_XMX=128m
+ - JVM_XMN=128m
+ volumes:
+ - /home/nacos/single-logs/nacos-server:/home/nacos/logs
+ - /home/nacos/init.d:/home/nacos/init.d
+ ports:
+ - 8848:8848
+ - 9848:9848
+ - 9849:9849
+ depends_on:
+ - austin-mysql
+ restart: on-failure
+ networks:
+ - app
austin:
build:
context: ./
@@ -121,6 +148,7 @@ services:
- austin-zookeeper
- austin-kafka
- austin-xxl-job
+ - austin-nacos
networks:
- app
networks:
diff --git a/docker/nacos/single/docker-compose.yml b/docker/nacos/single/docker-compose.yml
index 225d433..d930f29 100644
--- a/docker/nacos/single/docker-compose.yml
+++ b/docker/nacos/single/docker-compose.yml
@@ -4,16 +4,16 @@ services:
nacos1:
container_name: nacos-server
hostname: nacos-server
- image: nacos/nacos-server
+ image: nacos/nacos-server:v2.1.0
environment:
- MODE=standalone
- PREFER_HOST_MODE=hostname
- SPRING_DATASOURCE_PLATFORM=mysql
- - MYSQL_SERVICE_HOST=mysql
+ - MYSQL_SERVICE_HOST=austin-mysql
- MYSQL_SERVICE_PORT=3306
- MYSQL_SERVICE_USER=root
- - MYSQL_SERVICE_PASSWORD=123456
- - MYSQL_SERVICE_DB_NAME=nacos-db
+ - MYSQL_SERVICE_PASSWORD=root123_A
+ - MYSQL_SERVICE_DB_NAME=nacos_config
- JVM_XMS=128m
- JVM_XMX=128m
- JVM_XMN=128m
diff --git a/pom.xml b/pom.xml
index 1208e46..821df11 100644
--- a/pom.xml
+++ b/pom.xml
@@ -216,6 +216,16 @@
rocketmq-spring-boot-starter
2.2.2
+
+ io.github.ZhongFuCheng3y
+ hades-nacos-starter
+ 1.0.2
+
+
+ io.github.ZhongFuCheng3y
+ hades-apollo-starter
+ 1.0.2
+
diff --git a/sql/austin.sql b/sql/austin.sql
index 61569b1..370f89c 100644
--- a/sql/austin.sql
+++ b/sql/austin.sql
@@ -1,3 +1,4 @@
+/****************austin start**************************/
drop database if exists austin;
create database austin;
@@ -82,7 +83,9 @@ CREATE TABLE `channel_account`
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT ='渠道账号信息';
+/****************austin end**************************/
+/****************xxl-job start**************************/
CREATE database if NOT EXISTS `xxl_job` default character set utf8mb4 collate utf8mb4_unicode_ci;
use `xxl_job`;
@@ -208,4 +211,197 @@ INSERT INTO `xxl_job_info`(`id`, `job_group`, `job_desc`, `add_time`, `update_ti
INSERT INTO `xxl_job_user`(`id`, `username`, `password`, `role`, `permission`) VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 1, NULL);
INSERT INTO `xxl_job_lock` ( `lock_name`) VALUES ( 'schedule_lock');
-commit;
+/****************xxl-job end**************************/
+
+drop database if exists nacos_config;
+create database nacos_config;
+use nacos_config;
+/****************nacos start**************************/
+CREATE TABLE `config_info`
+(
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `data_id` varchar(255) NOT NULL COMMENT 'data_id',
+ `group_id` varchar(255) DEFAULT NULL,
+ `content` longtext NOT NULL COMMENT 'content',
+ `md5` varchar(32) DEFAULT NULL COMMENT 'md5',
+ `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
+ `src_user` text COMMENT 'source user',
+ `src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip',
+ `app_name` varchar(128) DEFAULT NULL,
+ `tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',
+ `c_desc` varchar(256) DEFAULT NULL,
+ `c_use` varchar(64) DEFAULT NULL,
+ `effect` varchar(64) DEFAULT NULL,
+ `type` varchar(64) DEFAULT NULL,
+ `encrypted_data_key` varchar(255) DEFAULT NULL,
+ `c_schema` text,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uk_configinfo_datagrouptenant` (`data_id`,`group_id`,`tenant_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info';
+
+CREATE TABLE `config_info_aggr`
+(
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `data_id` varchar(255) NOT NULL COMMENT 'data_id',
+ `group_id` varchar(255) NOT NULL COMMENT 'group_id',
+ `datum_id` varchar(255) NOT NULL COMMENT 'datum_id',
+ `content` longtext NOT NULL COMMENT '内容',
+ `gmt_modified` datetime NOT NULL COMMENT '修改时间',
+ `app_name` varchar(128) DEFAULT NULL,
+ `tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uk_configinfoaggr_datagrouptenantdatum` (`data_id`,`group_id`,`tenant_id`,`datum_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='增加租户字段';
+
+
+
+CREATE TABLE `config_info_beta`
+(
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `data_id` varchar(255) NOT NULL COMMENT 'data_id',
+ `group_id` varchar(128) NOT NULL COMMENT 'group_id',
+ `app_name` varchar(128) DEFAULT NULL COMMENT 'app_name',
+ `content` longtext NOT NULL COMMENT 'content',
+ `beta_ips` varchar(1024) DEFAULT NULL COMMENT 'betaIps',
+ `md5` varchar(32) DEFAULT NULL COMMENT 'md5',
+ `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
+ `src_user` text COMMENT 'source user',
+ `src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip',
+ `tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uk_configinfobeta_datagrouptenant` (`data_id`,`group_id`,`tenant_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info_beta';
+
+
+CREATE TABLE `config_info_tag`
+(
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `data_id` varchar(255) NOT NULL COMMENT 'data_id',
+ `group_id` varchar(128) NOT NULL COMMENT 'group_id',
+ `tenant_id` varchar(128) DEFAULT '' COMMENT 'tenant_id',
+ `tag_id` varchar(128) NOT NULL COMMENT 'tag_id',
+ `app_name` varchar(128) DEFAULT NULL COMMENT 'app_name',
+ `content` longtext NOT NULL COMMENT 'content',
+ `md5` varchar(32) DEFAULT NULL COMMENT 'md5',
+ `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
+ `src_user` text COMMENT 'source user',
+ `src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uk_configinfotag_datagrouptenanttag` (`data_id`,`group_id`,`tenant_id`,`tag_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info_tag';
+
+
+CREATE TABLE `config_tags_relation`
+(
+ `id` bigint(20) NOT NULL COMMENT 'id',
+ `tag_name` varchar(128) NOT NULL COMMENT 'tag_name',
+ `tag_type` varchar(64) DEFAULT NULL COMMENT 'tag_type',
+ `data_id` varchar(255) NOT NULL COMMENT 'data_id',
+ `group_id` varchar(128) NOT NULL COMMENT 'group_id',
+ `tenant_id` varchar(128) DEFAULT '' COMMENT 'tenant_id',
+ `nid` bigint(20) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`nid`),
+ UNIQUE KEY `uk_configtagrelation_configidtag` (`id`,`tag_name`,`tag_type`),
+ KEY `idx_tenant_id` (`tenant_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_tag_relation';
+
+
+CREATE TABLE `group_capacity`
+(
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+ `group_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'Group ID,空字符表示整个集群',
+ `quota` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '配额,0表示使用默认值',
+ `usage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
+ `max_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',
+ `max_aggr_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数,,0表示使用默认值',
+ `max_aggr_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',
+ `max_history_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
+ `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uk_group_id` (`group_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='集群、各Group容量信息表';
+
+
+CREATE TABLE `his_config_info`
+(
+ `id` bigint(64) unsigned NOT NULL,
+ `nid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+ `data_id` varchar(255) NOT NULL,
+ `group_id` varchar(128) NOT NULL,
+ `app_name` varchar(128) DEFAULT NULL COMMENT 'app_name',
+ `content` longtext NOT NULL,
+ `md5` varchar(32) DEFAULT NULL,
+ `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `src_user` text,
+ `src_ip` varchar(50) DEFAULT NULL,
+ `op_type` char(10) DEFAULT NULL,
+ `tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',
+ `encrypted_data_key` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`nid`),
+ KEY `idx_gmt_create` (`gmt_create`),
+ KEY `idx_gmt_modified` (`gmt_modified`),
+ KEY `idx_did` (`data_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='多租户改造';
+
+
+CREATE TABLE `tenant_capacity`
+(
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+ `tenant_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'Tenant ID',
+ `quota` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '配额,0表示使用默认值',
+ `usage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
+ `max_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',
+ `max_aggr_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数',
+ `max_aggr_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',
+ `max_history_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
+ `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uk_tenant_id` (`tenant_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='租户容量信息表';
+
+
+CREATE TABLE `tenant_info`
+(
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `kp` varchar(128) NOT NULL COMMENT 'kp',
+ `tenant_id` varchar(128) default '' COMMENT 'tenant_id',
+ `tenant_name` varchar(128) default '' COMMENT 'tenant_name',
+ `tenant_desc` varchar(256) DEFAULT NULL COMMENT 'tenant_desc',
+ `create_source` varchar(32) DEFAULT NULL COMMENT 'create_source',
+ `gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
+ `gmt_modified` bigint(20) NOT NULL COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uk_tenant_info_kptenantid` (`kp`,`tenant_id`),
+ KEY `idx_tenant_id` (`tenant_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='tenant_info';
+
+CREATE TABLE `users`
+(
+ `username` varchar(50) NOT NULL PRIMARY KEY,
+ `password` varchar(500) NOT NULL,
+ `enabled` boolean NOT NULL
+);
+
+CREATE TABLE `roles`
+(
+ `username` varchar(50) NOT NULL,
+ `role` varchar(50) NOT NULL,
+ UNIQUE INDEX `idx_user_role` (`username` ASC, `role` ASC) USING BTREE
+);
+
+CREATE TABLE `permissions`
+(
+ `role` varchar(50) NOT NULL,
+ `resource` varchar(255) NOT NULL,
+ `action` varchar(8) NOT NULL,
+ UNIQUE INDEX `uk_role_permission` (`role`,`resource`,`action`) USING BTREE
+);
+
+INSERT INTO users (username, password, enabled) VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', TRUE);
+INSERT INTO roles (username, role) VALUES ('nacos', 'ROLE_ADMIN');
\ No newline at end of file