Ansible install storm
# A small partner directly asked me how this began, the environment does, I want to say, what's brother, installation ansible, and initialize the environment do not I give you write it, the user directly with the root, in order to facilitate (but production not so engaged wailing), free secret trust, and selinux off the firewall so on their own just mess things up just fine
Do not forget to start before the start zk Note:
mkdir -p /root/ansible/roles/storm/files
cd /root/ansible/roles/storm/files
# The Storm downloaded packages and configuration files uploaded to this / etc / ansible / roles / storm / files
# Profiles
storm.zookeeper.servers:
- "server01"
- "server02"
- "server03"
storm.zookeeper.port: 2181
nimbus.seeds: ["server01","server02"]
supervisor.slots.ports:
- 6700
- 6701
ui.port: 10080
vim hosts
[storm_servers]
server01
server02
server03
vim storm.yml
- hosts: storm_servers
roles:
- storm
mkdir tasks
vim main.yml
---
- name: copy file and unzip
unarchive: src=storm.tar.gz dest=/root
- name: install config storm
copy: src=storm.yaml dest=/root/apache-storm-1.2.2/conf/storm.yaml
cd ..
mkdir whose
vim main.yml
nimbus_hostname: server01
ansible-playbook -i hosts storm.yml
# Browser to access localhost: 10080, View Management page
# So-called high-availability HA configuration is more than just one or a few Nimbus ,, with a few to see their mood, supervisor originally distributed so it does not matter
# On the following configuration in the configuration file:
storm.zookeeper.servers:
- "server01"
- "server02"
- "server03"
storm.zookeeper.port: 2181
nimbus.seeds: ["server01","server02"]
supervisor.slots.ports:
- 6700
- 6701
ui.port: 10080
---------------------------------------------------------------------------------------------------------------
# After completing the installation start and stop editing the script!
vim storm-start.sh
#!/bin/bash
echo "Storm Nimbus is Running"
nohup /root/apache-storm-1.2.2/bin/storm nimbus 1>/dev/null 2>&1 &
sleep 15
echo "Storm Nimbus is Successfully"
for host in server01 server02 server03
do
echo "$host Storm Supervisor is Running"
ssh $host "source /etc/profile;nohup sh /root/apache-storm-1.2.2/bin/storm supervisor 1>/dev/null 2>&1 & "
sleep 10
echo "$host Storm Supervisor is Successfully"
echo "$host Storm Logviewer is Running"
ssh $host "source /etc/profile;nohup sh /root/apache-storm-1.2.2/bin/storm logviewer 1>/dev/null 2>&1 & "
sleep 10
echo "$host Storm Logviewer is Successfully"
done
echo "Storm UI is Running"
nohup /root/apache-storm-1.2.2/bin/storm ui 1>/dev/null 2>&1 &
sleep 15
echo "Storm UI is Successfully"
vim storm-stop.sh
jps | grep nimbus | cut -c 1-5 | xargs kill -s 9
echo "server01 Storm Nimbus is Stopping"
jps | grep core | cut -c 1-5 | xargs kill -s 9
echo "server01 Storm UI is Stopping"
for host in server01 server02 server03
do
ssh $host "source /etc/profile;jps | grep Supervisor | cut -c 1-5 | xargs kill -s 9"
echo "$host Storm Supervisor is Stopping"
ssh $host "source /etc/profile;jps | grep logviewer | cut -c 1-5 | xargs kill -s 9"
echo "$host Storm Logviewer is Stopping"
done
No pro-test pit! Under Renewing hadoop