Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/debian-9.2"
config.vm.hostname = "db92etcd"
config.vm.provider :virtualbox do |vbox|
vbox.name = "db92etcd"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.106", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.106", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
apt-get -y install task-japanese
sed -i -e 's/# ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=ja_JP.UTF-8
localectl set-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
apt-get update
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
# install etcd
wget https://github.com/coreos/etcd/releases/download/v3.2.11/etcd-v3.2.11-linux-amd64.tar.gz
tar xvfz etcd-v3.2.11-linux-amd64.tar.gz
mv etcd-v3.2.11-linux-amd64 /opt/etcd
cat << EOF > /etc/systemd/system/etcd.service
[Unit]
Description=etcd
[Service]
Type=simple
ExecStart=/opt/etcd/etcd
[Install]
WantedBy=multi-user.target
EOF
systemctl enable etcd.service
systemctl start etcd.service
sleep 10
# テスト実行
/opt/etcd/etcdctl mkdir test
/opt/etcd/etcdctl set test/key1 value1
/opt/etcd/etcdctl get test/key1
SHELL
end
○関連情報
・etcdに関する他の記事はこちらを参照してください。
0 件のコメント:
コメントを投稿