2017年12月31日日曜日

VagrantでOrientDBがインストールされた仮想マシン(Ubuntu16.04)を構築する

以下のVagrantfileを使用して、OrientDBがインストールされた仮想マシンを構築することができます。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "bento/ubuntu-16.04"
  config.vm.hostname = "ub1604orientdb"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "ub1604orientdb"
     vbox.cpus = 2
     vbox.memory = 2048
     vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
  end
  config.vm.network "private_network", ip: "192.168.55.105", :netmask => "255.255.255.0"
  config.vm.network "public_network", ip:"192.168.1.105", :netmask => "255.255.255.0"
  config.vm.provision "shell", inline: <<-SHELL
# update packages
apt-get update
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
locale-gen ja_JP.UTF-8
localectl set-locale LANG=ja_JP.UTF-8

# install java
apt-get -y install openjdk-8-jdk

# download and install orientdb community edition
apt-get -y install unzip
wget http://bit.ly/orientdb-ce-imps-2-2-30 -O orientdb-community-2.2.30.zip
unzip orientdb-community-2.2.30.zip
mv orientdb-community-importers-2.2.30 /opt/orientdb

cat << EOF > /etc/systemd/system/orientdb.service
[Unit]
Description=OrientDB

[Service]
Type=simple
ExecStart=/opt/orientdb/bin/server.sh
ExecStop=/opt/orientdb/bin/shutdown.sh
WorkingDirectory=/opt/orientdb
KillMode=process

[Install]
WantedBy=multi-user.target
EOF
systemctl enable orientdb.service
systemctl start orientdb.service

echo 'access http://192.168.55.105:2480';
echo 'user: admin    password: admin'
SHELL
end

○OrientDB Studioのログイン画面


○OrientDBの画面


0 件のコメント:

コメントを投稿