Skip to content

Commit 331e4b4

Browse files
committed
feat(contrib/coreos): add etcd debug unit
This adds an optional service to aid in debugging etcd issues. Note that it's only enabled in the cloud-config file, not started. This enables users to `sudo systemctl start debug-etcd` on a machine before performing tasks which may strain etcd (such as heavy IO), and then watch the service's journal to see how things like heartbeat intervals change.
1 parent de24985 commit 331e4b4

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

contrib/coreos/user-data.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ coreos:
5656
ExecStart=/sbin/hwclock --systohc --utc
5757
RemainAfterExit=yes
5858
Type=oneshot
59+
- name: debug-etcd.service
60+
command: enable
61+
content: |
62+
[Unit]
63+
Description=etcd debugging service
64+
65+
[Service]
66+
ExecStartPre=/usr/bin/curl -sSL -o /opt/bin/jq http://stedolan.github.io/jq/download/linux64/jq
67+
ExecStartPre=/usr/bin/chmod +x /opt/bin/jq
68+
ExecStart=/usr/bin/bash -c "while true; do curl -sL http://127.0.0.1:4001/v2/stats/leader | /opt/bin/jq . ; sleep 1 ; done"
5969
write_files:
6070
- path: /etc/deis-release
6171
content: |

0 commit comments

Comments
 (0)