VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/centos-7.3"
config.vm.hostname = "nifi"
config.vm.provider :virtualbox do |vbox|
vbox.name = "nifi"
vbox.cpus = 4
vbox.memory = 8192
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
# private network
config.vm.network "private_network", ip: "192.168.55.88", :netmask => "255.255.255.0"
# bridge netwrok
config.vm.network "public_network", ip: "192.168.1.88", :netmask => "255.255.255.0"
config.vm.network "forwarded_port", guest:22, host:18022, id:"ssh"
config.vm.provision "shell", inline: <<-SHELL
# 8080ポート
firewall-cmd --permanent --add-port=8080/tcp
# 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
# javaをインストール
yum -y install java-1.8.0-openjdk
# Apache Nifiのダウンロード
wget http://ftp.riken.jp/net/apache/nifi/1.3.0/nifi-1.3.0-bin.tar.gz
tar xvfz nifi-1.3.0-bin.tar.gz
mv nifi-1.3.0 /opt
#サービスとして登録
cp /vagrant/nifi.service /etc/systemd/system
systemctl enable nifi.service
systemctl start nifi.service
echo 'access url -> http://192.168.55.88:8080/nifi/'
SHELL
end
nifi.service
[Unit]
Description=Apache Nifi
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/opt/nifi-1.3.0/bin/nifi.sh start
ExecStop=/opt/nifi-1.3.0/bin/nifi.sh stop
KillMode=none
[Install]
WantedBy=multi-user.target
○関連情報
・Apache NiFiに関する他の記事はこちらを参照してください。
0 件のコメント:
コメントを投稿