Skip to content

Commit

Permalink
Reintroduce keygen and password from server code
Browse files Browse the repository at this point in the history
  • Loading branch information
svaroqui committed Feb 22, 2022
1 parent 504c044 commit 3b8b1a2
Show file tree
Hide file tree
Showing 106 changed files with 275 additions and 299 deletions.
25 changes: 1 addition & 24 deletions etc/opensvc/cluster-api/cluster-demo/stephane.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ opensvc-p12-certificate = "etc/opensvc/cluster-api/cluster-demo/signal18.p12"
opensvc-host = "10.8.0.15:1215"
opensvc-p12-secret = "36vf2cczf8rms8hh"

#include ="etc/opensvc/cluster-api/cluster-demo/stephane.d"
include ="etc/opensvc/cluster-api/cluster-demo/stephane.d"
# log-heartbeat = true

log-file="/var/log/replication-manager/replication-manager.log"
Expand Down Expand Up @@ -32,26 +32,3 @@ prov-proxy-agents = "s18-fr-1,s18-fr-2"
prov-proxy-service-type = "docker"
prov-proxy-disk-type = "volume"
prov-proxy-volume-data = "tank"



[echo]
title = "test"
db-servers-hosts = "db1,db2"
db-servers-prefered-master = "db1"
db-servers-connect-timeout = 1
#failover-mode = "automatic"
#autorejoin-mysqldump = true
#autorejoin-flashback = true
#failover-falsepositive-heartbeat = false
#force-slave-semisync = true
#force-sync-binlog = true
#force-sync-innodb = true
#force-slave-failover-readonly-state = true
#failover-falsepositive-ping-counter = 3
#failover-limit = 999
#failover-time-limit = 1
prov-db-docker-img = "mariadb:10.5"
prov-db-tags = "smallredolog,semisync,innodb,noquerycache,threadpool,logslow"
haproxy=true
haproxy-servers = "haproxy1"
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func init() {
monitorCmd.Flags().IntVar(&conf.HostsDelayedTime, "replication-delayed-time", 3600, "Delayed replication time")

monitorCmd.Flags().IntVar(&conf.MasterConnectRetry, "replication-master-connect-retry", 10, "Replication is define using this connection retry timeout")
monitorCmd.Flags().StringVar(&conf.RplUser, "replication-credential", "", "Replication user in the [user]:[password] format")
monitorCmd.Flags().StringVar(&conf.RplUser, "replication-credential", "root:mariadb", "Replication user in the [user]:[password] format")
monitorCmd.Flags().BoolVar(&conf.ReplicationSSL, "replication-use-ssl", false, "Replication use SSL encryption to replicate from master")
monitorCmd.Flags().BoolVar(&conf.MultiMaster, "replication-multi-master", false, "Multi-master topology")
monitorCmd.Flags().BoolVar(&conf.MultiMasterWsrep, "replication-multi-master-wsrep", false, "Enable Galera multi-master")
Expand Down Expand Up @@ -481,7 +481,7 @@ func init() {
monitorCmd.Flags().StringVar(&conf.ProvServicePlanRegistry, "prov-service-plan-registry", "https://docs.google.com/spreadsheets/d/e/2PACX-1vQClXknRapJZ4bRSId_aa5zUrbFDZmmc6GiV3n7-tPyQJispqqnSJj6lMaJxoJv5pOC9Ktj8ywWdGX6/pub?gid=0&single=true&output=csv", "URL to csv service plan list")
// monitorCmd.Flags().StringVar(&conf.ProvServicePlanRegistry, "prov-service-plan-registry", "http://gsx2json.com/api?id=130326CF_SPaz-flQzCRPE-w7FjzqU1NqbsM7MpIQ_oU&sheet=1&columns=false", "URL to json service plan list")
monitorCmd.Flags().StringVar(&conf.ProvServicePlan, "prov-service-plan", "", "Cluster plan")
monitorCmd.Flags().BoolVar(&conf.Test, "test", true, "Enable non regression tests")
monitorCmd.Flags().BoolVar(&conf.Test, "test", false, "Enable non regression tests")
monitorCmd.Flags().BoolVar(&conf.TestInjectTraffic, "test-inject-traffic", false, "Inject some database traffic via proxy")
monitorCmd.Flags().IntVar(&conf.SysbenchTime, "sysbench-time", 100, "Time to run benchmark")
monitorCmd.Flags().IntVar(&conf.SysbenchThreads, "sysbench-threads", 4, "Number of threads to run benchmark")
Expand Down
3 changes: 0 additions & 3 deletions password.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build server
// +build server

// replication-manager - Replication Manager Monitoring and CLI for MariaDB and MySQL
// Copyright 2017-2021 SIGNAL18 CLOUD SAS
// Authors: Guillaume Lefranc <guillaume@signal18.io>
Expand Down
1 change: 1 addition & 0 deletions regtest/regtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func (regtest *RegTest) CopyConfig(cl *cluster.Cluster, test cluster.Test) error
}
dstFile := cl.GetIncludeDir() + "/" + filepath.Base(srcFile)
cl.LogPrintf("INFO", "Copy from %s to %s", srcFile, dstFile)
os.Remove(dstFile)
misc.CopyFile(srcFile, dstFile)
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions server/regtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ func (repman *ReplicationManager) RunAllTests(cl *cluster.Cluster, testExp strin
if testExp == "SUITE" {
regtest.CopyConfig(cl, test)
repman.InitConfig(repman.Conf)
cl.ReloadConfig(repman.Confs["test"])
cl = repman.getClusterByName("test")
cl.ReloadConfig(repman.Confs["regtest"])
cl = repman.getClusterByName("regtest")
if !cl.InitTestCluster(test.ConfigFile, &test) {
test.Result = "ERR"
continue
Expand Down
3 changes: 2 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (repman *ReplicationManager) InitConfig(conf config.Config) {
if !f.IsDir() && strings.HasSuffix(f.Name(), ".toml") {
viper.SetConfigName(f.Name())
viper.SetConfigFile(conf.ClusterConfigPath + "/" + f.Name())
// viper.Debug()
viper.Debug()
viper.AutomaticEnv()
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_", ".", "_"))

Expand Down Expand Up @@ -270,6 +270,7 @@ func (repman *ReplicationManager) InitConfig(conf config.Config) {

if strings.Contains(k, ".") {
mycluster := strings.Split(k, ".")[0]
log.Infof("Evaluate key %s %s", mycluster, k)
if strings.ToLower(mycluster) != "default" {
if strings.HasPrefix(mycluster, "saved-") {
mycluster = strings.TrimPrefix(mycluster, "saved-")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311,192.168.100.72"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311,192.168.100.72"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311,192.168.100.72"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311,192.168.100.72"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311,192.168.100.72"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "127.0.0.1:3310,127.0.0.1:3311,192.168.100.72"
db-servers-prefered-master = "127.0.0.1:3310"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81,192.168.100.82"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81,192.168.100.82"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81,192.168.100.82"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81,192.168.100.82"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81,192.168.100.82"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81,192.168.100.82"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81,192.168.100.82"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81,192.168.100.82"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.80,192.168.100.81,192.168.100.82"
db-servers-prefered-master = "192.168.100.80"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config.toml
# Example replication-manager configuration file
[test]
[regtest]
title = "test"
db-servers-hosts = "192.168.100.90,192.168.100.91"
db-servers-prefered-master = "192.168.100.90"
Expand Down
Loading

0 comments on commit 3b8b1a2

Please sign in to comment.