补充cmdb设计
This commit is contained in:
parent
5597e735fc
commit
dcd5136a8c
@ -1 +1,2 @@
|
||||
# 微服务项目(cmdb)
|
||||
# 微服务项目(cmdb)
|
||||
|
||||
|
32
devcloud-mini/cmdb/README.md
Normal file
32
devcloud-mini/cmdb/README.md
Normal file
@ -0,0 +1,32 @@
|
||||
# cmdb
|
||||
|
||||
## 需求
|
||||
|
||||
核心: 资源管理(资源中心): ECS, RDS, DOMAIN, IP, ...
|
||||
|
||||
怎么进行资源管理: excel,手动管理, 无法其他系统对接(核心数据)
|
||||
1. 资源检索: IP --> 是那个业务方(ECS, EIP, ELB, ...)
|
||||
2. 资源过期提醒
|
||||
3. 密码轮转
|
||||
4. 自动化的系统,自动部署(app --> app ecs)
|
||||
5. 监控, 自动发现,这个机器是那个业务方,不能把高级直接发给业务方
|
||||
6. 管理,登录维护,谁能登录哪些机器,以什么用户
|
||||
|
||||
## 设计
|
||||
|
||||
资源管理模型的设计:
|
||||
|
||||
1. 基于模型的CMDB设计
|
||||
|
||||
|
||||
|
||||
2. 云管的CMDB设计
|
||||
|
||||
|
||||
## 功能模块开发
|
||||
|
||||
|
||||
|
||||
|
||||
## 接入用户中心,接入审计中心
|
||||
|
61
devcloud-mini/cmdb/docs/model.drawio
Normal file
61
devcloud-mini/cmdb/docs/model.drawio
Normal file
@ -0,0 +1,61 @@
|
||||
<mxfile host="65bd71144e">
|
||||
<diagram id="0q7lRh8tqNagHdUdpmmi" name="第 1 页">
|
||||
<mxGraphModel dx="873" dy="570" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0"/>
|
||||
<mxCell id="1" parent="0"/>
|
||||
<mxCell id="2" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="270" y="140" width="120" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="3" value="动态模型库" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
||||
<mxGeometry x="250" y="20" width="150" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="4" value="Actor" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
|
||||
<mxGeometry x="90" y="50" width="30" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="10" style="edgeStyle=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.25;entryDx=0;entryDy=0;" edge="1" parent="1" source="5" target="2">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="5" value="使用者" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
||||
<mxGeometry x="80" y="140" width="60" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="6" value="Actor" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
|
||||
<mxGeometry x="550" y="50" width="30" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="8" style="edgeStyle=none;html=1;exitX=0;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="7" target="2">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="7" value="系统配置人员" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
||||
<mxGeometry x="520" y="140" width="100" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="9" value="<h1 style="margin-top: 0px;">模型创建</h1><p>虚拟机:&nbsp;</p><p>&nbsp; &nbsp; 1. IP, 说明,数据类型, ...</p><p>&nbsp; &nbsp; 2. Name</p><p>&nbsp; &nbsp; 3. 创建时间</p>" style="text;html=1;whiteSpace=wrap;overflow=hidden;rounded=0;" vertex="1" parent="1">
|
||||
<mxGeometry x="640" y="40" width="180" height="160" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="14" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0;exitY=0.3333333333333333;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="12" target="2">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="12" value="Actor" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
|
||||
<mxGeometry x="550" y="240" width="30" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="13" value="数据录入" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
||||
<mxGeometry x="530" y="330" width="100" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="15" value="<h1 style="margin-top: 0px;">录入数据</h1><p>虚拟机:&nbsp; 1. 阿里云,10.10.1.1, ...</p>" style="text;html=1;whiteSpace=wrap;overflow=hidden;rounded=0;" vertex="1" parent="1">
|
||||
<mxGeometry x="640" y="240" width="180" height="160" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="16" value="IP" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="45" y="180" width="120" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="17" value="github: 蓝鲸,其他的一些商业产品, 是个底座,上层的业务功能需要自己开发(需求), 开发周期很长" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
||||
<mxGeometry x="40" y="350" width="280" height="70" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="18" value="云管业务模块(业务开发模型)" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
||||
<mxGeometry x="270" y="450" width="220" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="19" value="" style="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image=https://gitee.com/infraboard/go-course/raw/master/image/cmdb/cmdb.png;" vertex="1" parent="1">
|
||||
<mxGeometry x="39" y="490" width="750" height="391.88" as="geometry"/>
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
90
devcloud-mini/cmdb/docs/rpc.drawio
Normal file
90
devcloud-mini/cmdb/docs/rpc.drawio
Normal file
@ -0,0 +1,90 @@
|
||||
<mxfile host="65bd71144e">
|
||||
<diagram id="lpFlQF22u-EUjqCC0xD_" name="第 1 页">
|
||||
<mxGraphModel dx="873" dy="504" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0"/>
|
||||
<mxCell id="1" parent="0"/>
|
||||
<mxCell id="13" style="edgeStyle=none;html=1;exitX=0;exitY=0.25;exitDx=0;exitDy=0;entryX=1;entryY=0.25;entryDx=0;entryDy=0;" edge="1" parent="1" source="2" target="3">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="14" value="鉴权" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="13">
|
||||
<mxGeometry x="0.1647" relative="1" as="geometry">
|
||||
<mxPoint as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="20" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="2" target="19">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="22" style="edgeStyle=none;html=1;exitX=0;exitY=0.75;exitDx=0;exitDy=0;entryX=1;entryY=0.75;entryDx=0;entryDy=0;" edge="1" parent="1" source="2" target="3">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="23" value="RPC(获取用户名称)<div>(user_ids ...)</div>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="22">
|
||||
<mxGeometry x="0.2912" y="1" relative="1" as="geometry">
|
||||
<mxPoint x="23" y="14" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="2" value="cmdb" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="364" y="290" width="120" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="3" value="mcenter<div>用户中心</div>" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="70" y="290" width="120" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="7" style="edgeStyle=none;html=1;exitX=0;exitY=0.3333333333333333;exitDx=0;exitDy=0;exitPerimeter=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="4" target="6">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="4" value="Actor" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
|
||||
<mxGeometry x="670" y="100" width="30" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="9" style="edgeStyle=none;html=1;exitX=0.75;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="5" target="2">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="28" value="RPC" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="9">
|
||||
<mxGeometry x="-0.2297" y="2" relative="1" as="geometry">
|
||||
<mxPoint as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="10" style="edgeStyle=none;html=1;exitX=0.25;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="5" target="3">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="27" value="RPC" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="10">
|
||||
<mxGeometry x="-0.3174" y="-3" relative="1" as="geometry">
|
||||
<mxPoint as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="5" value="业务逻辑 封装( 业务网关)<div>ecs_list (cmdb ecs_list, user_list)</div>" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="70" y="180" width="410" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="25" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="6" target="24">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="6" value="UI" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="70" y="20" width="410" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="15" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="560" y="230" width="240" height="140" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="16" value="ecs&nbsp; user_name" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="580" y="250" width="120" height="20" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="17" value="ecs&nbsp; user_name" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="580" y="280" width="120" height="20" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="18" value="ecs user_name" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="580" y="310" width="120" height="20" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="19" value="ecs&nbsp; user_id, user_name" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="356" y="400" width="136" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="21" value="user" style="shape=cube;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;darkOpacity=0.05;darkOpacity2=0.1;" vertex="1" parent="1">
|
||||
<mxGeometry x="215" y="470" width="120" height="80" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="26" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="24" target="5">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="24" value="&nbsp;API Gateway<div>/api</div>" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="70" y="100" width="410" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
@ -14,7 +14,7 @@ import (
|
||||
func main() {
|
||||
// Deprecated: use WithTransportCredentials and insecure.NewCredentials()
|
||||
// instead. Will be supported throughout 1.x.
|
||||
conn, err := grpc.NewClient("localhost:1234", grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
conn, err := grpc.NewClient("localhost:18080", grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"net"
|
||||
"context"
|
||||
|
||||
"github.com/infraboard/mcube/v2/ioc"
|
||||
grpc_server "github.com/infraboard/mcube/v2/ioc/config/grpc"
|
||||
"github.com/infraboard/mcube/v2/ioc/server"
|
||||
|
||||
_ "gitlab.com/go-course-project/go17/skills/grpc/mcube/apps/hello"
|
||||
)
|
||||
@ -13,14 +13,18 @@ func main() {
|
||||
// ioc 的初始化
|
||||
ioc.DevelopmentSetup()
|
||||
|
||||
server := grpc_server.Get().Server()
|
||||
if err := server.Run(context.Background()); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// 2. 启动grpc服务
|
||||
lis, err := net.Listen("tcp", ":1234")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err := server.Serve(lis); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
// server := grpc_server.Get().Server()
|
||||
|
||||
// // 2. 启动grpc服务
|
||||
// lis, err := net.Listen("tcp", ":1234")
|
||||
// if err != nil {
|
||||
// panic(err)
|
||||
// }
|
||||
// if err := server.Serve(lis); err != nil {
|
||||
// panic(err)
|
||||
// }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user