ES安装

本文详细介绍Elasticsearch 7.2.1和6.3.2版本的下载、安装步骤,包括用户权限设置、环境变量配置、系统限制调整及插件安装。同时,提供了elasticsearch-head插件的配置与使用方法,实现对Elasticsearch集群的可视化管理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 # wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.1-linux-x86_64.tar.gz

 # curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.2.tar.gz

 # tar -xzf elasticsearch-7.2.1-linux-x86_64.tar.gz
 # adduser rainbow_es
 # passwd rainbow_es
 # chown -R rainbow_es ./elasticsearch-7.2.1   版本7需要java11;版本6需要java8
 # su rainbow_es

 # mv elasticsearch-7.2.1-linux-x86_64.tar.gz  ./soft/

 $  ./bin/elasticsearch -d   后台启动

# vim /usr/local/elasticsearch-6.3.2/config/elasticsearch.yml

1

2

3

4

http.cors.enabled : true

http.cors.allow-origin : "*"

#http.cors.allow-methods : OPTIONS, HEAD,GET, POST, PUT, DELETE

#http.cors.allow-headers:X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization

# vim /etc/security/limits.conf

1

2

3

4

5

6

7

8

root soft nofile 65535

root hard nofile 65535

* soft nofile 65536

* hard nofile 65536

 

# allow user 'rainbow_es' mlockall

rainbow_es  soft memlock unlimited

rainbow_es  hard memlock unlimited

     vim /etc/sysctl.conf 
    sysctl -a|grep vm.max_map_count
    sysctl -w vm.max_map_count=262144

插件

# wget https://npm.taobao.org/mirrors/node/latest-v10.x/node-v10.1.0-linux-x64.tar.gz

# tar -zxvf node-v10.1.0-linux-x64.tar.gz

#  sudo ln -s /u2s/master/elasticsearch-6.3.0/head-plugin/node-v8.11.4-linux-x64/bin/node /usr/local/bin/node    效果等于下面文件配置

# vim /etc/profile

 

1

2

3

4

5

6

export NODE_HOME=/usr/local/elasticsearch-6.3.2/node-v10.1.0-linux-x64

export JRE_HOME=/usr/local/java/jdk1.8.0_211/jre

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export PATH=$PATH:$JAVA_HOME/bin:$NODE_HOME/bin:$PATH

 

export NODE_PATH=$NODE_HOME/lib/node_modules

  # source /etc/profile

  # node -v

  # npm install -g grunt

  # npm install -g grunt-cli

  # sudo ln -s /usr/local/elasticsearch-6.3.2/node-v10.1.0-linux-x64/bin/grunt /usr/local/bin/grunt

  # wget https://github.com/mobz/elasticsearch-head/archive/master.zip

  # cd elasticsearch-head-master/

  # npm install

  # npm install phantomjs-prebuilt@2.1.16 --ignore-scripts

  # vim Gruntfile.js

1

2

3

4

5

6

7

8

9

10

connect: {

           server: {

                    options: {

                               hostname:'0.0.0.0',

                               port: 9100,

                               base: '.',

                               keepalive: true

                              }

                 }

          }

打开elasticsearch-head-master根目录,使用grunt server进行访问:

nohup grunt server 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

rainbowcheng

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

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

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

打赏作者

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

抵扣说明:

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

余额充值