@@ -18,14 +18,7 @@ const (
18
18
// GarbdLogFile is the name log file at which Galera Arbitrator Daemon (garbd) puts logs
19
19
GarbdLogFile = "/tmp/garb.log"
20
20
21
- // GaleraParamsGarbdListenAddr defines an arbitrary listen socket address
22
- // that Galera Arbitrator Daemon (garbd) opens to communicate with the cluster
23
- // https://galeracluster.com/library/documentation/backup-cluster.html
24
- GaleraParamsGarbdListenAddr = "gmcast.listen_addr=tcp://0.0.0.0:" + string (GarbdListenPort )
25
-
26
- // SOCAT is needed after completing sst by Galera Arbitrator (garbd)
27
- // SOCATOptionTCPLISTEN is the SOCAT tcp listen option
28
- SOCATOptionTCPLISTEN = "TCP-LISTEN:" + string (GarbdListenPort )
21
+ // SOCAT is needed after completing sst by Galera Arbitrator Daemon (garbd)
29
22
// SOCATOptionReUseAddr is the SOCAT reuseaddr option
30
23
SOCATOptionReUseAddr = "reuseaddr"
31
24
// SOCATOptionRetry is the default retry value for `socat` binary
@@ -35,12 +28,15 @@ const (
35
28
// ClusterAddressWithListenOption method returns the galera cluster address with
36
29
// the listening option (address at which Galera Cluster listens to connections from
37
30
// other nodes) for `--address` option in `garbd`
31
+ // Here, ‘?gmcast.listen_addr=tcp://0.0.0.0:4444‘ is an arbitrary listen socket address
32
+ // that Galera Arbitrator opens to communicate with the cluster.
33
+ // https://galeracluster.com/library/documentation/backup-cluster.html
38
34
func (g * GaleraArbitratorConfiguration ) ClusterAddressWithListenOption () string {
39
35
if g == nil {
40
36
return ""
41
37
}
42
38
43
- return fmt .Sprintf ("%s?%s " , g .Address , GaleraParamsGarbdListenAddr )
39
+ return fmt .Sprintf ("%s?gmcast.listen_addr=tcp://0.0.0.0:%d " , g .Address , GarbdListenPort )
44
40
}
45
41
46
42
// SSTRequestString method form the sst request string
@@ -56,5 +52,5 @@ func (g *GaleraArbitratorConfiguration) SSTRequestString(host string) string {
56
52
// SOCATOption returns the option string used for `SOCAT` in the
57
53
// percona xtradb backup process
58
54
func SOCATOption (retry int32 ) string {
59
- return fmt .Sprintf ("%s ,%s,retry=%d" , SOCATOptionTCPLISTEN , SOCATOptionReUseAddr , retry )
55
+ return fmt .Sprintf ("TCP-LISTEN:%d ,%s,retry=%d" , GarbdListenPort , SOCATOptionReUseAddr , retry )
60
56
}
0 commit comments