1. yum update 系统1. yum update 系统
2. 安装 java, yum install java
3. 安装elasticsearch (官网,rpm方式) yum install elasticsearch https://www.elastic.co/guide/en/elasticsearch/reference/5.6/rpm.html 设置启动服务 systemctl daemon-reload systemctl enable elasticsearch.service systemctl start elasticsearch.service
3.1 关闭swap: swapoff -a
3.2 修改/etc/fstab 注释掉这一行 /dev/mapper/centos-swap swap
3.3 修改 /etc/elasticsearch/elasticsearch.yml 中的 cluster.name: F5ELK-cluster , node.name: ELKnode1,network.host: 0.0.0.0
4. 安装kibana (官网,rpm) vi /etc/kibana/kibana.yml port 5601 修改server.host监听地址为0.0.0.0 systemctl daemon-reload systemctl enable kibana.service systemctl start kibana.service
5. 关闭centos7 firewall systemctl stop firewalld.service #停止firewallsystemctl disable firewalld.service #禁止firewall开机启动
6.安装elasticsearch-head 辅助工具https://github.com/mobz/elasticsearch-head#running-with-built-in-server 5.0版本后的elasticsearch不支持plugin方式,只支持独立服务器安装yum install gityum install npm
6.1 可能需要执行,如果没有自动下载安装的话 npm install phantomjs-prebuilt@2.1.15 --ignore-script
6.2 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression
出现以上错误使用 npm install --no-optional
如果还出现 npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression 错误 则修改目录下的package.json 将Apache改为Apache-2.0 。详细 见http://blog.csdn.net/qq_36357820/article/details/77539843 (但没有安装node,grunt)这些东西
6.3 访问http://192.168.214.130:9100/ 访问 elasticsearch-head, 出现界面中填入 http://192.168.214.130:9200/ 并点击connect,如果后侧出现无法连接提示,则
6.3.1 修改/etc/elasticsearch/elasticsearch.yml 最后增加
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type
6.3.2 修改/root/elasticsearch-head/Gruntfile.js : 增加 hostname
1 2 3 4 5 6 7 8 9 10 |
connect: { server: { options: { port: 9100, hostname: '*', base: '.', keepalive: true } } } |
7. 安装logstash, yum install logstash, logstash没有以服务启动. 测试验证 ./logstash -e 'input {stdin{}} output{stdout{}}'
8. 第二台节点安装。方法同一,elasticsearch.yml里配置不同的节点名,并配置 discovery.zen.ping.unicast.hosts: ["192.168.214.130", "192.168.214.131"] 否则elasticsearch-head里会显示集群状态黄色9. head因为是以独立服务器安装,第二台节点无需安装
文章评论
步骤6.2那里,npm install –no-optional命令,no前面应该是两个横线,正确的命令为npm install --no-optional;
步骤6.3.1那里,http.cors.allow-origin: “*”为英文的双引号(复制粘贴的时候注意),和冒号之间还有一个空格。
@大东 谢谢,我看了下,我的原始文档是正常的,看上去是MD文件被编辑器自动转换了。感谢提示,这样别人可以注意到。
手动点赞,博主辛苦了