elk-head插件
环境还是centos7.2 ,前面博客里面已经有了安装方法这里就不过多介绍了.依然还是单台部署.
1.es配置文件介绍
vim /elasticsearch-6.5.4/config/elasticsearch.yml #路径
cluster.name: my-application # 集群名称,如果多台必须相同
node.name: node-1 #节点名称,名字唯一
path.data: /path/to/data #存放数据位置
path.logs: /path/to/logs #日志位置
discovery.zen.ping.unicast.hosts: ["host1", "host2"] #集群监听地址
单台仅修改下面配置即可
network.host: 0.0.0.0 # 访问地址
http.cors.enabled: true #开启允许head连接
http.cors.allow-origin: "*" #连接地址范围**
2.修改es最大线程
vi /etc/security/limits.conf #路径
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
3.修改最大支持
vi /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
sysctl -p
重启es并退出用户生效
4.安装head
head需要插件支持,先进行安装插件最近安装head,安装nodejs环境,其中nodejis包含了npm,所以就不进行安装了.
wget https://npm.taobao.org/mirrors/node/latest-v4.x/node-v4.4.7-linux-x64.tar.gz
tar -zxvf node-v4.4.7-linux-x64.tar.gz
vim /etc/profile
source /etc/profile
export PATH=$PATH:/node-v4.4.7-linux-x64/bin
source /etc/profile
node --version #测试
安装grunt
npm install -g grunt-cli
npm install grunt --save-dev
grunt -version
安装head
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm install grunt --save
修改read配置文件
vim elasticsearch-head/Gruntfile.js
5.启动访问
grunt server 启动
访问地址:localhost:9100
6.es优化
vim /elasticsearch-6.5.4/config/jvm.options
-Xms1g 内存占用最小值
-Xmx1g 内存占用最大值
提示,两个需要改成相同,官网建议是设置物理内存的一般
在这里就算是结束了,本次目标编写了