elasticsearch5.0 安装流程

#elasticsearch安装流程
# by coco
# 2016-11-09

1. 下载:官网地址:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.tar.gz

1.去官网下载jdk:
tar -xvf elasticsearch-5.0.0.tar.gz 
 cd elasticsearch-5.0.0


确保系统已经安装好jdk1.8.0_73以上,操作系统centos6以上。


一、elasticsearch安装配置

1.官网下载源码包

https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.tar.gz

2.解压安装

1
2
3
4
5
6
useradd  elasticsearch
tar  xf elasticsearch-5.0.0. tar .gz -C  /usr/local
cd  /usr/local
ln  -sv elasticsearch-5.0.0 elasticsearch
mkdir  -pv  /data/elasticsearch/ {data,logs}
chown   -R elasticsearch.elasticsearch  /data/elasticsearch

mkdir -p /usr/local/elasticsearch/plugins
mkdir -p /usr/local/elasticsearch/config/scripts

注意:在安装过程中,不建这2个文件夹,启动时会报错,找不到这两个路径。

3.修改配置文件

1
2
3
4
5
6
cat  /usr/local/elasticsearch/config/elasticsearch .yml
# 换个集群的名字,免得跟别人的集群混在一起
cluster.name: wlt-es5.0-application   
# 换个节点名字
node.name: node-1
     
path.data:  /data/elasticsearch/data
path.logs:  /data/elasticsearch/logs

# 修改一下ES的监听地址,这样别的机器也可以访问
network.host: 0.0.0.0
# 默认的就好
http.port: 9200
# 增加新的参数,这样head插件可以访问es
#http.cors.enabled:  true
#http.cors.allow-origin:  “*"

 注意,设置参数的时候:后面要有空格!

4.修改系统参数

1
2
3
4
5
6
7
8
cat  /etc/security/limits .conf
*               soft    nproc           65536
*               hard    nproc           65536
*               soft    nofile          65536
*               hard    nofile          65536
cat  /etc/sysctl .conf
vm.max_map_count= 262144
sysctl -p

5.启动服务

su - elasticsearch -c "/usr/local/elasticsearch/bin/elasticsearch &”

su - elasticsearch -c "/usr/local/elasticsearch/bin/elasticsearch >/dev/null 2>&1 &”


浏览器访问:http://192.168.8.98:9200/

head插件的安装

5.0版本中不支持直接安装head插件,需要启动一个服务

1.下载插件安装

yum -y install git


git clone git://github.com/mobz/elasticsearch-head.git

cd elasticsearch-head

npm install

wKioL1gT-PmyYX_oAAGnWejH-8M469.jpg

elasticsearch-head目录下node_modules/grunt下如果没有grunt二进制程序,需要执行

cd elasticsearch-head

npm install grunt --save

2.修改配置

修改head源码

由于head的代码还是2.6版本的,直接执行有很多限制,比如无法跨机器访问。因此需要用户修改两个地方:

目录:head/Gruntfile.js:

connect: {
    server: {
        options: {
            port: 9100,
            hostname: '*',
            base: '.',
            keepalive: true
        }
    }
}
增加hostname属性,设置为*
修改连接地址:

目录:head/_site/app.js

修改head的连接地址:

this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://localhost:9200";

把localhost修改成你es的服务器地址,如:

this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.8.98:9200";

7C1DFDFE-D283-4924-B3F1-92A3EF6BCCF9.png

3.启动服务

/usr/local/elasticsearch-head/node_modules/grunt/bin/gruntserver

94AECB1B-048A-44CE-88D2-0FD598D850E6.png

浏览器访问:http://192.168.8.98:9100

2B168B8D-7E0B-40A2-86B3-0783FEE5F0D0.png

 




错误一:
ERROR: bootstrap checks failed
max file descriptors [65535] for elasticsearch process likely too low, increase to at least [65536]
解决办法:
cat /proc/sys/fs/file-max ? If it's too low, execute  sysctl -w fs.file-max=65536























评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wulantian

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值