Created
July 1, 2014 14:20
-
-
Save zembutsu/ff34f526803fd082463f to your computer and use it in GitHub Desktop.
Serf Cheat Sheet 日本語版 ref: http://qiita.com/zembutsu/items/1e2cddd0a424ef7a4895
This file contains hidden or 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
| $ wget -O 0.6.2_linux_amd64.zip https://dl.bintray.com/mitchellh/serf/0.6.2_linux_amd64.zip | |
| $ unzip ./0.6.2_linux_amd64.zip | |
| # cp ./serf /usr/bin/serf |
This file contains hidden or 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
| $ serf -v | |
| Serf v0.6.2 | |
| Agent Protocol: 4 (Understands back to: 2) |
This file contains hidden or 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
| $ serf agent -config-file=./host.json |
This file contains hidden or 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
| $ killall -HUP serf | |
| $ killall -1 serf |
This file contains hidden or 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
| [node1]$ serf agent & |
This file contains hidden or 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
| [node2]$ serf agent & |
This file contains hidden or 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
| [node2]$ serf join 192.168.19.1 |
This file contains hidden or 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
| $ serf members | |
| node1 192.168.10.1 alive | |
| node2 192.168.10.2 alive |
This file contains hidden or 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
| [node2]$ serf event 'Hello, World' | |
| 2013/12/05 19:36:17 [INFO] agent: Received event: user-event: Hello world |
This file contains hidden or 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
| $ serf event -rpc-addr=102.168.39.3:7373 test aaa |
This file contains hidden or 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
| $ serf agent -name=node1 |
This file contains hidden or 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
| { | |
| "node_name": "node1" | |
| } |
This file contains hidden or 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
| { | |
| "node_name": "miku3", | |
| "tags": { | |
| "role": "develop", | |
| "network": "local" | |
| }, | |
| "interface": "eth1", | |
| "discover": "mikusan", | |
| "encrypt_key": "o6Md8LBVhwPi2UnbJBAwNA==", | |
| "log_level": "debug", | |
| "leave_on_terminate": true, | |
| "skip_leave_on_interrupt": true, | |
| "reconnect_interval": "5s", | |
| "reconnect_timeout": "30m", | |
| "tombstone_timeout": "30m", | |
| "event_handlers": [ | |
| "./event.sh", | |
| "user:deploy=./deploy.sh" | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment