-
Notifications
You must be signed in to change notification settings - Fork 723
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
etcd: add systemd unit support for clustering
Refer https://etcd.io/docs/v3.5/op-guide/clustering/ for etcd clustering design background details. etcd-new.service triggers only, when the config file available in the specified path. This generic serive helps to start etcd cluster based on the project specific use cases and config files. etcd-new.service only required to run on initial setup or new node add into the existing cluster. All other use cases use regular etcd.service to start etcd with existing cluster configuration. Signed-off-by: ojayanth <[email protected]> Signed-off-by: Khem Raj <[email protected]>
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Unit] | ||
Description=Monitor the etcd config file changes | ||
|
||
[Path] | ||
PathChanged=/run/etcd-new.conf | ||
Unit=etcd-new.service | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=etcd cluster member start/add service | ||
Documentation=https://etcd.io/docs/v3.5/op-guide/clustering/ | ||
ConditionPathExists=!/var/lib/etcd/member | ||
ConditionPathExists=/run/etcd-new.conf | ||
OnFailure=etcd.service | ||
|
||
[Service] | ||
Type=notify | ||
EnvironmentFile=/run/etcd-new.conf | ||
ExecStart=/usr/bin/etcd | ||
Restart=no | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters