db.sql 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. use bilibili_apm_v2;
  2. CREATE TABLE `overlord_appid` (
  3. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  4. `tree_id` int(11) NOT NULL DEFAULT '0' COMMENT '服务树id',
  5. `app_id` varchar(50) NOT NULL DEFAULT '' COMMENT '业务appid',
  6. `cid` int(11) NOT NULL DEFAULT '0' COMMENT '关联集群id',
  7. `ctime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  8. `mtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  9. PRIMARY KEY (`id`),
  10. UNIQUE KEY `uk_appids_name` (`tree_id`, `cid`),
  11. KEY `ix_appid` (`app_id`),
  12. KEY `ix_mtime` (`mtime`)
  13. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='业务关联集群';
  14. CREATE TABLE `overlord_cluster` (
  15. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  16. `name` varchar(50) NOT NULL DEFAULT '' COMMENT '集群名字',
  17. `type` varchar(20) NOT NULL DEFAULT '' COMMENT '集群类型',
  18. `zone` varchar(20) NOT NULL DEFAULT 'sh001' COMMENT '机房',
  19. `hash_method` varchar(20) NOT NULL DEFAULT '' COMMENT 'hash方法',
  20. `hash_distribution` varchar(20) NOT NULL DEFAULT '' COMMENT '分布策略',
  21. `hashtag` varchar(10) NOT NULL DEFAULT '' COMMENT 'hash tag',
  22. `listen_proto` varchar(10) NOT NULL DEFAULT 'tcp' COMMENT '监听协议',
  23. `listen_addr` varchar(30) NOT NULL DEFAULT '' COMMENT '监听地址',
  24. `nodeconn` int(11) NOT NULL DEFAULT '1' COMMENT '跟节点连接数',
  25. `dial` int(11) NOT NULL DEFAULT '1000' COMMENT 'dial 超时',
  26. `read` int(11) NOT NULL DEFAULT '1000' COMMENT 'read超时',
  27. `write` int(11) NOT NULL DEFAULT '1000' COMMENT 'write 超时',
  28. `ping_fail_limit` int(11) NOT NULL DEFAULT '3' COMMENT '失败检测次数',
  29. `auto_eject` tinyint(4) NOT NULL DEFAULT '1' COMMENT 'auto eject',
  30. `ctime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  31. `mtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  32. PRIMARY KEY (`id`),
  33. UNIQUE KEY `uk_name` (`name`),
  34. KEY `ix_mtime` (`mtime`)
  35. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='集群';
  36. CREATE TABLE `overlord_node` (
  37. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  38. `cid` int(11) NOT NULL DEFAULT '0' COMMENT '关联集群id',
  39. `alias` varchar(50) NOT NULL DEFAULT '' COMMENT '节点别名',
  40. `addr` varchar(50) NOT NULL DEFAULT '' COMMENT '节点地址',
  41. `weight` int(11) NOT NULL DEFAULT '1' COMMENT '节点权重',
  42. `ctime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  43. `mtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  44. PRIMARY KEY (`id`),
  45. UNIQUE KEY `uk_cid_alias` (`cid`,`alias`),
  46. KEY `ix_mtime` (`mtime`)
  47. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='节点';