搭建ELK集群
ELK集群的搭建
一、复制虚拟机
二、修改主机名和主机列表
1.网络地址
(1)输入:vi /etc/sysconfig/network-script/ifcfg-enp0s3 修改网络ip地址
2.主机名
(1)hostnamectl set-hostname bigdata03
(2)vi /etc/hostname 内容修改为bigdata03
(3)systemctl restart network
systemctl stop firewalld
systemctl disable firewalld
### 3.主机列表
(1)vi /etc/hosts 内容增加 主机的ip地址 主机名
三、配置免密登录
1. ssh-****** -t rsa -P “” 生成私钥
2.cat .ssh/id_rsa.pub >> .ssh/authorized_keys 复制私钥到公钥
3. ssh-copy-id -i .ssh/id_rsa.pub -p22 [email protected]
ssh-copy-id -i .ssh/id_rsa.pub -p22 [email protected]
有几台复制几台,自己不用 远程复制到另一台机器
4.ssh [email protected] ssh [email protected]
ssh [email protected] ssh [email protected]
Exit 退出,有几次退几次
远程登录验证,不需要输入密码即可
四、配置elasticsearch集群
1.输入: cd /opt/es622/ vi config/elasticsearch.yml
vi /opt/es622/config/elasticsearch.yml 修改节点名,ip地址,主机列表
2.切换用户:su es
3.删除data和log目录,运行
4.[[email protected] es622]$ rm -rf data/
5.[[email protected] es622]$ rm -rf logs/
6.[[email protected] es622]$ ./bin/elasticsearch
主机:[[email protected] ~]# cd /opt/eshead
[[email protected] eshead]$ npm run start