@@ -37,7 +37,8 @@ Sakura-DBCは、内部的に以下の4つの状態を持ち、状況に応じて
37
37
## BGP経路の属性
38
38
39
39
Sakura-DBCは、BGP経路のCommunity属性として表現することで、他のノードに自身の状態を広告します。
40
- データベースサーバでは、デーモンとして起動するdb-controllerにgobgpが組み込まれており、BGPピアを確立します。
40
+
41
+ vtyshコマンドを経由してFRRouting bgpdの設定を変更し、経路広告を行います。
41
42
42
43
| 状態 | BGP Community |
43
44
| --------- | ------------- |
@@ -52,16 +53,16 @@ Sakura-DBCは、BGP経路のCommunity属性として表現することで、他
52
53
Sakura-DBCを起動するには以下のようにコマンドを入力します。
53
54
54
55
```
55
- # systemctl start db -controller
56
- # systemctl status db -controller
57
- ● db -controller.service - Database Controller
58
- Loaded: loaded (/etc/systemd/system/db -controller.service; enabled; vendor preset: disabled)
56
+ [root@test-db1 ~] # systemctl start sakura -controller
57
+ [root@test-db1 ~] # systemctl status sakura -controller
58
+ ● sakura -controller.service - Database Controller
59
+ Loaded: loaded (/etc/systemd/system/sakura -controller.service; enabled; vendor preset: disabled)
59
60
Active: active (running) since Thu 2023-07-13 16:56:21 JST; 4s ago
60
- Main PID: 1391344 (db-controller )
61
+ Main PID: 1391344 (sakura-controll )
61
62
Tasks: 9 (limit: 24876)
62
63
Memory: 5.5M
63
- CGroup: /system.slice/db -controller.service
64
- └─1391344 /root/distributed-mariadb-controller/bin/db -controller --log-level info --db-repilica-password-filepath /root/.db-replica-password
64
+ CGroup: /system.slice/sakura -controller.service
65
+ └─1391344 /root/distributed-mariadb-controller/bin/sakura -controller --log-level info --db-repilica-password-filepath /root/.db-replica-password
65
66
<snip>
66
67
```
67
68
@@ -70,12 +71,12 @@ Sakura-DBCを起動するには以下のようにコマンドを入力します
70
71
Sakura-DBCを停止するには以下のようにコマンドを入力します。
71
72
72
73
```
73
- # systemctl stop db -controller
74
- # systemctl status db -controller
74
+ [root@test-db1 ~] # systemctl stop sakura -controller
75
+ [root@test-db1 ~] # systemctl status sakura -controller
75
76
● sakura-controller.service - Database Controller
76
- Loaded: loaded (/etc/systemd/system/db -controller.service; enabled; vendor preset: disabled)
77
+ Loaded: loaded (/etc/systemd/system/sakura -controller.service; enabled; vendor preset: disabled)
77
78
Active: inactive (dead) since Thu 2023-07-13 16:55:35 JST; 7s ago
78
- Process: 694 ExecStart=/root/distributed-mariadb-controller/bin/db -controller --log-level info --db-repilica-password-filepath /root/.db-replica-password (code=exited, status=0/SUCCESS)
79
+ Process: 694 ExecStart=/root/distributed-mariadb-controller/bin/sakura -controller --log-level info --db-repilica-password-filepath /root/.db-replica-password (code=exited, status=0/SUCCESS)
79
80
Main PID: 694 (code=exited, status=0/SUCCESS)
80
81
<snip>
81
82
```
@@ -85,15 +86,15 @@ Sakura-DBCを停止するには以下のようにコマンドを入力します
85
86
Sakura-DBCは、状態遷移や、それに伴い実行したコマンドなどをログ出力します。ログを確認するにはjournalctlコマンドを利用します。
86
87
87
88
```
88
- # journalctl -u db -controller -e
89
+ journalctl -u sakura -controller -e
89
90
```
90
91
91
92
## 現在の内部状態の確認方法
92
93
93
94
Sakura-DBCの現在の状態を確認するには、curlコマンドなどで以下のエンドポイントをHTTPリクエストします。
94
95
95
96
```
96
- # curl http://127.0.0.1:54545/status
97
+ [root@test-db1 ~] # curl http://127.0.0.1:54545/status
97
98
{"state":"replica"}
98
99
```
99
100
@@ -103,7 +104,7 @@ Sakura-DBCがGSLBに対し、どのようにレスポンスを行っているか
103
104
104
105
```
105
106
! primaryの場合(200 OKが返る)
106
- # curl -v http://127.0.0.1:54545/healthcheck
107
+ [root@test-db2 ~] # curl -v http://127.0.0.1:54545/healthcheck
107
108
* Connected to 127.0.0.1 (127.0.0.1) port 54545 (#0)
108
109
> GET /healthcheck HTTP/1.1
109
110
> Host: 127.0.0.1:54545
@@ -113,7 +114,7 @@ Sakura-DBCがGSLBに対し、どのようにレスポンスを行っているか
113
114
< Content-Length: 0
114
115
115
116
! primary以外の場合(503 Service Unavailableが返る)
116
- # curl -v http://127.0.0.1:54545/healthcheck
117
+ [root@test-db1 ~] # curl -v http://127.0.0.1:54545/healthcheck
117
118
* Connected to 127.0.0.1 (127.0.0.1) port 54545 (#0)
118
119
> GET /healthcheck HTTP/1.1
119
120
> Host: 127.0.0.1:54545
@@ -125,12 +126,10 @@ Sakura-DBCがGSLBに対し、どのようにレスポンスを行っているか
125
126
126
127
## BGP経路の確認方法
127
128
128
- ### アンカーサーバ
129
-
130
129
BGPピアの状態を確認するには、以下のようにvtyshコマンドを用います。
131
130
132
131
```
133
- # vtysh -c 'show ip bgp summary'
132
+ [root@test-db1 ~] # vtysh -c 'show ip bgp summary'
134
133
135
134
IPv4 Unicast Summary (VRF default):
136
135
BGP router identifier xx.xx.xx.xx, local AS number 65001 vrf-id 0
@@ -148,7 +147,7 @@ Total number of neighbors 2
148
147
BGP経路情報を確認するには、以下のようにvtyshコマンドを用います。
149
148
150
149
```
151
- # vtysh -c 'show ip bgp'
150
+ [root@test-db1 ~] # vtysh -c 'show ip bgp'
152
151
BGP table version is 4, local router ID is xx.xx.xx.xx, vrf id 0
153
152
Default local pref 100, local AS 65001
154
153
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
@@ -168,7 +167,7 @@ RPKI validation codes: V valid, I invalid, N Not found
168
167
169
168
Displayed 3 routes and 5 total paths
170
169
171
- # vtysh -c 'show ip bgp community-list primary'
170
+ [root@test-db1 ~] # vtysh -c 'show ip bgp community-list primary'
172
171
<snip>
173
172
174
173
Network Next Hop Metric LocPrf Weight Path
@@ -178,47 +177,23 @@ Displayed 3 routes and 5 total paths
178
177
Displayed 1 routes and 5 total paths
179
178
```
180
179
181
- ### DBサーバ
182
-
183
- BGPピアの状態を確認するには、以下のようにgobgpコマンドを用います。
184
- db-controllerがgobgpのgRPCポート(50051)を待ち受けており、そこから情報が取得されます。
185
-
186
- ```
187
- # gobgp neighbor
188
- Peer AS Up/Down State |#Received Accepted
189
- xx.xx.xx.xx 65001 00:30:02 Establ | 1 1
190
- xx.xx.xx.xx 65001 00:31:05 Establ | 3 2
191
- ```
192
-
193
- BGP経路情報を確認するには、以下のようにgobgpコマンドを用います。
194
-
195
- ```
196
- # gobgp global rib
197
- Network Next Hop AS_PATH Age Attrs
198
- *> xx.xx.xx.xx/32 xx.xx.xx.xx 00:34:41 [{Origin: i} {Communities: 65001:3}]
199
- *> xx.xx.xx.xx/32 xx.xx.xx.xx 00:34:18 [{Origin: i} {LocalPref: 100} {Communities: 65001:4} {Originator: xx.xx.xx.xx} {ClusterList: [xx.xx.xx.xx]}]
200
- * xx.xx.xx.xx/32 xx.xx.xx.xx 00:34:35 [{Origin: i} {LocalPref: 100} {Communities: 65001:4} {Originator: xx.xx.xx.xx} {ClusterList: [xx.xx.xx.xx]}]
201
- *> xx.xx.xx.xx/32 xx.xx.xx.xx 00:00:00 [{Origin: i} {Med: 0} {LocalPref: 100} {Communities: 65001:10} {Originator: xx.xx.xx.xx} {ClusterList: [xx.xx.xx.xx]}]
202
- * xx.xx.xx.xx/32 xx.xx.xx.xx 00:35:20 [{Origin: i} {Med: 0} {LocalPref: 100} {Communities: 65001:10}]
203
- ```
204
-
205
180
## ログレベルの変更方法
206
181
207
182
[ クイックスタートガイド] ( quick-start-guide.md ) の手順では、通常の運用において推奨されるinfoログレベルにて設定するようになっています。
208
183
もし、ログレベルを変更するには、以下のようにします。
209
184
210
185
```
211
- # vi /etc/systemd/system/db -controller.service
186
+ vi /etc/systemd/system/sakura -controller.service
212
187
213
- ! ログレベルを変更します(debugに変更する場合)
214
- ExecStart = /root/distributed-mariadb-controller/bin/db -controller --log-level debug ...
188
+ ! infoになっている部分を変更します
189
+ ExecStart = /root/distributed-mariadb-controller/bin/sakura -controller --log-level info --db-repilica-password-filepath /root/.db-replica-password
215
190
```
216
191
217
- systemdに反映し、db-controllerを再起動します 。
192
+ systemdに反映し、Sakura-DBCを再起動します 。
218
193
219
194
```
220
- # systemctl daemon-reload
221
- # systemctl restart db -controller
195
+ systemctl daemon-reload
196
+ systemctl restart sakura -controller
222
197
```
223
198
224
199
指定可能なログレベルと、各レベルにおいて出力されるログの基準は以下の通りです。
0 commit comments