大数据之五:ELK安装

大数据开发卷五

​ ---Elasticsearch 分布式安装步骤

考虑需要安装elasticsearch-head作为web展示 所以首先安装nodejs 主要是利用npm

  1. wget https://npm.taobao.org/mirrors/node/v11.0.0/node-v11.0.0.tar.gz

  2. tar –zxvf node-v11.0.0.tar.gz

  3. cd node-v11.0.0

  4. yum install gcc gcc-c++

  5. ./configure

  6. Make

  7. Make install

  8. Node –v

开始安装elasticsearch

1. 安装3台虚拟机

2. 安装jdk

  1. 解压 tar –zxvf elasticsearch6.2.2

  2. 切换用户 su cm(elasticsearch 不能在root用户下启动)

  3. 启动后宿主机不能访问处理方案(启动命令:在bin目录下 sh elasticsearch)

a) 修改config/elasticsearch.yml

cluster.name: es-app #集群名称,可以自行修改

node.name: es-1 #节点名称,自行修改

network.host: 192.168.235.133 #主机地址,这里写本机IP

http.port: 9200 #端口

http.cors.enabled: true #设置跨域

http.cors.allow-origin: "*" #设置访问

b) 再启动查看不能启动原因

[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

​ i. 问题 1 系统最大文件数太低

修改 vi /etc/security/limits.conf 文件末尾追加

cm soft nofile 65536

cm hard nofile 131072

cm soft nproc 4096

cm hard nproc 4096

​ ii. 问题 2 虚拟内存太低

修改vi /etc/sysctl.conf文件末尾追加

​ vm.max_map_count=655360

切换到root权限

​ sysctl -p

​ iii. java.nio.file.AccessDeniedException: …/elasticsearch-6.2.2/config/jvm.options

chown 用户名 elasticsearch-6.2.2安装目录路径 -R

  1. 可以先安装elasticsearch-head监控elasticsearch集群环境

a) tar –zxvf elasticsearch-head-master

b) npm install

c) npm run start

  1. 配置从节点服务器

cluster.name: es-app #集群名称,可以自行修改

node.name: es-2 #节点名称,自行修改

network.host: 192.168.235.132 #主机地址,这里写本机IP

http.port: 9200 #端口

discovery.zen.ping.unicast.hosts: ["192.168.235.133"]#设置集群的指挥

  1. 同理配置第3节点

开始安装LogStash

nodejs文件是c编写的,需要先yum install gcc gcc-c++

然后直接make进行编译nodejs文件

1566289808766

1566290458125

1566293020820

猜你喜欢

转载自blog.51cto.com/14522074/2434374