From 523573fa350f2c458093d02408b14947fe457e5a Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 8 Oct 2023 11:55:38 +0200 Subject: [PATCH] Vorgegebene Konfiguration aus dem "Getting Started" * https://github.com/xaecbd/KCenter/blob/master/KCenter-Core/sql/table_script.sql[table_script.sql] * https://github.com/xaecbd/KCenter/blob/master/KCenter-Core/src/main/resources/application.properties[application.propertis] --- docker/application.properties | 141 ++++++++++++++++++++ docker/table_script.sql | 235 ++++++++++++++++++++++++++++++++++ 2 files changed, 376 insertions(+) create mode 100644 docker/application.properties create mode 100644 docker/table_script.sql diff --git a/docker/application.properties b/docker/application.properties new file mode 100644 index 0000000..a1dd146 --- /dev/null +++ b/docker/application.properties @@ -0,0 +1,141 @@ +# ---------------------------------------------- +# MAIN APPLICATION CONFIG + +# url and port where application is published +server.port=8080 +public.url=http://localhost:8080 + +# enable/disable debug logging level +debug=false + +# session timeout in seconds (21600 = 6 hours) +server.servlet.session.timeout=21600 + +# admin user/password to manage KafkaCenter +spring.security.user.name=admin +spring.security.user.password=admin + +# url and user/password for mysql database +# if remote, make sure the user has adequate privileges (google "mysql grant privileges") +spring.datasource.url=jdbc:mysql://127.0.0.1:3306/kafka_center?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC +spring.datasource.username=root +spring.datasource.password=123456 + + +# ---------------------------------------------- +# MONITOR + +# enable/disable functionality +monitor.enable=true + +# statistic collection frequency +monitor.collect.period.minutes=5 + +# elasticsearch config +monitor.elasticsearch.hosts=localhost:9200 +monitor.elasticsearch.index=kafka_center_monitor +#monitor.elasticsearch.auth.user= +#monitor.elasticsearch.auth.password= + + +# ---------------------------------------------- +# ALERTS + +# enable/disable functionality to send consumer group lag alerts +alert.enable=false + +# url of alert service (leave empty for regular internal application) +alert.service= + +# default time window and threshold +alert.dispause=2 + +# default threshold +alert.threshold=1000 + +# environment variable included in alerts +alter.env=other + + +# ---------------------------------------------- +# EMAILS + +# enable/disable functionality to trigger emails for alerts +mail.enable=false + +# configuration of external mail host +spring.mail.host= +spring.mail.username=KafkaCenter@xaecbd.com +#spring.mail.password=xxxix + + +# ---------------------------------------------- +# KAFKA CONNECT + +# url where kafka connect is installed +connect.url=http://localhost:8000/#/ + + +# ---------------------------------------------- +# OAUTH2 KAFKACENTER LOGIN + +# enable/disable functionality to log into application via external oauth service +generic.enabled=false + +# name of service on login page +generic.name=oauth2 Login + +# settings of external oauth service +generic.auth_url= +generic.token_url= +generic.redirect_utl= +generic.api_url= +generic.client_id= +generic.client_secret= +generic.scopes= + + +# ---------------------------------------------- +# VARIOUS ADVANCED CONFIGS + +# default kafka topic retention time +system.topic.ttl.h=16 + +# enable/disable default spring boot actuator health indicators +management.health.defaults.enabled=false + +# hikari connection pool configurations +spring.datasource.type=com.zaxxer.hikari.HikariDataSource +spring.datasource.hikari.minimum-idle=5 +spring.datasource.hikari.maximum-pool-size=15 +spring.datasource.hikari.pool-name=KafkaCenterHikariCP +spring.datasource.hikari.max-lifetime=30000 +spring.datasource.hikari.connection-test-query=SELECT 1 + +# mysql driver +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +# enable/disable collecting list of kafka topics regularly, and set interval of collection +collect.topic.enable=true +collect.topic.period.minutes=10 + +# enable/disable that collection threads only collect metrics of certain cluster locations +# the location specified must be one of remote.locations below +monitor.collector.include.enable=false +monitor.collector.include.location=dev + +# enable remote querying to improve lag collection behaviour, solving problems induced by latency between different locations +remote.query.enable=false +remote.hosts=gqc@localhost2:8080 +remote.locations=dev,gqc + +# enable/disable collecting list of ksql job regularly, and set interval of collection +collect.ksql.info.job.enable=false +collect.ksql.info.job.period.minutes=5 + +# enable/disable collecting list of connector job regularly, and set interval of collection +collect.connector.job.enable=false +collect.connector.job.period.minutes=4 + +# alert group api for alert +alert.alarm.group.api= \ No newline at end of file diff --git a/docker/table_script.sql b/docker/table_script.sql new file mode 100644 index 0000000..6dc7148 --- /dev/null +++ b/docker/table_script.sql @@ -0,0 +1,235 @@ + +-- Dumping database structure for kafka_center +CREATE DATABASE IF NOT EXISTS `kafka_center` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */; +USE `kafka_center`; + + +-- Dumping structure for table kafka_center.alert_group +CREATE TABLE IF NOT EXISTS `alert_group` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cluster_id` int(11) NOT NULL, + `topic_name` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', + `consummer_group` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', + `consummer_api` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', + `threshold` int(11) DEFAULT NULL, + `dispause` int(11) DEFAULT NULL, + `mail_to` varchar(1000) COLLATE utf8_bin NOT NULL DEFAULT '', + `webhook` varchar(1000) COLLATE utf8_bin NOT NULL DEFAULT '', + `create_date` datetime DEFAULT NULL, + `owner_id` int(11) DEFAULT NULL, + `team_id` int(11) DEFAULT NULL, + `disable_alerta` tinyint(1) DEFAULT 0, + `enable` tinyint(1) NOT NULL DEFAULT 1, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +-- Data exporting was unselected. + + +-- Dumping structure for table kafka_center.cluster_info +CREATE TABLE IF NOT EXISTS `cluster_info` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) COLLATE utf8_bin NOT NULL, + `zk_address` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', + `broker` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', + `create_time` datetime DEFAULT NULL, + `comments` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', + `enable` int(11) DEFAULT NULL, + `broker_size` int(4) DEFAULT 0, + `kafka_version` varchar(10) COLLATE utf8_bin DEFAULT '', + `location` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', + `graf_addr` varchar(255) COLLATE utf8_bin DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +-- Data exporting was unselected. + + +-- Dumping structure for table kafka_center.ksql_info +CREATE TABLE IF NOT EXISTS `ksql_info` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cluster_id` int(11) DEFAULT NULL, + `cluster_name` varchar(255) DEFAULT NULL, + `ksql_url` varchar(255) DEFAULT NULL, + `ksql_serverId` varchar(255) DEFAULT NULL, + `version` varchar(255) DEFAULT NULL, + `team_ids` varchar(200) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8; +-- Data exporting was unselected. + + +-- Dumping structure for table kafka_center.task_info +CREATE TABLE IF NOT EXISTS `task_info` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cluster_ids` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', + `location` varchar(20) COLLATE utf8_bin NOT NULL DEFAULT '', + `topic_name` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', + `partition` int(11) DEFAULT NULL, + `replication` int(11) DEFAULT NULL, + `message_rate` int(50) DEFAULT NULL, + `ttl` int(11) DEFAULT NULL, + `owner_id` int(11) DEFAULT NULL, + `team_id` int(11) DEFAULT NULL, + `comments` varchar(1000) COLLATE utf8_bin NOT NULL DEFAULT '', + `create_time` datetime DEFAULT NULL, + `approved` int(11) DEFAULT NULL, + `approved_id` int(11) DEFAULT NULL, + `approved_time` datetime DEFAULT NULL, + `approval_opinions` varchar(1000) COLLATE utf8_bin DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +-- Data exporting was unselected. + + +-- Dumping structure for table kafka_center.team_info +CREATE TABLE IF NOT EXISTS `team_info` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', + `own` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', + `alarm_group` varchar(255) COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +-- Data exporting was unselected. + + +-- Dumping structure for table kafka_center.topic_collection +CREATE TABLE IF NOT EXISTS `topic_collection` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `cluster_id` int(11) NOT NULL, + `user_id` int(11) NOT NULL, + `name` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', + `type` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +-- Data exporting was unselected. + + +-- Dumping structure for table kafka_center.topic_info +CREATE TABLE IF NOT EXISTS `topic_info` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cluster_id` int(11) NOT NULL, + `topic_name` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', + `partition` int(11) DEFAULT NULL, + `replication` int(11) DEFAULT NULL, + `ttl` bigint(11) DEFAULT NULL, + `config` varchar(512) COLLATE utf8_bin DEFAULT NULL, + `owner_id` int(11) DEFAULT NULL, + `team_id` int(11) DEFAULT NULL, + `comments` varchar(1000) COLLATE utf8_bin NOT NULL DEFAULT '', + `create_time` datetime DEFAULT NULL, + `file_size` bigint(20) NOT NULL DEFAULT -1, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +-- Data exporting was unselected. + + +-- Dumping structure for table kafka_center.user_info +CREATE TABLE IF NOT EXISTS `user_info` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', + `real_name` varchar(255) COLLATE utf8_bin DEFAULT '', + `email` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', + `role` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '100', + `create_time` datetime DEFAULT NULL, + `password` varchar(255) COLLATE utf8_bin DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +-- Data exporting was unselected. + + +-- Dumping structure for table kafka_center.user_team +CREATE TABLE IF NOT EXISTS `user_team` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) DEFAULT NULL, + `team_id` int(11) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +-- Data exporting was unselected. + +-- Dumping structure for table kafka_center.ksql_history +CREATE TABLE IF NOT EXISTS `ksql_history` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `ksql_server_id` varchar(255) DEFAULT NULL, + `user` varchar(255) DEFAULT NULL, + `date` datetime DEFAULT current_timestamp(), + `operate` text DEFAULT NULL, + `type` varchar(255) DEFAULT NULL, + `script` text DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8mb4; + +-- Dumping structure for table kafka_center.ksql_info +CREATE TABLE IF NOT EXISTS `ksql_info` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cluster_id` int(11) DEFAULT NULL, + `cluster_name` varchar(255) DEFAULT NULL, + `ksql_url` varchar(255) DEFAULT NULL, + `ksql_serverId` varchar(255) DEFAULT NULL, + `version` varchar(255) DEFAULT NULL, + `team_ids` varchar(200) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8mb4; + +-- Dumping structure for table kafka_center.kstream +CREATE TABLE IF NOT EXISTS `kstream` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(233) NOT NULL, + `team_id` int(11) DEFAULT NULL, + `cluster_id` int(11) DEFAULT NULL, + `owner_id` int(11) DEFAULT NULL, + `stream_type` int(11) DEFAULT NULL, + `config` varchar(255) DEFAULT NULL, + `topic` varchar(255) DEFAULT NULL, + `script` text DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + KEY `id` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=579 DEFAULT CHARSET=utf8mb4; + +-- Dumping structure for table kafka_center.ktable +CREATE TABLE IF NOT EXISTS `ktable` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `cluster_id` int(10) DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `script` mediumtext DEFAULT NULL, + `topic` varchar(240) DEFAULT NULL, + `owner_id` int(10) DEFAULT NULL, + `team_id` int(10) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=238 DEFAULT CHARSET=utf8mb4; + +-- Dumping structure for table kafka_center.connect_info +CREATE TABLE IF NOT EXISTS `connect_info` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `name` varchar(200) DEFAULT NULL, + `cluster_id` int(10) DEFAULT NULL, + `url` varchar(255) DEFAULT NULL, + `version` varchar(20) DEFAULT NULL, + `create_time` datetime DEFAULT current_timestamp(), + `team_ids` varchar(20) DEFAULT NULL, + `connectors` int(20) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4; + +-- Dumping structure for table kafka_center.connect_job +CREATE TABLE IF NOT EXISTS `connect_job` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `name` varchar(200) DEFAULT NULL, + `cluster_id` int(20) DEFAULT NULL, + `type` varchar(50) DEFAULT NULL, + `class_name` varchar(255) DEFAULT NULL, + `state` varchar(100) DEFAULT NULL, + `script` mediumtext DEFAULT NULL, + `owner_id` int(20) DEFAULT NULL, + `team_id` int(20) DEFAULT NULL, + `create_time` datetime DEFAULT current_timestamp(), + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=794 DEFAULT CHARSET=utf8mb4; -- 2.20.1