ELK的安装配置
ES安装前的准备(elk安装包版本要求一致)
elasticsearch-6.2.2.tar.gz
elasticsearch-head-master.zip
kibana-6.2.2-linux-x86_64.tar.gz
logstash-6.2.2.tar.gz
node-v8.9.1-linux-x64.tar.gz
jdk-8u221-linux-x64.tar.gz
ELK的安装
Mkdir /software
cd /software
yum install -y unzip
tar -zxvf elasticsearch-6.2.2.jar -C /opt //解压
转到第二一个窗口
cd /opt/
ll
mv elasticsearch-6.2.2/ es622 //改名
返回第一个窗口
Tar -zxvf jdk-8u221-linux-x64.tar.gz -C /opt/
转到第二一个窗口
[root @promote ~]# useradd es
返回第一个
转到第二一个窗口
ES的配置
1.配置es的参数
(1)输入:vi /opt/es622/config/elasticsearch.yml,按shift+g,快速定位到尾行,按o在下一行插入以下内容:注意:前后有空格
cluster.name : test --集群名
node.name : test-master --节点名
node.master : true --是否是主节点
network.host : 192.168.56.111 --本机地址
discovery.zen.ping.unicast.hosts : ["192.168.56.111"] --同上
http.cors.enabled : true
http.cors.allow-origin : "*"
2.配置系统参数
(1)输入:vi /etc/sysctl.conf
(2)最后一行插入插入内容:vm.max_map_count=655360
(3)返回,最好首次也要使用以下命令刷新 sysctl -w vm.max_map_count=655360
(3)输入:vi /etc/security/limits.conf 插入内容:
* soft nofile 65536
* hard nofile 65536
* soft nproc 4096
* hard nproc 4096
3.修改es622目录的属组(es不能使用root启动,前面改过就算了) chown -R es:es es 622
5.在/opt目录(cd /opt)下输入:./es622/bin/elasticsearch
6.Jdk环境配置(报错的话)
./es622/bin/elasticsearch
在windows界面打开网页,输入http://192.168.56.111:9200/,可以正常出页面,切有节点的信息,即是启动成功
Head-master及node的配置
1.输入:npm install -g grunt-cli --等待的时间比较长,要有点耐心
2.输入:npm install 出错时需要输入:
npm install phantomjs-prebuilt@2.1.14 --ignore-scripts
3.输入:vi Gruntfile.js,在以下位置高亮位置增加一行代码:hostname: ‘*’,
4.输入:npm run start 启动head-master
5.在windows界面,打开网页,输入:http://192.168.56.111:9100/
注:_site/app.js保存关闭之后,要保证之前的elasticsearch为启动状态
kibana安装,配置
1.输入:cd /opt/kibana622
- 输入:vi config/kibana.yml
按shift+g跳转到行末,按o增加以下内容:
server.host: "192.168.56.110"
elasticsearch.url: "http://192.168.56.110:9200"
输入:./bin/kibana 运行kibana
在windows界面打开网页,输入http://192.168.56.111:5601/
易错点
1.本来用SSH连接正在操作,突然连接不好Linux,无法登陆,出现Network error :Connection timed out错误,说明防火墙开启了,先关闭防火墙,重新连接。
2.Systemctl restart network//重启
3.Systemctl stop firewalld//关闭防火墙
4.source命令也称为“点命令”,也就是一个点符号(.)。source命令通常用于重新执行刚修改的初始化文件,使之立即生效,而不必注销并重新登录。
https://www.cnblogs.com/xupeizhi/archive/2013/02/20/2917931.html
报错:npm install WARN package.json not exists: /package.json
出现这样的原因一般是没有切换到指定的目录下,用cd命令切换到指定的目录下即可
还有其他的一些报错基本上都是在jdk环境变量或conf的书写有误,注意大小写及空格。