Skip to content

Instantly share code, notes, and snippets.

# etcd -peer-addr 127.0.0.1:7001 -addr 127.0.0.1:4001 \
-data-dir /opt/etcd -name machine1
$ wget -O 0.3.0_linux_amd64.zip https://dl.bintray.com/mitchellh/consul/0.3.0_linux_amd64.zip
$ unzip ./0.3.0_linux_amd64.zip
# cp ./consul /usr/bin/consul
$ 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
@zembutsu
zembutsu / file0.txt
Created June 24, 2014 13:18
envconsulのビルド方法と動作確認 ref: http://qiita.com/zembutsu/items/6ef3d5f35d72a95cf2cd
$ mkdir -p ~/go/src/github.com/armon
$ cd ~/go/src/github.com/armon
$ git clone git@github.com:armon/consul-kv.git
@zembutsu
zembutsu / dns_config.json
Created June 18, 2014 06:11
Consulのノードやサービス検出でTTL値の設定 ref: http://qiita.com/zembutsu/items/4965ec2e3ff7838673a1
{
"dns_config": {
"service_ttl": {
"*": "5s",
"web": "30s"
}
"allow_stale": false ,
"max_stale": "5s",
}
}
@zembutsu
zembutsu / file0.txt
Created June 18, 2014 04:42
Consulの名前解決にDNS Forwardingを使う方法 ref: http://qiita.com/zembutsu/items/ea05fbeff06cafb5ec2e
$ dig @sakura1.pocketstudio.net -p 8600 web.service.sakura.consul
(略)
;; QUESTION SECTION:
;web.service.sakura.consul. IN A
;; ANSWER SECTION:
web.service.sakura.consul. 30 IN A 192.168.39.11
web.service.sakura.consul. 30 IN A 192.168.39.13
@zembutsu
zembutsu / init_munin2
Created June 9, 2014 06:49
An init script for Munin 2.1.x that is installed to /opt/munin.
#! /bin/sh
#
# munin-node Control the Munin Node Server (formerly Linpro RRD client)
#
# chkconfig: 2345 90 10
# description: munin node agents
# processname: munin-node
# config: /etc/opt/munin/munin-node.conf
# pidfile: /var/run/munin/munin-node.pid
@zembutsu
zembutsu / Makefile.config
Created June 7, 2014 08:39
Makefile.config for Munin 2.1.x; This is similer to setup like package's directory hierarcy.
# -*- makefile -*-
#
# This is the Makefile.config file to use for a "clean" distribution.
#
# This file specifies where Munin will look for things after you've
# run 'make' in the source directory. Modify it to suit your needs.
# DESTDIR is meant only for use when making Munin packages. Unless
# you're doing packaging do NOT set it.
# DESTDIR is empty during building, and optionally set to point to
@zembutsu
zembutsu / serf-etcdconf.pl
Created May 1, 2014 04:47
It is generated JSON file of serf dynamically by etcd. I made it experimentally, but do not maintain it recently.
#!/usr/bin/perl
# Serf configuration generator with Etcd
#
# MIT License
# 2014 Masahito Zembutsu
use JSON::XS;
use Net::HTTP;
use Data::Dumper;
@zembutsu
zembutsu / serf2excel.pl
Created April 18, 2014 05:08
serf2excel makes a list of hosts file of the Excel format from 'serf members'.
#!/usr/bin/perl
use Encode;
use Spreadsheet::WriteExcel;
$serf = '/usr/bin/serf';
my ($sec, $min, $hour, $day, $month, $year, $wday) = localtime;
$year += 1900;