diff --git a/.erda/migrations/msp/20200528-tmc-base.sql b/.erda/migrations/msp/20200528-tmc-base.sql index 374536b27d6..2ebe460db20 100644 --- a/.erda/migrations/msp/20200528-tmc-base.sql +++ b/.erda/migrations/msp/20200528-tmc-base.sql @@ -1,6 +1,6 @@ # MIGRATION_BASE -CREATE TABLE `sp_account` ( +CREATE TABLE IF NOT EXISTS `sp_account` ( `id` int(11) NOT NULL AUTO_INCREMENT, `auth_id` int(11) DEFAULT NULL, `username` varchar(255) DEFAULT NULL, @@ -11,7 +11,7 @@ CREATE TABLE `sp_account` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='主动监控存储用户账号表,已废弃'; -CREATE TABLE `sp_authentication` ( +CREATE TABLE IF NOT EXISTS `sp_authentication` ( `id` int(11) NOT NULL AUTO_INCREMENT, `project_id` int(11) unsigned zerofill DEFAULT NULL, `name` varchar(255) DEFAULT NULL, @@ -22,7 +22,7 @@ CREATE TABLE `sp_authentication` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='主动监控存储用户认证的表,已废弃'; -CREATE TABLE `sp_chart_meta` ( +CREATE TABLE IF NOT EXISTS `sp_chart_meta` ( `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键', `name` varchar(64) NOT NULL, `title` varchar(64) NOT NULL, @@ -39,7 +39,7 @@ CREATE TABLE `sp_chart_meta` ( INSERT INTO `sp_chart_meta` (`id`, `name`, `title`, `metricsName`, `fields`, `parameters`, `type`, `order`, `unit`) VALUES (1,'ta_timing','','ta_timing','','','0',0,'ms'),(2,'ta_req','','ta_req','','','0',0,'ms'),(3,'ta_performance','性能区间','ta_timing','{\"avg.plt\": { \"label\":\"整页加载\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }, \n\"avg.tcp\": { \"label\":\"请求排队\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.rlt\": { \"label\":\"资源加载\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.srt\": { \"label\":\"服务器响应\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,'ms'),(4,'ta_apdex','用户体验','ta_timing','','','0',0,'ms'),(5,'ta_plt_grade','整页加载完成','ta_timing','','','0',0,'ms'),(6,'ta_wst_grade','白屏时间','ta_timing','','','0',0,'ms'),(7,'ta_fst_grade','首屏时间','ta_timing','','','0',0,'ms'),(8,'ta_rct_grade','资源加载完成','ta_timing','','','0',0,'ms'),(9,'ta_pct_grade','网页加载完成','ta_timing','','','0',0,'ms'),(10,'ta_values_grade','对比分析','ta_timing','{\"count.plt\": { \"label\":\"整页加载完成\", \"unit\": \"\", \"unit_type\": \"precent\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"count.wst\": { \"label\":\"白屏时间\", \"unit\": \"%\", \"unit_type\": \"precent\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"count.fst\": { \"label\":\"首屏时间\", \"unit\": \"%\", \"unit_type\": \"precent\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"count.rct\": { \"label\":\"资源加载完成\", \"unit\": \"%\", \"unit_type\": \"precent\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"count.pct\": { \"label\":\"网页加载完成\", \"unit\": \"%\", \"unit_type\": \"precent\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,'ms'),(11,'ta_page_timing','页面性能趋势','ta_timing','{ \"count.plt\": { \"label\":\"PV\", \"unit\": \"\", \"unit_type\": \"count\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.plt\": { \"label\":\"响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 1 }}','','0',0,'ms'),(12,'ta_ajax_timing','Ajax性能趋势','ta_req','{ \"count.tt\": { \"label\":\"PV\", \"unit\": \"\", \"unit_type\": \"count\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.tt\": { \"label\":\"响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 1 }}','','0',0,'ms'),(13,'ta_map','地图','ta_timing','','','0',0,'ms'),(14,'ta_top_avg_time','平均时间','ta_timing','{\"avg.pct\": { \"label\":\"网页加载完成\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.plt\": { \"label\":\"整页加载\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.wst\": { \"label\":\"白屏时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.fst\": { \"label\":\"首屏时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.rct\": { \"label\":\"资源加载完成\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,'ms'),(15,'ta_top_percent_time','时间百分比','ta_timing','{\"sumPercent.pct\": { \"label\":\"网页加载完成\", \"unit\": \"%\", \"unit_type\": \"percent\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"sumPercent.plt\": { \"label\":\"整页加载\", \"unit\": \"%\", \"unit_type\": \"percent\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"sumPercent.wst\": { \"label\":\"白屏时间\", \"unit\": \"%\", \"unit_type\": \"percent\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"sumPercent.fst\": { \"label\":\"首屏时间\", \"unit\": \"%\", \"unit_type\": \"percent\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"sumPercent.rct\": { \"label\":\"资源加载完成\", \"unit\": \"%\", \"unit_type\": \"percent\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,'ms'),(16,'ta_top_cpm','时间吞吐量','ta_timing','{\"cpm.pct\": { \"label\":\"网页加载完成\", \"unit\": \"cpm\", \"unit_type\": \"cpm\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"cpm.plt\": { \"label\":\"整页加载\", \"unit\": \"cpm\", \"unit_type\": \"cpm\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"cpm.wst\": { \"label\":\"白屏时间\", \"unit\": \"cpm\", \"unit_type\": \"cpm\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"cpm.fst\": { \"label\":\"首屏时间\", \"unit\": \"cpm\", \"unit_type\": \"cpm\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"cpm.rct\": { \"label\":\"资源加载完成\", \"unit\": \"cpm\", \"unit_type\": \"cpm\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,'ms'),(17,'ta_req_top_avg_time','平均时间','ta_req','{\"avg.tt\": { \"label\":\"请求耗时\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,'ms'),(18,'ta_req_top_percent_time','时间百分比','ta_req','{\"sumPercent.tt\": { \"label\":\"请求耗时\", \"unit\": \"%\", \"unit_type\": \"percent\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,'ms'),(19,'ta_req_top_cpm','时间吞吐量','ta_req','{\"cpm.tt\": { \"label\":\"请求耗时\", \"unit\": \"cpm\", \"unit_type\": \"cpm\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,'ms'),(20,'ta_avg_time','平均时间','ta_timing','{ \"avg.plt\": { \"label\":\"整页加载\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,'ms'),(21,'ta_cpm','吞吐量','ta_timing','{ \"cpm.plt\": { \"label\":\"吞吐量\", \"unit\": \"cpm\", \"unit_type\": \"cpm\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,'ms'),(22,'ta_percent_os','操作系统','ta_timing','','','0',0,'ms'),(23,'ta_percent_device','设备','ta_timing','','','0',0,'ms'),(24,'ta_percent_browser','浏览器','ta_timing','','','0',0,'ms'),(25,'ta_percent_host','域名','ta_timing','','','0',0,'ms'),(26,'ta_percent_page','页面','ta_timing','','','0',0,'ms'),(27,'ta_req_avg_time','平均时间','ta_req','{ \"avg.tt\": { \"label\":\"请求耗时\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,'ms'),(28,'ta_req_cpm','吞吐量','ta_req','{ \"cpm.tt\": { \"label\":\"吞吐量\", \"unit\": \"cpm\", \"unit_type\": \"cpm\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,'ms'),(29,'ta_req_send','发送数据','ta_req','{ \"sum.res\": { \"label\":\"发送数据\", \"unit\": \"KB\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,'kb'),(30,'ta_req_recv','接收数据','ta_req','{ \"sum.req\": { \"label\":\"接收数据\", \"unit\": \"KB\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,'kb'),(31,'ta_req_status','HTTP状态码','ta_req','{ \"count.req\": { \"label\":\"HTTP状态码\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,''),(32,'ta_summary_info','摘要详情','ta_timing','{\"count.plt\": { \"label\":\"PV\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"\", \"axis_index\": 0 }, \n\"sum.rdc\": { \"label\":\"DNS解析次数\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.plt\": { \"label\":\"最终用户体验时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.dit\": { \"label\":\"HTML完成构建\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.drt\": { \"label\":\"阻塞资源加载耗时\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.wst\": { \"label\":\"白屏幕时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.put\": { \"label\":\"页面卸载\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.rrt\": { \"label\":\"页面跳转\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.act\": { \"label\":\"查询缓存\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.dns\": { \"label\":\"查询DNS\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.tcp\": { \"label\":\"建立tcp连接\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.srt\": { \"label\":\"服务器响应\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.rpt\": { \"label\":\"页面下载\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.clt\": { \"label\":\"load事件\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.set\": { \"label\":\"脚本执行\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,'ms'),(33,'status_page','','status_page','','','0',0,''),(34,'ta_script_error','脚本错误','ta_error','{ \"count.count\": { \"label\":\"错误次数\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,''),(35,'ta_top_script_error','错误信息','ta_error','{ \"count.count\": { \"label\":\"错误次数\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,''),(36,'ta_top_page_script_error','错误页面','ta_error','{ \"count.count\": { \"label\":\"错误次数\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,''),(37,'ta_top_js_script_error','JavaScript报错次数','ta_error','{ \"count.count\": { \"label\":\"错误次数\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,''),(38,'ta_top_browser_script_error','浏览器报错次数','ta_error','{ \"count.count\": { \"label\":\"错误次数\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,''),(39,'ai_web_top10','web事务 Top10','application_http','{ \"avg.elapsed_mean\": { \"label\":\"平均响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(40,'ai_web_avg_time','web事务','application_http','{ \"avg.elapsed_mean\": { \"label\":\"平均响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(41,'ai_web_cpm','吞吐量','application_http','{ \"sumCpm.elapsed_count\": { \"label\":\"吞吐量\", \"unit\": \"cpm\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(42,'ai_web_top_time','平均响应时间','application_http','{ \"avg.elapsed_mean\": { \"label\":\"平均响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(43,'ai_web_top_cpm','吞吐量','application_http','{ \"sumCpm.elapsed_count\": { \"label\":\"吞吐量\", \"unit\": \"cpm\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(44,'ai_web_avg_time_top5','响应时间Top5','application_http','{ \"avg.elapsed_mean\": { \"label\":\"平均响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(45,'ai_web_cpm_top5','吞吐量Top5','application_http','{ \"sumCpm.elapsed_count\": { \"label\":\"吞吐量\", \"unit\": \"cpm\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(46,'ai_db_top_avg_time','平均响应时间','application_db','{ \"avg.elapsed_mean\": { \"label\":\"平均响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(47,'ai_db_top_cpm','吞吐量','application_db','{ \"sumCpm.elapsed_count\": { \"label\":\"吞吐量\", \"unit\": \"cpm\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(48,'ai_db_avg_time','响应时间Top5','application_db','{ \"avg.elapsed_mean\": { \"label\":\"平均响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(49,'ai_db_cpm','吞吐量Top5','application_db','{ \"sumCpm.elapsed_count\": { \"label\":\"吞吐量\", \"unit\": \"cpm\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(50,'ai_cache_top_avg_time','平均响应时间','application_cache','{ \"avg.elapsed_mean\": { \"label\":\"平均响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(51,'ai_cache_top_cpm','吞吐量','application_cache','{ \"sumCpm.elapsed_count\": { \"label\":\"吞吐量\", \"unit\": \"cpm\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(52,'ai_cache_avg_time','响应时间Top5','application_cache','{ \"avg.elapsed_mean\": { \"label\":\"平均响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(53,'ai_cache_cpm','吞吐量Top5','application_cache','{ \"sumCpm.elapsed_count\": { \"label\":\"吞吐量\", \"unit\": \"cpm\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(54,'ai_jvm_mem_heap','Heap memory usage','jvm_memory','{\"avg.init\": { \"label\":\"init\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.max\": { \"label\":\"max\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.used\": { \"label\":\"used\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.committed\": { \"label\":\"committed\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(55,'ai_jvm_mem_non_heap','Non Heap memory usage','jvm_memory','{\"avg.init\": { \"label\":\"init\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.max\": { \"label\":\"max\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.used\": { \"label\":\"used\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.committed\": { \"label\":\"committed\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(56,'ai_jvm_mem_eden_space','PS-Eden-Space','jvm_memory','{\"avg.init\": { \"label\":\"init\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.max\": { \"label\":\"max\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.used\": { \"label\":\"used\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.committed\": { \"label\":\"committed\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(57,'ai_jvm_mem_old_gen','PS-Old-Gen','jvm_memory','{\"avg.init\": { \"label\":\"init\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.max\": { \"label\":\"max\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.used\": { \"label\":\"used\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.committed\": { \"label\":\"committed\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(58,'ai_jvm_mem_survivor_space','PS-Survivor-Space','jvm_memory','{\"avg.init\": { \"label\":\"init\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.max\": { \"label\":\"max\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.used\": { \"label\":\"used\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.committed\": { \"label\":\"committed\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(59,'ai_gc_mark_sweep','GC 次数','jvm_gc','{\"avg.time\": { \"label\":\"平均时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"sum.count\": { \"label\":\"总次数\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(60,'ai_gc_scavenge','GC 平均时间','jvm_gc','{\"avg.time\": { \"label\":\"平均时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"sum.count\": { \"label\":\"总次数\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,'ms'),(61,'ai_class_count','Class count','jvm_class_loader','{\"avg.loaded\": { \"label\":\"loaded\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.unloaded\": { \"label\":\"unloaded\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 1 }}','','',0,''),(62,'ai_thread','Thread','jvm_thread','{\"avg.state\": { \"label\":\"线程数量\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(63,'ai_nodejs_men_heap','Heap memory usage','nodejs_memory','{\"avg.heap_used\": { \"label\":\"used\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.heap_total\": { \"label\":\"total\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(64,'ai_nodejs_men_non_heap','Non Heap memory usage','nodejs_memory','{\"avg.external\": { \"label\":\"external\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.rss\": { \"label\":\"rss\", \"unit\": \"B\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(65,'ai_nodejs_cluster_count','Cluster count','nodejs_cluster','{\"max.count\": { \"label\":\"count\", \"unit\": \"B\", \"unit_type\": \"count\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(66,'ai_nodejs_async_res','Async Resources','nodejs_async_resource','{\"sum.count\": { \"label\":\"count\", \"unit\": \"B\", \"unit_type\": \"count\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(67,'ta_overview','页面性能(1小时内)','ta_req','{\"avg.tt\": { \"label\":\"Ajax 响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"cpm.tt\": { \"label\":\"Ajax 吞吐量\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"\", \"axis_index\": 0 }}','','',0,'ms'),(68,'ai_overview','应用性能(1小时内)','application_http','{\"avg.elapsed_mean\": { \"label\":\"响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"sumCpm.elapsed_count\": { \"label\":\"吞吐量\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"\", \"axis_index\": 0 }}','','',0,''),(69,'ta_overview_days','访问量(7天内)','ta_timing','{\"count.plt\": { \"label\":\"请求数\", \"unit\": \"\", \"unit_type\": \"count\", \"chart_type\": \"bar\", \"axis_index\": 0 }}','','',0,'ms'),(70,'ta_top_count','访问次数-Top20','ta_timing','{\"count.plt\": { \"label\":\"访问次数\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.net\": { \"label\":\"网络耗时\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.srt\": { \"label\":\"服务器响应\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.prt\": { \"label\":\"页面渲染\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.plt\": { \"label\":\"整页加载完成\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 }}','','',0,'ms'),(71,'ai_top_slow_http','慢事务追踪 Top10','application_http_slow','{\"max.elapsed_max\": { \"label\":\"最大耗时\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"max.elapsed_min\": { \"label\":\"最小耗时\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"count.elapsed_count\": { \"label\":\"发生次数\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"\", \"axis_index\": 0 }}','','',0,''),(72,'ai_top_slow_db','慢数据库追踪 Top10','application_db_slow','{\"max.elapsed_max\": { \"label\":\"最大耗时\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"max.elapsed_min\": { \"label\":\"最小耗时\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"count.elapsed_count\": { \"label\":\"发生次数\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"\", \"axis_index\": 0 }}','','',0,''),(73,'ta_timing_slow','慢加载追踪','ta_timing_slow','{\"p95.plt\": { \"label\":\"最大耗时\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 }}','','',0,'ms'),(74,'error_count','错误次数','error_count','{\"sum.count\": { \"label\":\"发生次数\", \"unit\": \"\", \"unit_type\": \"count\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(75,'ai_rpc_top_time','平均响应时间','application_rpc','{ \"avg.elapsed_mean\": { \"label\":\"平均响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(76,'ai_rpc_top_cpm','吞吐量','application_rpc','{ \"sumCpm.elapsed_count\": { \"label\":\"吞吐量\", \"unit\": \"cpm\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(77,'ai_rpc_avg_time_top5','响应时间Top5','application_rpc','{ \"avg.elapsed_mean\": { \"label\":\"平均响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(78,'ai_rpc_cpm_top5','吞吐量Top5','application_rpc','{ \"sumCpm.elapsed_count\": { \"label\":\"吞吐量\", \"unit\": \"cpm\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(79,'ai_web_error_req','错误请求','application_http','{ \"sum.elapsed_count\": { \"label\":\"错误请求\", \"unit\": \"次\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','',0,''),(80,'ta_m_timing','','ta_timing_mobile','','','0',0,'ms'),(81,'ta_m_req','','ta_req_mobile','','','0',0,'ms'),(82,'ta_m_performance','性能区间','ta_timing_mobile','{\"avg.plt\": { \"label\":\"整页加载\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }, \n\"avg.tcp\": { \"label\":\"请求排队\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.rlt\": { \"label\":\"资源加载\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.srt\": { \"label\":\"服务器响应\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,'ms'),(83,'ta_m_apdex','用户体验','ta_timing_mobile','','','0',0,'ms'),(84,'ta_m_plt_grade','整页加载完成','ta_timing_mobile','','','0',0,'ms'),(85,'ta_m_values_grade','对比分析','ta_timing_mobile','{\"count.plt\": { \"label\":\"整页加载完成\", \"unit\": \"\", \"unit_type\": \"precent\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"count.wst\": { \"label\":\"白屏时间\", \"unit\": \"%\", \"unit_type\": \"precent\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"count.fst\": { \"label\":\"首屏时间\", \"unit\": \"%\", \"unit_type\": \"precent\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"count.rct\": { \"label\":\"资源加载完成\", \"unit\": \"%\", \"unit_type\": \"precent\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"count.pct\": { \"label\":\"网页加载完成\", \"unit\": \"%\", \"unit_type\": \"precent\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,'ms'),(86,'ta_m_page_timing','页面性能趋势','ta_timing_mobile','{ \"count.plt\": { \"label\":\"PV\", \"unit\": \"\", \"unit_type\": \"count\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.plt\": { \"label\":\"响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 1 }}','','0',0,'ms'),(87,'ta_m_req_timing','请求性能趋势','ta_req_mobile','{ \"count.tt\": { \"label\":\"PV\", \"unit\": \"\", \"unit_type\": \"count\", \"chart_type\": \"line\", \"axis_index\": 0 },\n\"avg.tt\": { \"label\":\"响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 1 }}','','0',0,'ms'),(88,'ta_m_map','地图','ta_timing_mobile','','','0',0,'ms'),(89,'ta_m_top_avg_time','平均时间','ta_timing_mobile','{\"avg.pct\": { \"label\":\"网页加载完成\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.plt\": { \"label\":\"整页加载\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.wst\": { \"label\":\"白屏时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.fst\": { \"label\":\"首屏时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"avg.rct\": { \"label\":\"资源加载完成\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,'ms'),(90,'ta_m_top_percent_time','时间百分比','ta_timing_mobile','{\"sumPercent.pct\": { \"label\":\"网页加载完成\", \"unit\": \"%\", \"unit_type\": \"percent\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"sumPercent.plt\": { \"label\":\"整页加载\", \"unit\": \"%\", \"unit_type\": \"percent\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"sumPercent.wst\": { \"label\":\"白屏时间\", \"unit\": \"%\", \"unit_type\": \"percent\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"sumPercent.fst\": { \"label\":\"首屏时间\", \"unit\": \"%\", \"unit_type\": \"percent\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"sumPercent.rct\": { \"label\":\"资源加载完成\", \"unit\": \"%\", \"unit_type\": \"percent\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,'ms'),(91,'ta_m_top_cpm','时间吞吐量','ta_timing_mobile','{\"cpm.pct\": { \"label\":\"网页加载完成\", \"unit\": \"cpm\", \"unit_type\": \"cpm\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"cpm.plt\": { \"label\":\"整页加载\", \"unit\": \"cpm\", \"unit_type\": \"cpm\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"cpm.wst\": { \"label\":\"白屏时间\", \"unit\": \"cpm\", \"unit_type\": \"cpm\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"cpm.fst\": { \"label\":\"首屏时间\", \"unit\": \"cpm\", \"unit_type\": \"cpm\", \"chart_type\": \"\", \"axis_index\": 0 },\n\"cpm.rct\": { \"label\":\"资源加载完成\", \"unit\": \"cpm\", \"unit_type\": \"cpm\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,'ms'),(92,'ta_m_req_top_avg_time','平均时间','ta_req_mobile','{\"avg.tt\": { \"label\":\"请求耗时\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,'ms'),(93,'ta_m_req_top_percent_time','时间百分比','ta_req_mobile','{\"sumPercent.tt\": { \"label\":\"请求耗时\", \"unit\": \"%\", \"unit_type\": \"percent\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,'ms'),(94,'ta_m_req_top_cpm','时间吞吐量','ta_req_mobile','{\"cpm.tt\": { \"label\":\"请求耗时\", \"unit\": \"cpm\", \"unit_type\": \"cpm\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,'ms'),(95,'ta_m_avg_time','平均时间','ta_timing_mobile','{ \"avg.plt\": { \"label\":\"整页加载\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,'ms'),(96,'ta_m_cpm','吞吐量','ta_timing_mobile','{ \"cpm.plt\": { \"label\":\"吞吐量\", \"unit\": \"cpm\", \"unit_type\": \"cpm\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,'ms'),(97,'ta_m_percent_os','操作系统','ta_timing_mobile','','','0',0,'ms'),(98,'ta_m_percent_device','设备','ta_timing_mobile','','','0',0,'ms'),(99,'ta_m_percent_browser','浏览器','ta_timing_mobile','','','0',0,'ms'),(100,'ta_m_percent_av','App版本','ta_timing_mobile','','','0',0,'ms'),(101,'ta_m_percent_host','域名','ta_timing_mobile','','','0',0,'ms'),(102,'ta_m_percent_page','页面','ta_timing_mobile','','','0',0,'ms'),(103,'ta_m_req_avg_time','平均时间','ta_req_mobile','{ \"avg.tt\": { \"label\":\"请求耗时\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,'ms'),(104,'ta_m_req_cpm','吞吐量','ta_req_mobile','{ \"cpm.tt\": { \"label\":\"吞吐量\", \"unit\": \"cpm\", \"unit_type\": \"cpm\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,'ms'),(105,'ta_m_req_send','发送数据','ta_req_mobile','{ \"sum.res\": { \"label\":\"发送数据\", \"unit\": \"KB\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,'kb'),(106,'ta_m_req_recv','接收数据','ta_req_mobile','{ \"sum.req\": { \"label\":\"接收数据\", \"unit\": \"KB\", \"unit_type\": \"CAPACITY\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,'kb'),(107,'ta_m_req_status','HTTP状态码','ta_req_mobile','{ \"count.req\": { \"label\":\"HTTP状态码\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,''),(108,'ta_m_top_error','错误信息','ta_error_mobile','{ \"count.count\": { \"label\":\"错误次数\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,''),(109,'ta_m_top_page_error','错误页面','ta_error_mobile','{ \"count.count\": { \"label\":\"错误次数\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"\", \"axis_index\": 0 }}','','0',0,''),(110,'ta_m_top_error_count','报错次数','ta_error_mobile','{ \"count.count\": { \"label\":\"错误次数\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,''),(111,'ta_m_top_os_error','系统报错次数','ta_error_mobile','{ \"count.count\": { \"label\":\"错误次数\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,''),(112,'ta_m_timing_slow','慢加载追踪','ta_timing_mobile_slow','{\"p95.plt\": { \"label\":\"最大耗时\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"\", \"axis_index\": 0 }}','','',0,'ms'),(113,'ta_m_page_error','页面错误','ta_error_mobile','{ \"count.count\": { \"label\":\"错误次数\", \"unit\": \"\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,''),(114,'ai_overview_cpm','接口吞吐量','application_http,application_rpc','{ \"sumCpm.elapsed_count\": { \"label\":\"吞吐量\", \"unit\": \"cpm\", \"unit_type\": \"\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,''),(115,'ai_overview_rt','响应时间','application_http,application_rpc','{ \"avg.elapsed_mean\": { \"label\":\"响应时间\", \"unit\": \"ms\", \"unit_type\": \"time\", \"chart_type\": \"line\", \"axis_index\": 0 }}','','0',0,''); -CREATE TABLE `sp_history` ( +CREATE TABLE IF NOT EXISTS `sp_history` ( `id` int(11) NOT NULL AUTO_INCREMENT, `metric_id` int(11) DEFAULT NULL, `status_id` int(11) DEFAULT NULL, @@ -52,7 +52,7 @@ CREATE TABLE `sp_history` ( KEY `statusId` (`status_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='主动监控存储历史记录项的表,已废弃'; -CREATE TABLE `sp_log_deployment` ( +CREATE TABLE IF NOT EXISTS `sp_log_deployment` ( `id` int(10) NOT NULL AUTO_INCREMENT, `org_id` varchar(32) NOT NULL, `cluster_name` varchar(64) NOT NULL, @@ -68,7 +68,7 @@ CREATE TABLE `sp_log_deployment` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='日志分析部署表'; -CREATE TABLE `sp_log_instance` ( +CREATE TABLE IF NOT EXISTS `sp_log_instance` ( `id` int(11) NOT NULL AUTO_INCREMENT, `log_key` varchar(64) NOT NULL, `org_id` varchar(32) NOT NULL, @@ -90,7 +90,7 @@ CREATE TABLE `sp_log_instance` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='日志分析addon实例表'; -CREATE TABLE `sp_maintenance` ( +CREATE TABLE IF NOT EXISTS `sp_maintenance` ( `id` int(11) NOT NULL AUTO_INCREMENT, `project_id` int(11) DEFAULT NULL, `name` varchar(255) DEFAULT NULL, @@ -100,7 +100,7 @@ CREATE TABLE `sp_maintenance` ( KEY `project_id` (`project_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='主动监控存储配置项的表,已废弃'; -CREATE TABLE `sp_metric` ( +CREATE TABLE IF NOT EXISTS `sp_metric` ( `id` int(11) NOT NULL AUTO_INCREMENT, `project_id` int(11) DEFAULT NULL, `service_id` int(11) DEFAULT NULL, @@ -119,7 +119,7 @@ CREATE TABLE `sp_metric` ( KEY `serviceId` (`service_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='主动监控存储配置项的表'; -CREATE TABLE `sp_monitor` ( +CREATE TABLE IF NOT EXISTS `sp_monitor` ( `id` int(11) NOT NULL AUTO_INCREMENT, `monitor_id` varchar(55) NOT NULL DEFAULT '', `terminus_key` varchar(55) NOT NULL DEFAULT '', @@ -151,7 +151,7 @@ CREATE TABLE `sp_monitor` ( KEY `sp_monitor_project_id` (`project_id`) ) ENGINE=InnoDB AUTO_INCREMENT=6265 DEFAULT CHARSET=utf8mb4 COMMENT='应用监控addon实例表'; -CREATE TABLE `sp_project` ( +CREATE TABLE IF NOT EXISTS `sp_project` ( `id` int(11) NOT NULL AUTO_INCREMENT, `identity` varchar(255) NOT NULL, `name` varchar(255) DEFAULT NULL, @@ -166,7 +166,7 @@ CREATE TABLE `sp_project` ( KEY `identity` (`identity`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='主动监控存储项目映射的表'; -CREATE TABLE `sp_report_settings` ( +CREATE TABLE IF NOT EXISTS `sp_report_settings` ( `id` int(11) NOT NULL AUTO_INCREMENT, `project_id` int(11) NOT NULL, `project_name` varchar(64) NOT NULL, @@ -180,7 +180,7 @@ CREATE TABLE `sp_report_settings` ( UNIQUE KEY `project_workspace` (`project_id`,`workspace`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='应用监控项目报告配置表'; -CREATE TABLE `sp_reports` ( +CREATE TABLE IF NOT EXISTS `sp_reports` ( `id` int(11) NOT NULL AUTO_INCREMENT, `key` varchar(32) NOT NULL, `start` datetime NOT NULL, @@ -198,7 +198,7 @@ CREATE TABLE `sp_reports` ( KEY `project_id_workspace` (`project_id`,`workspace`,`type`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COMMENT='应用监控项目报告历史表'; -CREATE TABLE `sp_service` ( +CREATE TABLE IF NOT EXISTS `sp_service` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `project_id` int(11) unsigned zerofill NOT NULL, @@ -208,7 +208,7 @@ CREATE TABLE `sp_service` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='主动监控存储服务项的表,已废弃'; -CREATE TABLE `sp_stage` ( +CREATE TABLE IF NOT EXISTS `sp_stage` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID', `name` varchar(255) DEFAULT NULL COMMENT '名称', `color` varchar(255) DEFAULT NULL COMMENT '颜色', @@ -219,7 +219,7 @@ CREATE TABLE `sp_stage` ( INSERT INTO `sp_stage` (`id`, `name`, `color`) VALUES (1,'Investigating','#EA5746'),(2,'Identified','#ee8600'),(3,'Monitoring','#068FD6'),(4,'Resolved','#666'); -CREATE TABLE `sp_status` ( +CREATE TABLE IF NOT EXISTS `sp_status` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `color` varchar(255) DEFAULT NULL, @@ -231,7 +231,7 @@ CREATE TABLE `sp_status` ( INSERT INTO `sp_status` (`id`, `name`, `color`, `level`) VALUES (1,'Operational','#2fcc66',0000000000),(2,'Major Outage','#e74c3c',0000000003),(3,'Partial Outage','#e67e22',0000000002),(4,'Degraded Performance','#f1c40f',0000000001); -CREATE TABLE `sp_trace_request_history` ( +CREATE TABLE IF NOT EXISTS `sp_trace_request_history` ( `request_id` varchar(128) NOT NULL, `terminus_key` varchar(55) NOT NULL DEFAULT '', `url` varchar(1024) NOT NULL, @@ -249,7 +249,7 @@ CREATE TABLE `sp_trace_request_history` ( KEY `INDEX_STATUS` (`status`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='链路诊断历史表'; -CREATE TABLE `sp_user` ( +CREATE TABLE IF NOT EXISTS `sp_user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) DEFAULT NULL, `salt` varchar(255) DEFAULT NULL, @@ -262,7 +262,7 @@ CREATE TABLE `sp_user` ( INSERT INTO `sp_user` (`id`, `username`, `salt`, `password`, `created_at`) VALUES (3,'admin','1536227528641690966','54cf26baae342201e50ddb4391b44f1f','2018-09-06 01:52:09'),(5,'purchase','1538099181623594327','f6c212584ca861b507234529c4a70fb1','2018-09-28 01:46:22'); -CREATE TABLE `tb_tmc` ( +CREATE TABLE IF NOT EXISTS `tb_tmc` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id', `name` varchar(32) NOT NULL COMMENT '显示名称', `engine` varchar(32) NOT NULL COMMENT '内核名称', @@ -277,7 +277,7 @@ CREATE TABLE `tb_tmc` ( INSERT INTO `tb_tmc` (`id`, `name`, `engine`, `service_type`, `deploy_mode`, `create_time`, `update_time`, `is_deleted`) VALUES (1,'微服务治理','micro-service','MICRO_SERVICE','SAAS','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(2,'配置中心','config-center','MICRO_SERVICE','SAAS','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(3,'应用监控','monitor','MICRO_SERVICE','SAAS','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(4,'注册中心','registercenter','MICRO_SERVICE','SAAS','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(5,'API网关','api-gateway','MICRO_SERVICE','SAAS','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(6,'Nacos','nacos','ADDON','SAAS','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(7,'MySQL','mysql','ADDON','SAAS','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(8,'ZooKeeper','zookeeper','ADDON','SAAS','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(9,'ETCD','etcd','ADDON','SAAS','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(10,'ZKProxy','zkproxy','ADDON','SAAS','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(11,'PostgreSQL','postgresql','ADDON','SAAS','2021-05-28 11:30:25','2021-05-28 11:54:58','N'),(12,'权限中心','acl','GENERAL_ABILITY','PAAS','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(13,'日志分析','log-analytics','ADDON','SAAS','2021-05-28 11:30:25','2021-05-28 11:54:54','N'),(14,'Trantor','trantor','GENERAL_ABILITY','PAAS','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(15,'通知中心','notice-center','GENERAL_ABILITY','SAAS','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(16,'服务治理','service-mesh','MICRO_SERVICE','SAAS','2021-05-28 11:54:53','2021-05-28 11:54:53','N'),(17,'监控Zookeeper','monitor-zk','ADDON','SAAS','2021-05-28 11:54:54','2021-05-28 11:54:54','N'),(18,'监控Kafka','monitor-kafka','ADDON','SAAS','2021-05-28 11:54:54','2021-05-28 11:54:54','N'),(19,'监控Collector','monitor-collector','ADDON','SAAS','2021-05-28 11:54:54','2021-05-28 11:54:54','N'),(20,'日志导出','log-exporter','ADDON','PAAS','2021-05-28 11:54:54','2021-05-28 11:54:54','N'),(21,'日志elasticsearch','log-es','ADDON','SAAS','2021-05-28 11:54:54','2021-05-28 11:54:54','N'); -CREATE TABLE `tb_tmc_ini` ( +CREATE TABLE IF NOT EXISTS `tb_tmc_ini` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id', `ini_name` varchar(128) NOT NULL COMMENT '配置信息名称', `ini_desc` varchar(256) NOT NULL COMMENT '配置信息介绍', @@ -292,7 +292,7 @@ CREATE TABLE `tb_tmc_ini` ( INSERT INTO `tb_tmc_ini` (`id`, `ini_name`, `ini_desc`, `ini_value`, `create_time`, `update_time`, `is_deleted`) VALUES (1,'MS_MENU','微服务治理菜单列表','[{\"key\":\"ServiceGovernance\",\"cnName\":\"微服务治理\",\"enName\":\"MicroService\",\"children\":[{\"key\":\"Overview\",\"cnName\":\"全局拓扑\",\"enName\":\"Overview\",\"exists\":true,\"mustExists\":true}],\"exists\":true,\"mustExists\":true},{\"key\":\"AppMonitor\",\"cnName\":\"应用监控\",\"enName\":\"AppMonitor\",\"children\":[{\"key\":\"MonitorIntro\",\"href\":\"/manual/microservice/use-apm-monitor-app.html\",\"cnName\":\"使用引导\",\"enName\":\"MonitorIntro\",\"exists\":true},{\"key\":\"ServiceList\",\"cnName\":\"服务列表\",\"enName\":\"ServiceList\",\"exists\":false},{\"key\":\"BrowserInsight\",\"cnName\":\"浏览性能\",\"enName\":\"BrowserInsight\",\"exists\":false},{\"key\":\"AppInsight\",\"cnName\":\"APP性能\",\"enName\":\"AppInsight\",\"exists\":false},{\"key\":\"ErrorInsight\",\"cnName\":\"错误分析\",\"enName\":\"ErrorInsight\",\"exists\":false},{\"key\":\"Transaction\",\"cnName\":\"链路追踪\",\"enName\":\"Transaction\",\"exists\":false},{\"key\":\"StatusPage\",\"cnName\":\"主动监控\",\"enName\":\"StatusPage\",\"exists\":false},{\"key\":\"Alarm\",\"cnName\":\"告警通知\",\"enName\":\"Alarm\",\"exists\":false},{\"key\":\"CustomAlarm\",\"cnName\":\"自定义告警\",\"enName\":\"CustomAlarm\",\"exists\":false},{\"key\":\"AlarmRecord\",\"cnName\":\"告警记录\",\"enName\":\"AlarmRecord\",\"exists\":false},{\"key\":\"CustomDashboard\",\"cnName\":\"运维大盘\",\"enName\":\"O & M dashboard\",\"exists\":false}],\"exists\":true,\"mustExists\":true},{\"key\":\"LogAnalyze\",\"cnName\":\"日志分析\",\"enName\":\"LogAnalyze\",\"exists\":true,\"children\":[{\"cnName\":\"日志查询\",\"enName\":\"LogQuery\",\"key\":\"LogQuery\",\"exists\":false},{\"cnName\":\"分析规则\",\"enName\":\"AnalyzeRule\",\"key\":\"AnalyzeRule\",\"exists\":false}]},{\"key\":\"APIGateway\",\"cnName\":\"API网关\",\"enName\":\"APIGateway\",\"children\":[{\"key\":\"GatewayIntro\",\"cnName\":\"使用引导\",\"enName\":\"GatewayIntro\",\"href\":\"/manual/microservice/api-gateway.html\",\"exists\":true},{\"key\":\"Endpoints\",\"cnName\":\"流量入口管理\",\"enName\":\"Endpoints\",\"exists\":false,\"onlyK8S\":true},{\"key\":\"APIs\",\"cnName\":\"微服务API管理\",\"enName\":\"APIs\",\"exists\":false},{\"key\":\"ConsumerACL\",\"cnName\":\"调用方管理\",\"enName\":\"ConsumerACL\",\"exists\":false,\"onlyK8S\":true},{\"key\":\"OldPolicies\",\"cnName\":\"API策略\",\"enName\":\"Policies\",\"exists\":false,\"onlyNotK8S\":true},{\"key\":\"OldConsumerACL\",\"cnName\":\"调用者授权\",\"enName\":\"ConsumerACL\",\"exists\":false,\"onlyNotK8S\":true}],\"exists\":true,\"mustExists\":true},{\"key\":\"RegisterCenter\",\"cnName\":\"注册中心\",\"enName\":\"RegisterCenter\",\"children\":[{\"key\":\"RegisterIntro\",\"cnName\":\"使用引导\",\"enName\":\"RegisterIntro\",\"href\":\"/manual/microservice/dubbo.html\",\"exists\":true},{\"key\":\"Services\",\"cnName\":\"服务注册列表\",\"enName\":\"Services\",\"exists\":false}],\"exists\":true,\"mustExists\":true},{\"key\":\"ConfigCenter\",\"cnName\":\"配置中心\",\"enName\":\"ConfigCenter\",\"children\":[{\"key\":\"ConfigIntro\",\"cnName\":\"使用引导\",\"href\":\"/manual/deploy/config-center.html\",\"enName\":\"ConfigIntro\",\"exists\":true},{\"key\":\"Configs\",\"cnName\":\"配置管理\",\"enName\":\"Configs\",\"exists\":false}],\"exists\":true,\"mustExists\":true},{\"key\":\"ComponentInfo\",\"cnName\":\"组件信息\",\"enName\":\"ComponentInfo\",\"children\":[],\"exists\":true,\"mustExists\":true}]','2021-05-28 11:30:25','2021-05-28 13:53:56','N'),(2,'MK_config-center','','ConfigCenter','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(3,'MK_JUMP_config-center','','Configs','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(4,'MK_monitor','','AppMonitor','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(5,'MK_JUMP_monitor','','Overview','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(6,'MK_registercenter','','RegisterCenter','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(7,'MK_JUMP_registercenter','','Services','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(8,'MK_api-gateway','','APIGateway','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(9,'MK_JUMP_api-gateway','','APIs','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(10,'MK_JUMP_micro-service','','Overview','2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(11,'MK_log-analytics','','LogAnalyze','2020-11-14 22:44:55','2020-11-14 22:44:55','N'); -CREATE TABLE `tb_tmc_instance` ( +CREATE TABLE IF NOT EXISTS `tb_tmc_instance` ( `id` varchar(64) NOT NULL COMMENT '实例唯一id', `engine` varchar(128) NOT NULL COMMENT '对应内核名称', `version` varchar(32) NOT NULL COMMENT '版本', @@ -308,7 +308,7 @@ CREATE TABLE `tb_tmc_instance` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微服务组件部署实例信息'; -CREATE TABLE `tb_tmc_instance_tenant` ( +CREATE TABLE IF NOT EXISTS `tb_tmc_instance_tenant` ( `id` varchar(64) NOT NULL COMMENT '租户唯一id', `instance_id` varchar(64) NOT NULL COMMENT '实例id', `config` varchar(4096) DEFAULT NULL COMMENT '租户配置信息', @@ -322,7 +322,7 @@ CREATE TABLE `tb_tmc_instance_tenant` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微服务组件租户信息'; -CREATE TABLE `tb_tmc_request_relation` ( +CREATE TABLE IF NOT EXISTS `tb_tmc_request_relation` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id', `parent_request_id` varchar(64) NOT NULL COMMENT '父级请求id', `child_request_id` varchar(64) NOT NULL COMMENT '子级请求id', @@ -332,7 +332,7 @@ CREATE TABLE `tb_tmc_request_relation` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微服务组件部署过程依赖关系'; -CREATE TABLE `tb_tmc_version` ( +CREATE TABLE IF NOT EXISTS `tb_tmc_version` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id', `engine` varchar(32) NOT NULL COMMENT '内核名称', `version` varchar(32) NOT NULL COMMENT '版本', @@ -344,5 +344,5 @@ CREATE TABLE `tb_tmc_version` ( ) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8 COMMENT='微服务组件版本元信息'; -INSERT INTO `tb_tmc_version` (`id`, `engine`, `version`, `release_id`, `create_time`, `update_time`, `is_deleted`) VALUES (1,'micro-service','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(2,'config-center','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(3,'monitor','3.6',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(4,'registercenter','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(5,'api-gateway','3.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 13:53:54','N'),(6,'nacos','1.1.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(7,'mysql','5.7.23',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(8,'zookeeper','3.4.10',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(9,'etcd','3.3.12',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(10,'zkproxy','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(11,'postgresql','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(12,'log-analytics','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(13,'acl','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(14,'acl','1.0.1',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(15,'trantor','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(16,'notice-center','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(17,'service-mesh','1.0.0',NULL,'2021-05-28 11:54:53','2021-05-28 11:54:53','N'),(18,'registercenter','2.0.0',NULL,'2021-05-28 11:54:53','2021-05-28 11:54:53','N'),(19,'monitor-zk','3.4.10',NULL,'2021-05-28 11:54:54','2021-05-28 11:54:54','N'),(20,'monitor-kafka','2.0.0',NULL,'2021-05-28 11:54:54','2021-05-28 11:54:54','N'),(21,'monitor-collector','1.0.0',NULL,'2021-05-28 11:54:54','2021-05-28 11:54:54','N'),(22,'log-exporter','1.0.0',NULL,'2021-05-28 11:54:54','2021-05-28 11:54:54','N'),(23,'log-es','1.0.0',NULL,'2021-05-28 11:54:54','2021-05-28 11:54:54','N'),(24,'log-analytics','2.0.0',NULL,'2021-05-28 11:54:54','2021-05-28 11:54:54','N'); +INSERT IGNORE INTO `tb_tmc_version` (`id`, `engine`, `version`, `release_id`, `create_time`, `update_time`, `is_deleted`) VALUES (1,'micro-service','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(2,'config-center','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(3,'monitor','3.6',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(4,'registercenter','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(5,'api-gateway','3.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 13:53:54','N'),(6,'nacos','1.1.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(7,'mysql','5.7.23',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(8,'zookeeper','3.4.10',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(9,'etcd','3.3.12',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(10,'zkproxy','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(11,'postgresql','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(12,'log-analytics','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(13,'acl','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(14,'acl','1.0.1',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(15,'trantor','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(16,'notice-center','1.0.0',NULL,'2021-05-28 11:30:25','2021-05-28 11:30:25','N'),(17,'service-mesh','1.0.0',NULL,'2021-05-28 11:54:53','2021-05-28 11:54:53','N'),(18,'registercenter','2.0.0',NULL,'2021-05-28 11:54:53','2021-05-28 11:54:53','N'),(19,'monitor-zk','3.4.10',NULL,'2021-05-28 11:54:54','2021-05-28 11:54:54','N'),(20,'monitor-kafka','2.0.0',NULL,'2021-05-28 11:54:54','2021-05-28 11:54:54','N'),(21,'monitor-collector','1.0.0',NULL,'2021-05-28 11:54:54','2021-05-28 11:54:54','N'),(22,'log-exporter','1.0.0',NULL,'2021-05-28 11:54:54','2021-05-28 11:54:54','N'),(23,'log-es','1.0.0',NULL,'2021-05-28 11:54:54','2021-05-28 11:54:54','N'),(24,'log-analytics','2.0.0',NULL,'2021-05-28 11:54:54','2021-05-28 11:54:54','N'); diff --git a/modules/core/monitor/log/schema/manager.go b/modules/core/monitor/log/schema/manager.go index c0a5a9d6bcb..d317a049fd4 100644 --- a/modules/core/monitor/log/schema/manager.go +++ b/modules/core/monitor/log/schema/manager.go @@ -35,7 +35,7 @@ const ( gcGraceSeconds = 86400 ) -var bdl = bundle.New(bundle.WithCoreServices()) +var bdl = bundle.New(bundle.WithCoreServices(), bundle.WithDOP()) type LogSchema interface { Name() string diff --git a/modules/orchestrator/initialize.go b/modules/orchestrator/initialize.go index 3baf069ce41..d4c0e257662 100644 --- a/modules/orchestrator/initialize.go +++ b/modules/orchestrator/initialize.go @@ -102,6 +102,8 @@ func initEndpoints(db *dbclient.DBClient) (*endpoints.Endpoints, error) { bundle.WithPipeline(), bundle.WithGittar(), bundle.WithMSP(), + bundle.WithDOP(), + bundle.WithClusterManager(), } bdl := bundle.New(bundleOpts...) diff --git a/modules/orchestrator/services/addon/addon_handler.go b/modules/orchestrator/services/addon/addon_handler.go index 464e1d58070..42b7fe9a4f1 100644 --- a/modules/orchestrator/services/addon/addon_handler.go +++ b/modules/orchestrator/services/addon/addon_handler.go @@ -1155,16 +1155,8 @@ func (a *Addon) getRandomId() string { // CreateAddonProvider 请求addon provider,获取新的addon实例 func (a *Addon) CreateAddonProvider(req *apistructs.AddonProviderRequest, addonName, providerDomain, userId string) (int, *apistructs.AddonProviderResponse, error) { - clusterInfo, err := a.bdl.QueryClusterInfo(conf.MainClusterName()) - if err != nil { - logrus.Errorf("拉取cluster接口失败") - return 0, nil, err - } - // 若为 kubernetes 集群 - if clusterInfo[apistructs.DICE_CLUSTER_TYPE] == apistructs.AddonMainClusterDefaultName { - if strings.Contains(providerDomain, "tmc") { - providerDomain = discover.MSP() - } + if strings.Contains(providerDomain, "tmc.") { + providerDomain = discover.MSP() } req.Callback = "http://" + discover.Orchestrator() logrus.Infof("start creating addon provider, url: %v, body: %+v", providerDomain+"/"+addonName+apistructs.AddonGetResourcePath, req) @@ -1197,19 +1189,11 @@ func (a *Addon) CreateAddonProvider(req *apistructs.AddonProviderRequest, addonN func (a *Addon) DeleteAddonProvider(req *apistructs.AddonProviderRequest, uuid, addonName, providerDomain string) (*apistructs.AddonProviderDeleteResponse, error) { logrus.Infof("deleting addon provider request: %+v", req) - clusterInfo, err := a.bdl.QueryClusterInfo(conf.MainClusterName()) - if err != nil { - logrus.Errorf("拉取cluster接口失败") - return nil, err - } - if clusterInfo[apistructs.DICE_CLUSTER_TYPE] == apistructs.AddonMainClusterDefaultName { - if strings.Contains(providerDomain, "pandora") { - providerDomain = strings.Replace(providerDomain, "pandora.marathon.l4lb.thisdcos.directory:8050", "pandora.default.svc.cluster.local:8050", -1) - } - if strings.Contains(providerDomain, "tmc") { - providerDomain = discover.MSP() - //providerDomain = strings.Replace(providerDomain, "tmc.marathon.l4lb.thisdcos.directory:8050", "tmc.default.svc.cluster.local:8050", -1) - } + if strings.Contains(providerDomain, "pandora.") { + providerDomain = strings.Replace(providerDomain, "pandora.marathon.l4lb.thisdcos.directory:8050", "pandora.default.svc.cluster.local:8050", -1) + } else if strings.Contains(providerDomain, "tmc.") { + providerDomain = discover.MSP() + //providerDomain = strings.Replace(providerDomain, "tmc.marathon.l4lb.thisdcos.directory:8050", "tmc.default.svc.cluster.local:8050", -1) } logrus.Infof("start delete addon provider, url: %v", providerDomain+"/"+addonName+apistructs.AddonGetResourcePath+"/"+uuid) diff --git a/quick-start/docker-compose.yml b/quick-start/docker-compose.yml index 0d447095ee7..77adfa3dbdf 100644 --- a/quick-start/docker-compose.yml +++ b/quick-start/docker-compose.yml @@ -1,7 +1,7 @@ version: "3" services: ui: - image: erdaproject/erda-ui:1.0-20210601-0d38983 + image: erdaproject/erda-ui:1.1-20210729-dd8ed4d8 container_name: erda-ui depends_on: - openapi @@ -17,6 +17,8 @@ services: FDP_UI_ADDR: "www.erda.cloud" ports: - "80:80" + extra_hosts: + - "host.docker.internal:host-gateway" restart: always platform: linux/amd64 @@ -90,138 +92,200 @@ services: networks: - default - kms: - image: erdaproject/kms:20200608-f11445f776ba50e1f947096f57956a3f0333ab11 - container_name: erda-kms - depends_on: - - erda-migration + action-runner-scheduler: + image: erdaproject/erda:1.1-20210721-725137a + command: /app/action-runner-scheduler + container_name: erda-action-runner-scheduler env_file: - ./env ports: - - "3082:3082" + - "9500:9500" restart: always platform: linux/amd64 - eventbox: - image: erdaproject/erda:1.0-20210521-3a995ee - command: /app/eventbox - container_name: erda-eventbox - depends_on: - - erda-migration + #cluster-agent: + + admin: + image: erdaproject/erda:1.1-20210721-725137a + command: /app/admin + container_name: erda-admin env_file: - ./env + environment: + DEBUG: "false" ports: - - "9528:9528" + - "9095:9095" + extra_hosts: + - "host.docker.internal:host-gateway" restart: always platform: linux/amd64 - pipeline: - image: erdaproject/pipeline:1.0-20210524-b614087 - command: /app/pipeline - container_name: erda-pipeline - depends_on: - - erda-migration - - scheduler + cluster-dialer: + image: erdaproject/erda:1.1-20210721-725137a + command: /app/cluster-dialer + container_name: erda-cluster-dialer env_file: - ./env environment: DEBUG: "false" - PIPELINE_STORAGE_URL: file:///devops/storage ports: - - "3081:3081" + - "9097:80" + extra_hosts: + - "host.docker.internal:host-gateway" + platform: linux/amd64 + + cluster-manager: + image: erdaproject/erda:1.1-20210721-725137a + command: /app/cluster-manager + container_name: erda-cluster-manager + env_file: + - ./env + environment: + DEBUG: "false" + ports: + - "9094:9094" + extra_hosts: + - "host.docker.internal:host-gateway" restart: always platform: linux/amd64 - ops: - image: erdaproject/erda:1.0-20210521-3a995ee - command: /app/ops - container_name: erda-ops - depends_on: - - erda-migration + cmp: + image: erdaproject/cmp:1.1-20210727-57f03b18 + command: /app/cmp + container_name: erda-cmp env_file: - ./env + environment: + ERDA_HELM_CHART_VERSION: 1.1.0 + ERDA_NAMESPACE: default + UC_CLIENT_ID: dice + UC_CLIENT_SECRET: secret + ports: + - "9027:9027" + extra_hosts: + - "host.docker.internal:host-gateway" restart: always platform: linux/amd64 - qa: - image: erdaproject/erda:1.0-20210521-3a995ee - command: /app/qa - container_name: erda-qa + collector: + image: erdaproject/erda:1.1-20210721-725137a + command: /app/collector + container_name: erda-collector env_file: - ./env environment: - SONAR_ADMIN_TOKEN: 123456 + COLLECTOR_BROWSER_SAMPLING_RATE: "100" + COLLECTOR_ENABLE: "true" ports: - - "3033:3033" - depends_on: - - erda-migration - - cmdb + - "7076:7076" + extra_hosts: + - "host.docker.internal:host-gateway" restart: always platform: linux/amd64 - scheduler: - image: erdaproject/erda:1.0-20210521-3a995ee - command: /app/scheduler - container_name: erda-scheduler + core-services: + image: erdaproject/erda:1.1-20210721-725137a + command: /app/core-services + container_name: erda-core-services depends_on: - - erda-migration - - etcd + - mysql + - kms + - redis-sentinel + - redis env_file: - ./env environment: - CMDB_CONTAINER_TOPIC: spot-metaserver_container - CMDB_GROUP: spot_cmdb_group2 DEBUG: "false" + AVATAR_STORAGE_URL: file:///avatars + CMDB_CONTAINER_TOPIC: spot-metaserver_container + CMDB_GROUP: spot_cmdb_group + CMDB_HOST_TOPIC: spot-metaserver_host + CREATE_ORG_ENABLED: "false" + LISTEN_ADDR: :9526 + UC_CLIENT_ID: dice + UC_CLIENT_SECRET: secret + volumes: + - type: volume + source: erda-files + target: /files + read_only: false + - type: volume + source: erda-avatars + target: /avatars + read_only: false ports: - - "9091:9091" + - "9526:9526" + extra_hosts: + - "host.docker.internal:host-gateway" restart: always platform: linux/amd64 - apim: - image: erdaproject/erda:1.0-20210521-3a995ee - command: /app/apim - container_name: erda-apim + dicehub: + image: erdaproject/erda:1.1-20210721-725137a + command: /app/dicehub + container_name: erda-dicehub depends_on: - erda-migration env_file: - ./env ports: - - "3083:3083" + - "10000:10000" + environment: + EXTENSION_MENU: '{"流水线任务":["source_code_management:代码管理","build_management:构建管理","deploy_management:部署管理","version_management:版本管理","test_management:测试管理","data_management:数据治理","custom_task:自定义任务"],"扩展服务":["database:存储","distributed_cooperation:分布式协作","search:搜索","message:消息","content_management:内容管理","security:安全","traffic_load:流量负载","monitoring&logging:监控&日志","content:文本处理","image_processing:图像处理","document_processing:文件处理","sound_processing:音频处理","custom:自定义","general_ability:通用能力","new_retail:新零售能力","srm:采供能力","solution:解决方案"]}' + RELEASE_GC_SWITCH: "true" + RELEASE_MAX_TIME_RESERVED: "72" + extra_hosts: + - "host.docker.internal:host-gateway" restart: always platform: linux/amd64 - cmdb: - image: erdaproject/cmdb:1.1-20210604-14fa00c - command: /app/cmdb - container_name: erda-cmdb + dop: + image: erdaproject/erda:1.1-20210721-725137a + command: /app/dop + container_name: erda-dop + depends_on: + - mysql env_file: - ./env - volumes: - - type: volume - source: erda-files - target: /files - read_only: false - - type: volume - source: erda-avatars - target: /avatars - read_only: false environment: - DEBUG: "false" - ORY_ENABLED: "true" - KRATOS_ADDR: "kratos:4433" - KRATOS_PRIVATE_ADDR: "kratos:4434" - ORY_KRATOS_ADDR: "kratos:4433" - ORY_KRATOS_PRIVATE_ADDR: "kratos:4434" + DEBUG: "true" + ports: + - "9527:9527" + extra_hosts: + - "host.docker.internal:host-gateway" + restart: always + platform: linux/amd64 + + ecp: + image: erdaproject/erda:1.1-20210721-725137a + command: /app/ecp + container_name: erda-ecp + env_file: + - ./env ports: - - "9093:9093" + - "9029:9029" + extra_hosts: + - "host.docker.internal:host-gateway" + restart: always + platform: linux/amd64 + + eventbox: + image: erdaproject/erda:1.1-20210721-725137a + command: /app/eventbox + container_name: erda-eventbox depends_on: - erda-migration - - eventbox + env_file: + - ./env + ports: + - "9528:9528" + extra_hosts: + - "host.docker.internal:host-gateway" restart: always platform: linux/amd64 gittar: - image: erdaproject/erda:1.0-20210521-3a995ee + image: erdaproject/erda:1.1-20210721-725137a command: /app/gittar container_name: erda-gittar depends_on: @@ -234,7 +298,7 @@ services: target: /repository read_only: false ports: - - "5566:5566" + - "5566:5566" environment: GITTAR_SKIP_AUTH_URL: gittar:5566 ORY_ENABLED: "true" @@ -242,43 +306,67 @@ services: KRATOS_PRIVATE_ADDR: "kratos:4434" ORY_KRATOS_ADDR: "kratos:4433" ORY_KRATOS_PRIVATE_ADDR: "kratos:4434" + GIT_INNER_USER_NAME: "18000000000" + GIT_INNER_USER_PASSWORD: "123456" + GITTAR_BRANCH_FILTER: master,develop,feature/*,support/*,release/*,hotfix/* + GITTAR_PORT: "5566" + UC_CLIENT_ID: dice + UC_CLIENT_SECRET: secret + extra_hosts: + - "host.docker.internal:host-gateway" restart: always platform: linux/amd64 - gittar-adaptor: - image: erdaproject/erda:1.0-20210521-3a995ee - command: /app/gittar-adaptor - container_name: erda-gittar-adaptor + hepa: + image: erdaproject/hepa:1.1-20210727-57f03b18 + command: /app/hepa + container_name: erda-hepa depends_on: - erda-migration - - gittar - - pipeline env_file: - ./env ports: - - "1086:1086" + - "9080:8080" + extra_hosts: + - "host.docker.internal:host-gateway" restart: always platform: linux/amd64 - dicehub: - image: erdaproject/erda:1.0-20210521-3a995ee - command: /app/dicehub - container_name: erda-dicehub - depends_on: - - erda-migration + monitor: + image: erdaproject/erda:1.1-20210721-725137a + command: /app/monitor + container_name: erda-monitor env_file: - ./env ports: - - "10000:10000" + - "7096:7096" + extra_hosts: + - "host.docker.internal:host-gateway" + restart: always + platform: linux/amd64 + + msp: + image: erdaproject/erda:1.1-20210721-725137a + command: /app/msp + container_name: erda-msp + depends_on: + - elasticsearch + - cassandra + - mysql + env_file: + - ./env environment: - EXTENSION_MENU: '{"流水线任务":["source_code_management:代码管理","build_management:构建管理","deploy_management:部署管理","version_management:版本管理","test_management:测试管理","data_management:数据治理","custom_task:自定义任务"],"扩展服务":["database:存储","distributed_cooperation:分布式协作","search:搜索","message:消息","content_management:内容管理","security:安全","traffic_load:流量负载","monitoring&logging:监控&日志","content:文本处理","image_processing:图像处理","document_processing:文件处理","sound_processing:音频处理","custom:自定义","general_ability:通用能力","new_retail:新零售能力","srm:采供能力","solution:解决方案"]}' - RELEASE_GC_SWITCH: "true" - RELEASE_MAX_TIME_RESERVED: "72" + GOLANG_PROTOBUF_REGISTRATION_CONFLICT: ignore + ports: + - "8080:8080" + extra_hosts: + - "host.docker.internal:host-gateway" restart: always platform: linux/amd64 + openapi: - image: erdaproject/openapi:1.1-20210602-d2be13e + image: erdaproject/erda:1.1-20210721-725137a command: /app/openapi container_name: erda-openapi depends_on: @@ -288,47 +376,47 @@ services: - scheduler - pipeline - gittar - - apim - - cmdb + - core-services - dicehub - eventbox - - gittar-adaptor - - kms - hepa - - ops + - dop - orchestrator - - qa + - msp + - admin env_file: - ./env - environment: - SELF_PUBLIC_ADDR: "one.erda.local:9529" - CUSTOM_NAMESPACE: "local" - ORY_ENABLED: "true" - KRATOS_ADDR: "kratos:4433" - KRATOS_PRIVATE_ADDR: "kratos:4434" - ORY_KRATOS_ADDR: "kratos:4433" - ORY_KRATOS_PRIVATE_ADDR: "kratos:4434" - SESSION_COOKIE_NAME: "ory_kratos_session" ports: - "9529:9529" + extra_hosts: + - "host.docker.internal:host-gateway" restart: always platform: linux/amd64 - hepa: - image: erdaproject/erda:1.0-20210521-3a995ee - command: /app/hepa - container_name: erda-hepa + orchestrator: + image: erdaproject/orchestrator:1.1-20210728-57f03b18 + command: /app/orchestrator + container_name: erda-orchestrator depends_on: - erda-migration + - scheduler + - collector env_file: - ./env + environment: + DEBUG: "false" + TENANT_GROUP_KEY: 58dcbf490ef3 + ports: + - "8081:8081" + extra_hosts: + - "host.docker.internal:host-gateway" restart: always platform: linux/amd64 - orchestrator: - image: erdaproject/erda:1.0-20210521-3a995ee - command: /app/orchestrator - container_name: erda-orchestrator + pipeline: + image: erdaproject/erda:1.1-20210721-725137a + command: /app/pipeline + container_name: erda-pipeline depends_on: - erda-migration - scheduler @@ -336,9 +424,130 @@ services: - ./env environment: DEBUG: "false" - TENANT_GROUP_KEY: 58dcbf490ef3 + PIPELINE_STORAGE_URL: file:///devops/storage + GIT_INNER_USER_NAME: "18000000000" + GIT_INNER_USER_PASSWORD: "123456" ports: - - "8081:8081" + - "3081:3081" + extra_hosts: + - "host.docker.internal:host-gateway" + restart: always + platform: linux/amd64 + + scheduler: + image: erdaproject/scheduler:1.1-20210728-57f03b18 + command: /app/scheduler + container_name: erda-scheduler + depends_on: + - erda-migration + - etcd + env_file: + - ./env + environment: + CMDB_CONTAINER_TOPIC: spot-metaserver_container + CMDB_GROUP: spot_cmdb_group2 + DEBUG: "false" + ports: + - "9091:9091" + extra_hosts: + - "host.docker.internal:host-gateway" + restart: always + platform: linux/amd64 + + streaming: + image: erdaproject/streaming:1.1-20210731-07fea0c1 + command: /app/streaming + container_name: erda-streaming + env_file: + - ./env + environment: + BROWSER_ENABLE: "true" + BROWSER_GROUP_ID: spot-monitor-browser + LOG_GROUP_ID: spot-monitor-log + LOG_STORE_ENABLE: "true" + LOG_TTL: 168h + METRIC_ENABLE: "true" + METRIC_GROUP_ID: spot-monitor-metrics + METRIC_INDEX_TTL: 192h + TRACE_ENABLE: "true" + TRACE_GROUP_ID: spot-monitor-trace + TRACE_TTL: 168h + ports: + - "7091:7091" + extra_hosts: + - "host.docker.internal:host-gateway" + restart: always + platform: linux/amd64 + + kms: + image: erdaproject/kms:20200608-f11445f776ba50e1f947096f57956a3f0333ab11 + container_name: erda-kms + depends_on: + - erda-migration + env_file: + - ./env + ports: + - "3082:3082" + extra_hosts: + - "host.docker.internal:host-gateway" + restart: always + platform: linux/amd64 + + zookeeper: + image: 'bitnami/zookeeper:3.7.0' + container_name: erda-zookeeper + ports: + - '2181:2181' + environment: + - ALLOW_ANONYMOUS_LOGIN=yes + restart: always + platform: linux/amd64 + + kafka: + image: 'bitnami/kafka:2.8.0' + container_name: erda-kafka + ports: + - '9092:9092' + environment: + - KAFKA_BROKER_ID=1 + - KAFKA_CFG_LISTENERS=PLAINTEXT://:9092 + - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092 + - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 + - ALLOW_PLAINTEXT_LISTENER=yes + - KAFKA_HEAP_OPTS=-Xmx256m -Xms256m + depends_on: + - zookeeper + restart: always + platform: linux/amd64 + + cassandra: + image: bitnami/cassandra:3-debian-10 + container_name: erda-cassandra + environment: + CASSANDRA_USER: cassandra + CASSANDRA_PASSWORD: cassandra + volumes: + - type: volume + source: erda-cassandra + target: /bitnami + read_only: false + ports: + - "9042:9042" + restart: always + platform: linux/amd64 + + elasticsearch: + image: bitnami/elasticsearch:6-debian-10 + container_name: erda-elasticsearch + environment: + ES_JAVA_OPTS: "-Xms256m -Xmx256m" + volumes: + - type: volume + source: erda-elasticsearch + target: /bitnami/elasticsearch/data + read_only: false + ports: + - "9200:9200" restart: always platform: linux/amd64 @@ -395,7 +604,11 @@ services: container_name: erda-redis-sentinel environment: REDIS_MASTER_PASSWORD: "123456" + depends_on: + - redis restart: always + ports: + - "26379:26379" platform: linux/amd64 redis: @@ -404,7 +617,7 @@ services: environment: REDIS_PASSWORD: "123456" ports: - - "16379:6379" + - "6379:6379" restart: always platform: linux/amd64 volumes: @@ -414,6 +627,8 @@ volumes: erda-avatars: {} erda-files: {} kratos-sqlite: {} + erda-elasticsearch: {} + erda-cassandra: {} networks: default: diff --git a/quick-start/env b/quick-start/env index 0f9962e7eac..fdfd0dd1d56 100644 --- a/quick-start/env +++ b/quick-start/env @@ -1,14 +1,18 @@ +# service addr +ADMIN_ADDR=admin:9095 +CORE_SERVICES_ADDR=core-services:9526 +DOP_ADDR=dop:9527 +ECP_ADDR=ecp:9029 +CMP_ADDR=cmp:9027 +CLUSTER_MANAGER_ADDR=cluster-manager:9094 +CLUSTER_DIALER_ADDR=cluster-dialer:80 +MSP_ADDR=msp:8080 EVENTBOX_ADDR=eventbox:9528 -DEBUG=true SCHEDULER_ADDR=scheduler:9091 UC_ADDR=uc:8080 -UC_PUBLIC_URL=http://uc.erda.local:8080 -UC_PUBLIC_ADDR=uc.erda.local:8080 -DICE_ON_DICE=xxxx UI_ADDR=ui:80 QA_ADDR=qa:3033 CMDB_ADDR=cmdb:9093 -#CMDB_ADDR=host.docker.internal:9094 PIPELINE_ADDR=pipeline:3081 DICEHUB_ADDR=dicehub:10000 OPENAPI_ADDR=openapi:9529 @@ -18,36 +22,55 @@ UC_ADAPTOR_ADDR=uc-adaptor:12580 APIM_ADDR=uc-apim:3083 ORCHESTRATOR_ADDR=orchestrator:8081 KMS_ADDR=kms:3082 -COLLECTOR_ADDR=collector.default.svc.cluster.local:7076 +COLLECTOR_ADDR=collector:7076 SONAR_ADDR=addon-sonar.default.svc.cluster.local:9000 -MONITOR_ADDR=monitor.default.svc.cluster.local:7096 -NETPORTAL_ADDR=netportal.default.svc.cluster.local:80 +MONITOR_ADDR=monitor:7096 REGISTRY_ADDR=addon-registry.default.svc.cluster.local:5000 NEXUS_ADDR=addon-nexus.default.svc.cluster.local:8081 -CASSANDRA_ADDR=addon-cassandra.default.svc.cluster.local -COLLECTOR_PUBLIC_ADDR=collector.dev.terminus.io HEPA_ADDR=hepa:8080 -EXPORT_USER_WITH_ROLE=true + +# common +DEBUG=true +DICE_ON_DICE=xxxx + +# kratos +ORY_ENABLED=true +ORY_KRATOS_ADDR=kratos:4433 +ORY_KRATOS_PRIVATE_ADDR=kratos:4434 +SESSION_COOKIE_NAME=ory_kratos_session +KRATOS_PRIVATE_ADDR=kratos:4434 +KRATOS_ADDR=kratos:4433 + +# openapi +SELF_PUBLIC_ADDR=one.erda.local:9529 SELF_PUBLIC_URL=openapi:9529 +EXPORT_USER_WITH_ROLE=true +CUSTOM_NAMESPACE=local FDP_UI_ADDR=fdp-ui.default.svc.cluster.local:80 +DICE_LOGIN_CALLBACK=http://one.erda.local:9529/logincb +COOKIE_DOMAIN=.erda.local +CSRF_COOKIE_DOMAIN=.erda.local +REDIRECT_URL_WHITE_LIST=http://uc.erda.local:8080/oauth/authorize +# public urls +UC_PUBLIC_URL=http://uc.erda.local:8080 +UC_PUBLIC_ADDR=uc.erda.local:8080 +COLLECTOR_PUBLIC_ADDR=host.docker.internal:7076 OPENAPI_PUBLIC_ADDR=host.docker.internal:9529 OPENAPI_PUBLIC_URL=http://host.docker.internal:9529 GITTAR_PUBLIC_ADDR=host.docker.internal:5566 GITTAR_PUBLIC_URL=http://host.docker.internal:5566 + NEXUS_PUBLIC_URL=http://nexus-sys.dev.terminus.io NEXUS_PASSWORD=e9FCb8h5cz1960rHLSPGq7H5k85eE9 NEXUS_USERNAME=admin + UI_PUBLIC_ADDR=one.erda.local UI_PUBLIC_URL=http://one.erda.local -DICE_LOGIN_CALLBACK=http://one.erda.local:9529/logincb UC_CLIENT_ID=dice UC_CLIENT_SECRET=secret -COLLECTOR_PUBLIC_URL=https://collector.dev.terminus.io +COLLECTOR_PUBLIC_URL=https://host.docker.internal:7076 DICE_ROOT_DOMAIN=erda.local -COOKIE_DOMAIN=.erda.local -CSRF_COOKIE_DOMAIN=.erda.local -REDIRECT_URL_WHITE_LIST=http://uc.erda.local:8080/oauth/authorize # k8s KUBERNETES_VERSION=v1.16.4 @@ -67,23 +90,36 @@ REDIS_SENTINELS_ADDR=redis-sentinel:26379 REDIS_SENTINELS=redis-sentinel:26379 REDIS_PASSWORD=123456 REDIS_MASTER_NAME=mymaster +REDIS_MASTER_HOST=redis + +# kafka +BOOTSTRAP_SERVERS=kafka:9092 # zookeeper -#ZOOKEEPER_ADDR=zookeeper:2181 +ZOOKEEPER_ADDR=zookeeper:2181 +# elasticsearch ES_SECURITY_USERNAME=undefined ES_URL=http://elasticsearch:9200 ES_SECURITY_ENABLE=false +# cassandra +CASSANDRA_ADDR=cassandra +CASSANDRA_SECURITY_USERNAME=cassandra +CASSANDRA_SECURITY_PASSWORD=cassandra +CASSANDRA_SECURITY_ENABLE=true + +# etcd +ETCDCTL_API=3 +ETCD_ENDPOINTS=http://etcd:2379 + +# sonar SONAR_PUBLIC_URL=http://sonar-sys.erda.local SONAR_ADMIN_TOKEN=123456 SONAR_ADMIN_PASSWORD=123456 - AVATAR_STORAGE_URL=file:///avatars -ETCDCTL_API=3 -ETCD_ENDPOINTS=http://etcd:2379 - +# erda ISTIO_INSTALLED=true CMDB_CONTAINER_TOPIC=spot-metaserver_container @@ -91,7 +127,6 @@ CMDB_CONTAINER_TOPIC=spot-metaserver_container ISTIO_VERSION=1.6.12 LB_MONITOR_URL=http://10.0.7.7:80 -CASSANDRA_SECURITY_ENABLE=false CMDB_HOST_TOPIC=spot-metaserver_host CMDB_GROUP=spot_cmdb_group @@ -112,7 +147,7 @@ DICE_SIZE=test CLUSTER_DNS=172.21.0.10 DICE_CLUSTER_TYPE=kubernetes DICE_IS_EDGE=false -DICE_CLUSTER_NAME=terminus-dev +DICE_CLUSTER_NAME=erda-docker-mock DICE_HTTPS_PORT=443 DICE_HTTP_PORT=80 DICE_STORAGE_MOUNTPOINT=/netdata @@ -122,3 +157,4 @@ DICE_CPU_REQUEST=0.050000 DICE_MEM_REQUEST=256 DICE_CPU_LIMIT=0.300000 DICE_MEM_LIMIT=512 +