Skip to content

Commit 2f2998b

Browse files
committed
Fixes & docs
1 parent 8f454d4 commit 2f2998b

File tree

5 files changed

+65
-4
lines changed

5 files changed

+65
-4
lines changed

.vscode/settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
33
"go.testFlags": ["-v"],
4-
"go.testTimeout": "600s"
4+
"go.testTimeout": "600s",
5+
"search.exclude": {
6+
"**/node_modules": true,
7+
"**/bower_components": true,
8+
"vendor": true
9+
}
510
}

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,62 @@ docker run -it --name=adb --rm -p 8528:8528 \
194194
--starter.mode=single
195195
```
196196

197+
Starting a resilient single server pair
198+
---------------------------------------
199+
200+
If you want to start a resilient single database server, use `--starter.mode=resilientsingle`.
201+
In this mode a 3 machine agency is started and 2 single servers that perform
202+
asynchronous replication an failover if needed.
203+
204+
```
205+
arangodb --starter.mode=resilientsingle --starter.join A,B,C
206+
```
207+
208+
Run this on machine A, B & C.
209+
210+
The starter will decide on which 2 machines to run a single server instance.
211+
To override this decision (only valid while bootstrapping), add a
212+
`--cluster.start-single=false` to the machine where the single server
213+
instance should NOT be scheduled.
214+
215+
Starting a resilient single server pair in Docker
216+
-------------------------------------------------
217+
218+
If you want to start a resilient single database server running in docker containers,
219+
use the normal docker arguments, combined with `--starter.mode=resilientsingle`.
220+
221+
```
222+
export IP=<IP of docker host>
223+
docker volume create arangodb
224+
docker run -it --name=adb --rm -p 8528:8528 \
225+
-v arangodb:/data \
226+
-v /var/run/docker.sock:/var/run/docker.sock \
227+
arangodb/arangodb-starter \
228+
--starter.address=$IP \
229+
--starter.mode=resilientsingle \
230+
--starter.join=A,B,C
231+
```
232+
233+
Run this on machine A, B & C.
234+
235+
The starter will decide on which 2 machines to run a single server instance.
236+
To override this decision (only valid while bootstrapping), add a
237+
`--cluster.start-single=false` to the machine where the single server
238+
instance should NOT be scheduled.
239+
240+
Starting a local test resilient single sever pair
241+
-------------------------------------------------
242+
243+
If you want to start a local resilient server pair quickly, use the `--starter.local` flag.
244+
It will start all servers within the context of a single starter process.
245+
246+
```
247+
arangodb --starter.local --starter.mode=resilientsingle
248+
```
249+
250+
Note: When you restart the started, it remembers the original `--starter.local` flag.
251+
252+
197253
Starting & stopping in detached mode
198254
------------------------------------
199255

service/arangod_config_builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ func createArangodArgs(log *logging.Logger, config Config, clusterConfig Cluster
250250
options = append(options,
251251
optionPair{"--foxx.queues", "true"},
252252
optionPair{"--server.statistics", "true"},
253-
optionPair{"--replication.auto-failover", "true"},
253+
optionPair{"--replication.automatic-failover", "true"},
254254
optionPair{"--cluster.my-role", "SINGLE"},
255255
)
256256
}

service/runtime_server_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func (s *runtimeServerManager) runArangod(ctx context.Context, log *logging.Logg
222222
if up, version, statusTrail, cancelled := runtimeContext.TestInstance(ctx, myHostAddress, port, statusChanged); !cancelled {
223223
if up {
224224
log.Infof("%s up and running (version %s).", serverType, version)
225-
if (serverType == ServerTypeCoordinator && !runtimeContext.IsLocalSlave()) || serverType == ServerTypeSingle {
225+
if (serverType == ServerTypeCoordinator && !runtimeContext.IsLocalSlave()) || serverType == ServerTypeSingle || serverType == ServerTypeResilientSingle {
226226
hostPort, err := p.HostPort(port)
227227
if err != nil {
228228
if id := p.ContainerID(); id != "" {

service/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ func (s *Service) Run(rootCtx context.Context, bsCfg BootstrapConfig, myPeers Cl
818818
s.sslKeyFile = bsCfg.SslKeyFile
819819

820820
// Check mode & flags
821-
if bsCfg.Mode.IsClusterMode() {
821+
if bsCfg.Mode.IsClusterMode() || bsCfg.Mode.IsResilientSingleMode() {
822822
if bsCfg.AgencySize < 1 {
823823
return maskAny(fmt.Errorf("AgentSize must be >= 1"))
824824
}

0 commit comments

Comments
 (0)