ラベル ArchLinux の投稿を表示しています。 すべての投稿を表示
ラベル ArchLinux の投稿を表示しています。 すべての投稿を表示

2018年2月17日土曜日

VagrantでApache ActiveMQがインストールされた仮想マシン(Arch Linux)を構築する

以下のVagrantfileを使用して、Apache ActiveMQをインストールした仮想マシン(Arch Linux)を構築する事ができます。
仮想マシン構築後、ブラウザからhttp://192.168.55.107:8161で管理画面にアクセスします。デフォルトのユーザはadmin、パスワードもadminです。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "archlinux/archlinux"
  config.vm.hostname = "alzeppelin"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "alzeppelin"
     vbox.cpus = 4
     vbox.memory = 4096
     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
# update packages
pacman -Syy

# install java and wget
pacman --noconfirm -S  jdk8-openjdk wget


# install activemq
wget  http://ftp.tsukuba.wide.ad.jp/software/apache/activemq/5.15.2/apache-activemq-5.15.2-bin.tar.gz
tar xvfz apache-activemq-5.15.2-bin.tar.gz
mv apache-activemq-5.15.2 /opt/activemq
cat << EOF > /etc/systemd/system/activemq.service
[Unit]
Description=Apache ActiveMQ
After=syslog.target network.target

[Service]
Type=forking
ExecStart=/opt/activemq/bin/activemq start
ExecStop=/opt/activemq/bin/activemq stop
KillMode=none

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

echo 'access to http://192.168.55.107:8161'
SHELL
end

〇ActiveMQの画面


○関連情報
・Apache ActiveMQに関する他の記事はこちらを参照してください。

・ActiveMQのプロジェクトwebサイト
http://activemq.apache.org/

2018年1月16日火曜日

VagrantでpgwebとPostgreSQLがインストールされた仮想マシン(Arch Linux)を構築する

以下のVagrantfileを使用して、pgwebとPostgreSQLをインストールした仮想マシン(Arch Linux)を構築する事ができます。
仮想マシン構築後、ブラウザからhttp://192.168.55.107:8080/にアクセスします。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "archlinux/archlinux"
  config.vm.hostname = "alpgweb"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "alpgweb"
     vbox.cpus = 4
     vbox.memory = 4096
     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


# update packages
pacman -Syy

# set locale
pacman --noconfirm -S  locale-gen
sed -i -e 's/#ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen
locale-gen

# install postgresql
pacman --noconfirm -S  postgresql

# initialize postgresql server
sudo -u postgres -H initdb --locale ja_JP.UTF-8 -E UTF8 -D '/var/lib/postgres/data'
echo "listen_addresses='*'" >> /var/lib/postgres/data/postgresql.conf
echo "standard_conforming_strings=off" >> /var/lib/postgres/data/postgresql.conf
#sed -i 's/host.*all.*all.*127.0.0.1/#host    all             all             127.0.0.1/g' /var/lib/postgres/data/pg_hba.conf
echo "host    all         all         127.0.0.1/32          password" >> /var/lib/postgres/data/pg_hba.conf
echo "host    all         all         192.168.1.0/24          password" >> /var/lib/postgres/data/pg_hba.conf
echo "host    all         all         192.168.55.0/24          password" >> /var/lib/postgres/data/pg_hba.conf
chown -R postgres:postgres /var/lib/postgres/data/
systemctl start postgresql.service
su - postgres << EOF
psql -c "
alter user postgres with password 'postgres';
"
EOF
echo "postgres:postgres" | chpasswd

# install pgweb
pacman --noconfirm -S unzip wget
wget https://github.com/sosedoff/pgweb/releases/download/v0.9.11/pgweb_linux_amd64.zip
unzip pgweb_linux_amd64.zip
mkdir -p /opt/pgweb
mv pgweb_linux_amd64 /opt/pgweb

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

[Service]
Type=simple
ExecStart=/opt/pgweb/pgweb_linux_amd64 --sessions --bind=0.0.0.0 --listen=8080
WorkingDirectory=/opt/pgweb
Restart=always
RestartSec=10

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

echo 'access http://192.168.55.107:8080/'
echo 'user: postgres, password: postgres'

SHELL
end

〇pgwebの画面



○関連情報
・pgwebに関する他の記事はこちらを参照してください。

2018年1月14日日曜日

VagrantでApache Zeppelinをインストールした仮想マシン(Arch Linux)を構築する

以下のVagrantfileを使用して、Apache Zeppelinがインストールされた仮想マシン(Arch Linux)を構築する事ができます。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "archlinux/archlinux"
  config.vm.hostname = "alzeppelin"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "alzeppelin"
     vbox.cpus = 4
     vbox.memory = 4096
     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
# update packages
pacman -Syy

# install java and wget
pacman --noconfirm -S  jdk8-openjdk wget


# install Apache Zeppelin
wget http://ftp.riken.jp/net/apache/zeppelin/zeppelin-0.7.3/zeppelin-0.7.3-bin-all.tgz
tar xvfz zeppelin-0.7.3-bin-all.tgz
mv zeppelin-0.7.3-bin-all /opt/zeppelin
cat << EOF > /etc/systemd/system/zeppelin.service
[Unit]
Description=Apache Zeppelin
[Service]
Type=forking
ExecStart=/opt/zeppelin/bin/zeppelin-daemon.sh start
ExecStop=/opt/zeppelin/bin/zeppelin-daemon.sh stop
WorkingDirectory=/opt/zeppelin
KillMode=process
PrivateTmp=true
[Install]
WantedBy=multi-user.target
EOF
systemctl enable zeppelin.service
systemctl start zeppelin.service

echo 'access http://192.168.55.107:8080'

SHELL
end

〇Apache Zeppelinの画面



○関連情報
・Apache Zeppelinに関する他の記事はこちらを参照してください。

2018年1月9日火曜日

VagrantでApache NiFi 1.4.0をインストールした仮想マシン(Arch Linux)を構築する

以下のVagrantfileを使用して、Apache NiFi 1.4.0がインストールされた仮想マシン(Arch Linux)を構築する事ができます。
仮想マシン構築後、ブラウザでhttp://192.168.1.107:8080/nifi/にアクセスします。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "archlinux/archlinux"
  config.vm.hostname = "alnifi"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "alnifi"
     vbox.cpus = 4
     vbox.memory = 4096
     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
# update packages
pacman -Syy

# maximum file handles & maximum forked processes
echo '*  hard  nofile  50000' >> /etc/security/limits.conf
echo '*  soft  nofile  50000' >> /etc/security/limits.conf
echo '*  hard  nproc  10000' >> /etc/security/limits.conf
echo '*  soft  nproc  10000' >> /etc/security/limits.conf

echo '*  soft  nproc  10000' >> /etc/security/limits.d/90-nproc

# install java and wget
pacman --noconfirm -S  jdk8-openjdk wget

# Apache Nifiのダウンロード
wget http://ftp.riken.jp/net/apache/nifi/1.4.0/nifi-1.4.0-bin.tar.gz
tar xvfz nifi-1.4.0-bin.tar.gz
mv nifi-1.4.0 /opt

#サービスとして登録
cat << EOF > /etc/systemd/system/nifi.service
[Unit]
Description=Apache Nifi
After=syslog.target network.target

[Service]
Type=forking
ExecStart=/opt/nifi-1.4.0/bin/nifi.sh start
ExecStop=/opt/nifi-1.4.0/bin/nifi.sh stop
KillMode=none

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

echo 'access url -> http://192.168.1.107:8080/nifi/'
SHELL
end

〇Apache NiFiの画面


2018年1月8日月曜日

VagrantでPostgreSQLをインストールした仮想マシン(Arch Linux)を構築する

以下のVagrantfileを使用して、PostgreSQLがインストールされた仮想マシン(Arch Linux)を構築する事ができます。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "archlinux/archlinux"
  config.vm.hostname = "alpgsql"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "alpgsql"
     vbox.cpus = 4
     vbox.memory = 4096
     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
# update packages
pacman -Syy
# set locale
pacman --noconfirm -S  locale-gen
sed -i -e 's/#ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
# install postgresql
pacman --noconfirm -S  postgresql
# initialize postgresql server
sudo -u postgres -H initdb --locale ja_JP.UTF-8 -E UTF8 -D '/var/lib/postgres/data'
echo "listen_addresses='*'" >> /var/lib/postgres/data/postgresql.conf
echo "standard_conforming_strings=off" >> /var/lib/postgres/data/postgresql.conf
#sed -i 's/host.*all.*all.*127.0.0.1/#host    all             all             127.0.0.1/g' /var/lib/postgres/data/pg_hba.conf
echo "host    all         all         127.0.0.1/32          password" >> /var/lib/postgres/data/pg_hba.conf
echo "host    all         all         192.168.1.0/24          password" >> /var/lib/postgres/data/pg_hba.conf
echo "host    all         all         192.168.55.0/24          password" >> /var/lib/postgres/data/pg_hba.conf
chown -R postgres:postgres /var/lib/postgres/data/
systemctl start postgresql.service
su - postgres << EOF
psql -c "
alter user postgres with password 'postgres';
"
EOF
echo "postgres:postgres" | chpasswd
SHELL
end