用Graphviz画图LVS的示意图

最近几天写文档比较多,天天都在画图。画了一个LVS的图。之前画Master和Slave的时候不能把这2个放一层,后来看到有subgraph这个属性,可以定义几个是同一个rank来做。

digraph G{  
"x.xxx.com"->{"Master\nLVS1"}[label="192.168.1.250",color=red];  
"x.xxx.com"->{"Slave\nLVS2"}[style=dashed];  
"Master\nLVS1"->{"RS1";"RS3";"RS2"}[color=red,style="filled"];  
"Slave\nLVS2"->{"RS1";"RS3";"RS2"}[color=blue,style=dashed];  
{"Master\nLVS1"[style=filled,fillcolor=red]}->{"Slave\nLVS2"[style=filled,fillcolor=blue]}  [dir=both,label="VRRP VIP\n192.168.1.250",color=blue];  
subgraph {  
rank = same; "Master\nLVS1"; "Slave\nLVS2";  
}  
}

lvs1