kubeasz/roles/etcd/templates/etcd.service.j2

40 lines
1.3 KiB
Plaintext
Raw Normal View History

2017-11-11 19:14:21 +08:00
[Unit]
Description=Etcd Server
After=network.target
After=network-online.target
Wants=network-online.target
Documentation=https://github.com/coreos
[Service]
Type=notify
WorkingDirectory={{ ETCD_DATA_DIR }}
2017-11-11 19:14:21 +08:00
ExecStart={{ bin_dir }}/etcd \
2021-01-07 09:30:50 +08:00
--name=etcd-{{ inventory_hostname }} \
2020-12-30 11:25:54 +08:00
--cert-file={{ ca_dir }}/etcd.pem \
--key-file={{ ca_dir }}/etcd-key.pem \
--peer-cert-file={{ ca_dir }}/etcd.pem \
--peer-key-file={{ ca_dir }}/etcd-key.pem \
2017-11-11 19:14:21 +08:00
--trusted-ca-file={{ ca_dir }}/ca.pem \
--peer-trusted-ca-file={{ ca_dir }}/ca.pem \
--initial-advertise-peer-urls=https://{{ inventory_hostname }}:2380 \
--listen-peer-urls=https://{{ inventory_hostname }}:2380 \
--listen-client-urls=https://{{ inventory_hostname }}:2379,http://127.0.0.1:2379 \
--advertise-client-urls=https://{{ inventory_hostname }}:2379 \
2017-11-11 19:14:21 +08:00
--initial-cluster-token=etcd-cluster-0 \
--initial-cluster={{ ETCD_NODES }} \
--initial-cluster-state={{ CLUSTER_STATE }} \
2021-02-09 17:40:04 +08:00
--data-dir={{ ETCD_DATA_DIR }} \
--wal-dir={{ ETCD_WAL_DIR }} \
2020-03-30 11:12:16 +08:00
--snapshot-count=50000 \
--auto-compaction-retention=1 \
--auto-compaction-mode=periodic \
2021-02-09 17:40:04 +08:00
--max-request-bytes=10485760 \
--quota-backend-bytes=8589934592
2019-07-19 13:47:10 +08:00
Restart=always
2020-03-30 11:12:16 +08:00
RestartSec=15
2017-11-11 19:14:21 +08:00
LimitNOFILE=65536
2020-03-30 11:12:16 +08:00
OOMScoreAdjust=-999
2017-11-11 19:14:21 +08:00
[Install]
WantedBy=multi-user.target