yum -y install epel-release git curl sshpass vim wget
yum install ansible # version >= 2.6
2. 下载并解压 elk-ansible 程序包
cd /opt
wget https://github.com/chinaboy007/elk-ansible/archive/master.zip
tar -zxvf master.tar.gz
四、目标服务器安装配置
1. 登录中控服务器,创建ssh密钥对
ssh-keygen -t rsa
#
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
4e:f8:b6:c4:1f:c3:1d:2a:b1:10:ba:65:39:74:2f:08 root@localhost
The key's randomart image is:+--[ RSA 2048]----+| || || E o . || + * . || . O S . . || + B = o . || . O = . || o + o || . . |+-----------------+
2. 在中控服务器上,将所有目标服务器 ip 地址添加到 elk-ansible 程序的 hosts 文件中并执行初始化命令
修改文件 elk-ansible/hosts
将所有目标服务器 ip 地址添加到 [all_nodes] 下面
[all_nodes]
192.168.10.72
192.168.10.73
执行以下命令进行初始化
cd elk-ansible
ansible-playbook -k playbooks/init_node.yml