ELK搭建

1.機(jī)器初始化

相關(guān)安裝包

  1. elasticsearch-5.4.0.tar.gz

  2. logstash-5.4.0.tar.gz

安裝ansible,配置hosts

配置阿里云yum源


# curl -s -L http://mirrors.aliyun.com/repo/Centos-7.repo -o /etc/yum.repos.d/CentOS-Base.repo && curl -s -L http://mirrors.aliyun.com/repo/epel-7.repo -o /etc/yum.repos.d/epel.repo

修改anxible hosts文件


#cat /etc/ansible/hosts

[elk]

zf-inf-elk-01.vm ansible_ssh_host=10.10.10.30 ansible_ssh_user="root" ansible_ssh_port=22 ansible_ssh_pass="newmedia"

zf-inf-elk-02.vm ansible_ssh_host=10.10.10.31 ansible_ssh_user="root" ansible_ssh_port=22 ansible_ssh_pass="newmedia"

zf-inf-elk-03.vm ansible_ssh_host=10.10.10.32 ansible_ssh_user="root" ansible_ssh_port=22 ansible_ssh_pass="newmedia"

[cdh]

zf-inf-cdh-01.vm ansible_ssh_host=10.10.10.33 ansible_ssh_user="root" ansible_ssh_port=22 ansible_ssh_pass="newmedia"

zf-inf-cdh-02.vm ansible_ssh_host=10.10.10.34 ansible_ssh_user="root" ansible_ssh_port=22 ansible_ssh_pass="newmedia"

zf-inf-cdh-03.vm ansible_ssh_host=10.10.10.35 ansible_ssh_user="root" ansible_ssh_port=22 ansible_ssh_pass="newmedia"

配置hosts,修改hostname


[root@zf-inf-elk-01 ~]# cat /etc/hosts

127.0.0.1 localhost

10.10.10.30 zf-inf-elk-01.vm

10.10.10.31 zf-inf-elk-02.vm

10.10.10.32 zf-inf-elk-03.vm

10.10.11.33 zf-inf-cdh-01.vm

10.10.11.34 zf-inf-cdh-02.vm

10.10.11.35 zf-inf-cdh-03.vm

同步host文件


ansible all -m copy -a 'src=/etc/hosts dest=/etc/hosts'

建立信任關(guān)系


[root@zf-inf-elk-01 ~]# ssh-keygen              #一路回車

[root@zf-inf-elk-01 ~]# ansible all -m copy -a 'src=/root/.ssh/id_rsa.pub dest=/root/.ssh/authorized_keys'

JDK 安裝


[root@zf-inf-elk-01 opt]# ansible all -m copy -a 'src=/opt/jdk-7u80-linux-x64.tar.gz  dest=/opt/'

修改/etc/profile


export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_31

export JRE_HOME=${JAVA_HOME}/jre

export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib

export  PATH=${JAVA_HOME}/bin:$PATH

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容