Vagrantfile
VVAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/centos-7.3"
config.vm.hostname = "couchdb"
config.vm.provider :virtualbox do |vbox|
vbox.name = "couchdb"
vbox.cpus = 4
vbox.memory = 4096
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
# private network
config.vm.network "private_network", ip: "192.168.55.109", :netmask => "255.255.255.0"
# bridge netwrok
config.vm.network "public_network", ip: "192.168.1.109", :netmask => "255.255.255.0"
config.vm.network "forwarded_port", guest:22, host:20022, id:"ssh"
config.vm.provision "shell", inline: <<-SHELL
cat << EOF > /etc/yum.repos.d/bintray-apache-couchdb-rpm.repo
[bintray--apache-couchdb-rpm]
name=bintray--apache-couchdb-rpm
baseurl=http://apache.bintray.com/couchdb-rpm/el7/x86_64/
gpgcheck=0
repo_gpgcheck=0
enabled=1
EOF
yum -y install epel-release
yum -y install couchdb
sed -i -e 's/bind_address = 127.0.0.1/bind_address = 0.0.0.0/' /opt/couchdb/etc/default.ini
cat << EOF > /etc/systemd/system/couchdb
[Unit]
Description=CouchDB
After=syslog.target
After=network.target
[Service]
User=couchdb
Type=simple
ExecStart=/opt/couchdb/bin/couchdb
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=couchdb
[Install] WantedBy=multi-user.target
EOF
systemctl enable couchdb
systemctl start couchdb
echo 'access : http://192.168.55.109:5984/_utils/index.html'
SHELL
end
構築完了後、ブラウザでhttp://192.168.55.109:5984/_utils/index.htmlにアクセスすると、以下のような画面が表示されます。○関連情報
・CouchDBに関する他の記事はこちらを参照してください。
0 件のコメント:
コメントを投稿