仮想マシン構築後、ブラウザからhttp://192.168.1.118:8080/nifi/にアクセスします。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/centos-7.4"
config.vm.hostname = "co74nifi"
config.vm.provider :virtualbox do |vbox|
vbox.name = "co74nifi"
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.118", :netmask => "255.255.255.0"
# bridge netwrok
config.vm.network "public_network", ip: "192.168.1.118", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
# 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.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.118:8080/nifi/'
SHELL
end
〇Apache NiFiの画面
0 件のコメント:
コメントを投稿