以下のVagrantfileを使用して、RethinkDBがインストールされた仮想マシン(Ubuntu16.04)を構築する事ができます。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.hostname = "ub1604rethinkdb"
config.vm.provider :virtualbox do |vbox|
vbox.name = "ub1604rethinkdb"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.107", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.107", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
sed -i.bak -e "s#http://archive.ubuntu.com/ubuntu/#http://ftp.riken.jp/pub/Linux/ubuntu/#g" /etc/apt/sources.list
apt-get update
apt-get -y install language-pack-ja
localectl set-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja"
localectl set-keymap jp106
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
# install rethinkdb
echo "deb http://download.rethinkdb.com/apt xenial main" >> /etc/apt/sources.list.d/rethinkdb.list
wget -qO- https://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
apt-get update
apt-get -y install rethinkdb
cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/instance1.conf
mkdir -p /opt/rethinkdb
cd /opt/rethinkdb
rethinkdb create -d "rethinkdb_data"
chown -R rethinkdb:rethinkdb /opt/rethinkdb
cat << EOF >> /etc/rethinkdb/instances.d/instance1.conf
runuser=rethinkdb
rungroup=rethinkdb
directory=/opt/rethinkdb/rethinkdb_data
bind=all
driver-port=28015
cluster-port=29015
http-port=8080
server-name=ub1604rethinkdb
EOF
touch /var/log/rethinkdb
chown rethinkdb:rethinkdb /var/log/rethinkdb
/etc/init.d/rethinkdb restart
echo 'access http://192.168.55.107:8080/'
SHELL
end
〇管理コンソールの画面
○関連情報
・RethinkDBに関する他の記事はこちらを参照してください。
0 件のコメント:
コメントを投稿