Skip to content

Commit 511d49c

Browse files
committed
add advertised endpoint to cluster / active fo
1 parent d917c62 commit 511d49c

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Changed from version 0.12.0 to master
22

3+
- Added advertised endpoint to coordinators and active fo
4+
35
- Database upgrade procedure has changed.
46
It is now much more automated and can be triggered using
57
an `arangodb upgrade --starter.endpoint=...` command.

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ var (
8686
logService logging.Service
8787
showVersion bool
8888
id string
89+
advertisedEndpoint string
8990
agencySize int
9091
arangodPath string
9192
arangodJSPath string
@@ -192,7 +193,7 @@ func init() {
192193
pf.StringVar(&logDir, "log.dir", getEnvVar("LOG_DIR", ""), "Custom log file directory.")
193194
f.IntVar(&logRotateFilesToKeep, "log.rotate-files-to-keep", defaultLogRotateFilesToKeep, "Number of files to keep when rotating log files")
194195
f.DurationVar(&logRotateInterval, "log.rotate-interval", defaultLogRotateInterval, "Time between log rotations (0 disables log rotation)")
195-
196+
f.StringVar(&advertisedEndpoint, "cluster.advertised-endpoint", "", "An external endpoint for this cluster")
196197
f.IntVar(&agencySize, "cluster.agency-size", 3, "Number of agents in the cluster")
197198
f.BoolSliceVar(&startAgent, "cluster.start-agent", nil, "should an agent instance be started")
198199
f.BoolSliceVar(&startDBserver, "cluster.start-dbserver", nil, "should a dbserver instance be started")
@@ -707,6 +708,7 @@ func mustPrepareService(generateAutoKeyFile bool) (*service.Service, service.Boo
707708
ArangodPath: arangodPath,
708709
ArangoSyncPath: arangoSyncPath,
709710
ArangodJSPath: arangodJSPath,
711+
AdvertisedEndpoint: advertisedEndpoint,
710712
MasterPort: masterPort,
711713
RrPath: rrPath,
712714
DataDir: dataDir,

service/arangod_config_builder.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,19 +202,30 @@ func createArangodArgs(log zerolog.Logger, config Config, clusterConfig ClusterC
202202
optionPair{"--foxx.queues", "true"},
203203
optionPair{"--server.statistics", "true"},
204204
)
205+
if config.AdvertisedEndpoint != "" {
206+
options = append(options,
207+
optionPair{"--cluster.my-advertised-endpoint", config.AdvertisedEndpoint},
208+
)
209+
}
205210
case ServerTypeSingle:
206211
options = append(options,
207212
optionPair{"--foxx.queues", "true"},
208213
optionPair{"--server.statistics", "true"},
209214
)
210215
case ServerTypeResilientSingle:
211216
options = append(options,
217+
optionPair{"--cluster.my-advertised-endpoint", config.AdvertisedEndpoint},
212218
optionPair{"--foxx.queues", "true"},
213219
optionPair{"--server.statistics", "true"},
214220
optionPair{"--replication.automatic-failover", "true"},
215221
optionPair{"--cluster.my-address", myTCPURL},
216222
optionPair{"--cluster.my-role", "SINGLE"},
217223
)
224+
if config.AdvertisedEndpoint != "" {
225+
options = append(options,
226+
optionPair{"--cluster.my-advertised-endpoint", config.AdvertisedEndpoint},
227+
)
228+
}
218229
}
219230
if serverType != ServerTypeAgent && serverType != ServerTypeSingle {
220231
for _, p := range clusterConfig.AllAgents() {

service/service.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ type Config struct {
5858
ArangodPath string
5959
ArangodJSPath string
6060
ArangoSyncPath string
61+
AdvertisedEndpoint string
6162
MasterPort int
6263
RrPath string
6364
DataDir string

0 commit comments

Comments
 (0)