Skip to content

Commit b682c52

Browse files
committed
Remove deprecated ArangoSync component and ActiveFailover mode
1 parent 12b389b commit b682c52

38 files changed

+183
-2579
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# ArangoDB Starter Changelog
22

33
## [master](https://github.com/arangodb-helper/arangodb/tree/master) (N/A)
4+
- Remove deprecated ArangoSync component and ActiveFailover mode
45

56
## [v0.18.3](https://github.com/arangodb-helper/arangodb/tree/0.18.3) (2024-03-05)
67
- Mark ArangoSync component as deprecated

client/api.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2017 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2017-2024 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -17,8 +17,6 @@
1717
//
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
20-
// Author Ewout Prangsma
21-
//
2220

2321
package client
2422

@@ -74,7 +72,7 @@ type API interface {
7472
// If there is no plan, a NotFoundError will be returned.
7573
AbortDatabaseUpgrade(ctx context.Context) error
7674

77-
// Status returns the status of any upgrade plan
75+
// UpgradeStatus returns the status of any upgrade plan
7876
UpgradeStatus(context.Context) (UpgradeStatus, error)
7977

8078
Inventory(ctx context.Context) (api.Inventory, error)
@@ -124,8 +122,6 @@ const (
124122
ServerTypeDBServer = ServerType("dbserver")
125123
ServerTypeAgent = ServerType("agent")
126124
ServerTypeSingle = ServerType("single")
127-
ServerTypeSyncMaster = ServerType("syncmaster")
128-
ServerTypeSyncWorker = ServerType("syncworker")
129125
)
130126

131127
// ServerProcess holds all information of a single server started by the starter.

help.go

+1-78
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2018-2024 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -17,8 +17,6 @@
1717
//
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
20-
// Author Ewout Prangsma
21-
//
2220

2321
package main
2422

@@ -113,81 +111,6 @@ func showSslAutoKeyAndKeyFileNotBothAllowedHelp() {
113111
)
114112
}
115113

116-
// arangosync is not allowed with given starter mode.
117-
func showArangoSyncNotAllowedWithModeHelp(mode string) {
118-
showFatalHelp(
119-
fmt.Sprintf("ArangoSync is not supported in combination with mode '%s'\n", mode),
120-
"",
121-
"How to solve this:",
122-
"1 - Use the cluster starter mode:",
123-
"",
124-
" `arangodb --starter.mode=cluster --starter.sync ...`",
125-
"",
126-
)
127-
}
128-
129-
// --sync.server.keyfile is missing
130-
func showSyncMasterServerKeyfileMissingHelp() {
131-
showFatalHelp(
132-
"A TLS certificate used for the HTTPS connection of the arangosync syncmaster is missing.",
133-
"",
134-
"How to solve this:",
135-
"1 - If you do not have TLS CA certificate certificate, create it using the following command:",
136-
"",
137-
" `arangodb create tls ca \\",
138-
" --cert=<yourfolder>/tls-ca.crt --key=<yourfolder>/tls-ca.key`",
139-
"",
140-
"2 - Distribute the resulting `tls-ca.crt` file to all machines (in both datacenters) that you run the starter on.",
141-
"3 - Create a TLS certificate certificate, using the following command:",
142-
"",
143-
" `arangodb create tls keyfile \\",
144-
" --cacert=<yourfolder>/tls-ca.crt --cakey=<yourfolder>/tls-ca.key \\",
145-
" --keyfile=<yourfolder>/tls.keyfile \\",
146-
" --host=<current host address/name>`",
147-
"",
148-
"4 - Add a commandline argument:",
149-
"",
150-
" `arangodb ... --sync.server.keyfile=<yourfolder>/tls.keyfile`",
151-
"",
152-
)
153-
}
154-
155-
// --sync.server.client-cafile is missing
156-
func showSyncMasterClientCAFileMissingHelp() {
157-
showFatalHelp(
158-
"A CA certificate used for client authentication of the arangosync syncmaster is missing.",
159-
"",
160-
"How to solve this:",
161-
"1 - Create a client authentication CA certificate using the following command:",
162-
"",
163-
" `arangodb create client-auth ca --cert=<yourfolder>/client-auth-ca.crt --key=<yourfolder>/client-auth-ca.key`",
164-
"",
165-
"2 - Distribute the resulting `client-auth-ca.crt` file to all machines (in both datacenters) that you run the starter on.",
166-
"3 - Add a commandline argument:",
167-
"",
168-
" `arangodb ... --sync.server.client-cafile=<yourfolder>/client-auth-ca.crt`",
169-
"",
170-
)
171-
}
172-
173-
// --sync.master.jwt-secret is missing
174-
func showSyncMasterJWTSecretMissingHelp() {
175-
showFatalHelp(
176-
"A JWT secret used for authentication of the arangosync syncworkers at the syncmaster is missing.",
177-
"",
178-
"How to solve this:",
179-
"1 - If needed, create JWT secret file using the following command:",
180-
"",
181-
" `arangodb create jwt-secret --secret=<yourfolder>/syncmaster.jwtsecret`",
182-
"",
183-
"2 - Distribute the resulting `syncmaster.jwtsecret` file to all machines in the current datacenter, that you run the starter on.",
184-
"3 - Add a commandline argument:",
185-
"",
186-
" `arangodb ... --sync.master.jwt-secret=<yourfolder>/syncmaster.jwtsecret`",
187-
"",
188-
)
189-
}
190-
191114
// showFatalHelp logs a title and prints additional usages
192115
// underneeth and the exit with code 1.
193116
// Backticks in the lines are colored yellow.

main.go

+26-111
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import (
3333
"syscall"
3434
"time"
3535

36-
"github.com/dchest/uniuri"
3736
homedir "github.com/mitchellh/go-homedir"
3837
"github.com/pkg/errors"
3938
"github.com/rs/zerolog"
@@ -63,7 +62,6 @@ const (
6362
defaultDockerGCDelay = time.Minute * 10
6463
defaultDockerStarterImage = "arangodb/arangodb-starter"
6564
defaultArangodPath = "/usr/sbin/arangod"
66-
defaultArangoSyncPath = "/usr/sbin/arangosync"
6765
defaultConfigFilePath = "arangodb-starter.conf"
6866
defaultLogRotateFilesToKeep = 5
6967
defaultLogRotateInterval = time.Minute * 60 * 24
@@ -149,8 +147,6 @@ func init() {
149147
f.StringVar(&opts.starter.dataDir, "starter.data-dir", getEnvVar("DATA_DIR", "."), "directory to store all data the starter generates (and holds actual database directories)")
150148
f.BoolVar(&opts.starter.debugCluster, "starter.debug-cluster", getEnvVar("DEBUG_CLUSTER", "") != "", "If set, log more information to debug a cluster")
151149
f.BoolVar(&opts.starter.disableIPv6, "starter.disable-ipv6", !net.IsIPv6Supported(), "If set, no IPv6 notation will be used. Use this only when IPv6 address family is disabled")
152-
f.BoolVar(&opts.starter.enableSync, "starter.sync", false, "If set, the starter will also start arangosync instances")
153-
f.MarkDeprecated("starter.sync", "ArangoSync component is deprecated and will be removed in coming releases")
154150
f.DurationVar(&opts.starter.instanceUpTimeout, "starter.instance-up-timeout", defaultInstanceUpTimeout, "Timeout to wait for an instance start")
155151
if err := features.JWTRotation().RegisterDeprecated(f); err != nil {
156152
panic(err)
@@ -164,13 +160,9 @@ func init() {
164160
f.BoolSliceVar(&opts.cluster.startAgent, "cluster.start-agent", nil, "should an agent instance be started")
165161
f.BoolSliceVar(&opts.cluster.startDBServer, "cluster.start-dbserver", nil, "should a dbserver instance be started")
166162
f.BoolSliceVar(&opts.cluster.startCoordinator, "cluster.start-coordinator", nil, "should a coordinator instance be started")
167-
f.BoolSliceVar(&opts.cluster.startActiveFailover, "cluster.start-single", nil, "should an active-failover single server instance be started")
168-
f.MarkDeprecated("cluster.start-single", "Active-Failover (resilient-single) mode is deprecated and will be removed in coming releases")
169163

170164
f.BoolVar(&opts.server.useLocalBin, "server.use-local-bin", false, "If true, starter will try searching for binaries in local directory first")
171165
f.StringVar(&opts.server.arangodPath, "server.arangod", defaultArangodPath, "Path of arangod")
172-
f.StringVar(&opts.server.arangoSyncPath, "server.arangosync", defaultArangoSyncPath, "Path of arangosync")
173-
f.MarkDeprecated("server.arangosync", "ArangoSync component is deprecated and will be removed in coming releases")
174166
f.StringVar(&opts.server.arangodJSPath, "server.js-dir", "/usr/share/arangodb3/js", "Path of arango JS folder")
175167
f.StringVar(&opts.server.rrPath, "server.rr", "", "Path of rr")
176168
f.IntVar(&opts.server.threads, "server.threads", 0, "Adjust server.threads of each server")
@@ -181,8 +173,6 @@ func init() {
181173

182174
f.StringVar(&opts.docker.Endpoint, "docker.endpoint", "unix:///var/run/docker.sock", "Endpoint used to reach the docker daemon")
183175
f.StringVar(&opts.docker.ImageArangoD, "docker.image", getEnvVar("DOCKER_IMAGE", ""), "name of the Docker image to use to launch arangod instances (leave empty to avoid using docker)")
184-
f.StringVar(&opts.docker.ImageArangoSync, "docker.sync-image", getEnvVar("DOCKER_ARANGOSYNC_IMAGE", ""), "name of the Docker image to use to launch arangosync instances")
185-
f.MarkDeprecated("docker.sync-image", "ArangoSync component is deprecated and will be removed in coming releases")
186176
f.StringVar(&opts.docker.imagePullPolicyRaw, "docker.imagePullPolicy", "", "pull docker image from docker hub (Always|IfNotPresent|Never)")
187177
f.StringVar(&opts.docker.User, "docker.user", "", "use the given name as user to run the Docker container")
188178
f.StringVar(&opts.docker.HostContainerName, "docker.container", "", "name of the docker container that is running this process")
@@ -201,21 +191,6 @@ func init() {
201191
f.StringVar(&opts.ssl.autoServerName, "ssl.auto-server-name", "", "Server name put into self-signed certificate. See --ssl.auto-key")
202192
f.StringVar(&opts.ssl.autoOrganization, "ssl.auto-organization", "ArangoDB", "Organization name put into self-signed certificate. See --ssl.auto-key")
203193

204-
f.BoolSliceVar(&opts.sync.startSyncMaster, "sync.start-master", nil, "should an ArangoSync master instance be started (only relevant when starter.sync is enabled)")
205-
f.MarkDeprecated("sync.start-master", "ArangoSync component is deprecated and will be removed in coming releases")
206-
f.BoolSliceVar(&opts.sync.startSyncWorker, "sync.start-worker", nil, "should an ArangoSync worker instance be started (only relevant when starter.sync is enabled)")
207-
f.MarkDeprecated("sync.start-worker", "ArangoSync component is deprecated and will be removed in coming releases")
208-
f.StringVar(&opts.sync.monitoring.token, "sync.monitoring.token", "", "Bearer token used to access ArangoSync monitoring endpoints")
209-
f.MarkDeprecated("sync.monitoring.token", "ArangoSync component is deprecated and will be removed in coming releases")
210-
f.StringVar(&opts.sync.master.jwtSecretFile, "sync.master.jwt-secret", "", "File containing JWT secret used to access the Sync Master (from Sync Worker)")
211-
f.MarkDeprecated("sync.master.jwt-secret", "ArangoSync component is deprecated and will be removed in coming releases")
212-
f.StringVar(&opts.sync.mq.Type, "sync.mq.type", "direct", "Type of message queue used by the Sync Master")
213-
f.MarkDeprecated("sync.mq.type", "ArangoSync component is deprecated and will be removed in coming releases")
214-
f.StringVar(&opts.sync.server.keyFile, "sync.server.keyfile", "", "TLS keyfile of local sync master")
215-
f.MarkDeprecated("sync.server.keyfile", "ArangoSync component is deprecated and will be removed in coming releases")
216-
f.StringVar(&opts.sync.server.clientCAFile, "sync.server.client-cafile", "", "CA Certificate used for client certificate verification")
217-
f.MarkDeprecated("sync.server.client-cafile", "ArangoSync component is deprecated and will be removed in coming releases")
218-
219194
cmdMain.Flags().SetNormalizeFunc(normalizeOptionNames)
220195

221196
config, flags, err := passthroughPrefixes.Parse(os.Args...)
@@ -360,7 +335,6 @@ func main() {
360335
var isBuild bool
361336
opts.server.arangodPath, isBuild = arangodb.FindExecutable(log, "arangod", defaultArangodPath, opts.server.useLocalBin)
362337
opts.server.arangodJSPath = findJSDir(opts.server.arangodPath, isBuild)
363-
opts.server.arangoSyncPath, _ = arangodb.FindExecutable(log, "arangosync", defaultArangoSyncPath, opts.server.useLocalBin)
364338

365339
if err := cmdMain.Execute(); err != nil {
366340
os.Exit(1)
@@ -517,7 +491,6 @@ func mustPrepareService(generateAutoKeyFile bool) (*service.Service, service.Boo
517491
// Expand home-dis (~) in paths
518492
opts.server.arangodPath = mustExpand(opts.server.arangodPath)
519493
opts.server.arangodJSPath = mustExpand(opts.server.arangodJSPath)
520-
opts.server.arangoSyncPath = mustExpand(opts.server.arangoSyncPath)
521494
opts.server.rrPath = mustExpand(opts.server.rrPath)
522495
opts.starter.dataDir = mustExpand(opts.starter.dataDir)
523496
opts.auth.jwtSecretFile = mustExpand(opts.auth.jwtSecretFile)
@@ -585,53 +558,6 @@ func mustPrepareService(generateAutoKeyFile bool) (*service.Service, service.Boo
585558
}
586559

587560
serviceMode := service.ServiceMode(opts.starter.mode)
588-
if serviceMode.IsActiveFailoverMode() || optionalBool(opts.cluster.startActiveFailover, false) {
589-
log.Warn().Msgf("Active-Failover (resilient-single) mode is deprecated and will be removed in coming releases")
590-
}
591-
592-
// Check sync settings
593-
if opts.starter.enableSync {
594-
// Check mode
595-
if !serviceMode.SupportsArangoSync() {
596-
showArangoSyncNotAllowedWithModeHelp(opts.starter.mode)
597-
}
598-
if !runningInDocker {
599-
// Check arangosync executable
600-
if _, err := os.Stat(opts.server.arangoSyncPath); os.IsNotExist(err) {
601-
opts.sync.binaryFoundErr = fmt.Errorf("cannot find `arangosync` (expected at `%s`)", opts.server.arangoSyncPath)
602-
}
603-
log.Debug().Msgf("Using %s as default arangosync executable.", opts.server.arangoSyncPath)
604-
} else {
605-
// Check arangosync docker image
606-
if opts.docker.ImageArangoSync == "" {
607-
// Default to arangod docker image
608-
opts.docker.ImageArangoSync = opts.docker.ImageArangoD
609-
}
610-
}
611-
if startMaster := optionalBool(opts.sync.startSyncMaster, true); startMaster {
612-
if opts.sync.server.keyFile == "" {
613-
showSyncMasterServerKeyfileMissingHelp()
614-
}
615-
if opts.sync.server.clientCAFile == "" {
616-
showSyncMasterClientCAFileMissingHelp()
617-
}
618-
}
619-
if opts.sync.master.jwtSecretFile == "" {
620-
if opts.auth.jwtSecretFile != "" {
621-
// Use cluster JWT secret
622-
opts.sync.master.jwtSecretFile = opts.auth.jwtSecretFile
623-
} else {
624-
showSyncMasterJWTSecretMissingHelp()
625-
}
626-
}
627-
if opts.sync.monitoring.token == "" {
628-
opts.sync.monitoring.token = uniuri.New()
629-
}
630-
log.Warn().Msgf("ArangoSync component is deprecated and will be removed in coming releases")
631-
} else {
632-
opts.sync.startSyncMaster = []bool{false}
633-
opts.sync.startSyncWorker = []bool{false}
634-
}
635561

636562
// Create service
637563
bsCfg := service.BootstrapConfig{
@@ -643,9 +569,6 @@ func mustPrepareService(generateAutoKeyFile bool) (*service.Service, service.Boo
643569
StartAgent: mustGetOptionalBoolRef("cluster.start-agent", opts.cluster.startAgent),
644570
StartDBserver: mustGetOptionalBoolRef("cluster.start-dbserver", opts.cluster.startDBServer),
645571
StartCoordinator: mustGetOptionalBoolRef("cluster.start-coordinator", opts.cluster.startCoordinator),
646-
StartResilientSingle: mustGetOptionalBoolRef("cluster.start-single", opts.cluster.startActiveFailover),
647-
StartSyncMaster: mustGetOptionalBoolRef("sync.start-master", opts.sync.startSyncMaster),
648-
StartSyncWorker: mustGetOptionalBoolRef("sync.start-worker", opts.sync.startSyncWorker),
649572
ServerStorageEngine: opts.server.storageEngine,
650573
JwtSecret: jwtSecret,
651574
SslKeyFile: opts.ssl.keyFile,
@@ -656,40 +579,32 @@ func mustPrepareService(generateAutoKeyFile bool) (*service.Service, service.Boo
656579
}
657580
bsCfg.Initialize()
658581
serviceConfig := service.Config{
659-
ArangodPath: opts.server.arangodPath,
660-
ArangoSyncPath: opts.server.arangoSyncPath,
661-
ArangodJSPath: opts.server.arangodJSPath,
662-
AdvertisedEndpoint: opts.cluster.advertisedEndpoint,
663-
MasterPort: opts.starter.masterPort,
664-
RrPath: opts.server.rrPath,
665-
DataDir: opts.starter.dataDir,
666-
LogDir: opts.log.dir,
667-
OwnAddress: opts.starter.ownAddress,
668-
BindAddress: opts.starter.bindAddress,
669-
MasterAddresses: opts.starter.masterAddresses,
670-
Verbose: opts.log.verbose,
671-
ServerThreads: opts.server.threads,
672-
AllPortOffsetsUnique: opts.starter.allPortOffsetsUnique,
673-
LogRotateFilesToKeep: opts.log.rotateFilesToKeep,
674-
LogRotateInterval: opts.log.rotateInterval,
675-
InstanceUpTimeout: opts.starter.instanceUpTimeout,
676-
RunningInDocker: docker.IsRunningInDocker(),
677-
DockerConfig: opts.docker.DockerConfig,
678-
DockerStarterImage: dockerStarterImage,
679-
ProjectBuild: projectBuild,
680-
DebugCluster: opts.starter.debugCluster,
681-
SyncEnabled: opts.starter.enableSync,
682-
SyncMonitoringToken: opts.sync.monitoring.token,
683-
SyncMasterKeyFile: opts.sync.server.keyFile,
684-
SyncMasterClientCAFile: opts.sync.server.clientCAFile,
685-
SyncMasterJWTSecretFile: opts.sync.master.jwtSecretFile,
686-
SyncMQType: opts.sync.mq.Type,
687-
SyncBinaryFoundErr: opts.sync.binaryFoundErr,
688-
Configuration: passthroughOpts,
689-
}
690-
service := service.NewService(context.Background(), log, logService, serviceConfig, bsCfg, false)
691-
692-
return service, bsCfg
582+
ArangodPath: opts.server.arangodPath,
583+
ArangodJSPath: opts.server.arangodJSPath,
584+
AdvertisedEndpoint: opts.cluster.advertisedEndpoint,
585+
MasterPort: opts.starter.masterPort,
586+
RrPath: opts.server.rrPath,
587+
DataDir: opts.starter.dataDir,
588+
LogDir: opts.log.dir,
589+
OwnAddress: opts.starter.ownAddress,
590+
BindAddress: opts.starter.bindAddress,
591+
MasterAddresses: opts.starter.masterAddresses,
592+
Verbose: opts.log.verbose,
593+
ServerThreads: opts.server.threads,
594+
AllPortOffsetsUnique: opts.starter.allPortOffsetsUnique,
595+
LogRotateFilesToKeep: opts.log.rotateFilesToKeep,
596+
LogRotateInterval: opts.log.rotateInterval,
597+
InstanceUpTimeout: opts.starter.instanceUpTimeout,
598+
RunningInDocker: docker.IsRunningInDocker(),
599+
DockerConfig: opts.docker.DockerConfig,
600+
DockerStarterImage: dockerStarterImage,
601+
ProjectBuild: projectBuild,
602+
DebugCluster: opts.starter.debugCluster,
603+
Configuration: passthroughOpts,
604+
}
605+
svc := service.NewService(context.Background(), log, logService, serviceConfig, bsCfg, false)
606+
607+
return svc, bsCfg
693608
}
694609

695610
// getEnvVar returns the value of the environment variable with given key of the given default

0 commit comments

Comments
 (0)