wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.1.rpm
wget https://artifacts.elastic.co/downloads/logstash/logstash-6.3.1.rpm
wget https://artifacts.elastic.co/downloads/kibana/kibana-6.3.1-x86_64.rpm
1. 安装ansible
yum install epel-release -y && yum install -y ansible
配置ansible服务器实现免密登录,配置之后,第一次需要在ansible服务器上ssh
5. 将redis的配置文件修改成如下配置
bind {{ ansible_default_ipv4.address }} #获取服务器的ipv4地址
7. 在jdk/roles新建site.yml文件
- name: java_env install
remote_user: root
hosts: test
roles:
- jdk
- zk
- redis
- mq
9. 安装data数据环境
es: 同样将有地址(es,kibana等)的修改为{{ ansible_default_ipv4.address }}
- name: copy es
copy: src=elasticsearch-6.3.1.rpm dest=/soft/
- name: install es
shell: rpm -ivh /soft/elasticsearch-6.3.1.rpm
- name: remove es config
shell: rm -f /etc/elasticsearch/elasticsearch.yml
- name: copy es config
template: src=elasticsearch.yml dest=/etc/elasticsearch/
- name: start es
service: name=elasticsearch enabled=yes state=started
jdk:和上面安装java环境一样
kibana:
- name: copy kibana
copy: src=kibana-6.3.1-x86_64.rpm dest=/soft/
- name: install kibana
shell: rpm -ivh /soft/kibana-6.3.1-x86_64.rpm
- name: remove es config
shell: rm -f /etc/kibana/kibana.yml
- name: copy kibana config
template: src=kibana.yml dest=/etc/kibana/
- name: start kibana
service: name=kibana enabled=yes state=started
logstash:
- name: copy logstash
copy: src=logstash-6.3.1.rpm dest=/soft/
- name: install logstash
shell: rpm -ivh /soft/logstash-6.3.1.rpm
- name: start es
service: name=logstash enabled=yes state=started
mysql:
- name: copy mysql
copy: src=mysql-community-release-el7-5.noarch.rpm dest=/soft
- name: install mysql.rpm
shell: rpm -ivh /soft/mysql-community-release-el7-5.noarch.rpm
- name: install mysql
shell: yum install -y mysql-community-server
- name: start mysql
service: name=mysql enabled=yes state=started
ansible-playbook -i /etc/ansible/hosts /etc/ansible/data/roles/site.yml
手机扫一扫
移动阅读更方便
你可能感兴趣的文章