ES安装文档

一 安装ES
1.下载ES,header(ES集群图形管理),Node(npm安装header)

2.解压ES
unzip  elasticsearch-5.6.4.zip

3.配置ES 的.yml文件,对应用户下的.profile文件进行全局执行命令

(1) vim elasticsearch.yml

cluster.name: my-es
#
# ------------------------------------ Node ------------------------------------

# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /usr/cdh/elasticsearch/data
#
# Path to log files:
#
path.logs: /usr/cdh/elasticsearch/logs


#绑定服务到指定的主机
network.host: 0.0.0.0
node.master: true
node.data: true


#节点进行单播的方式发现新节点主机地址
discovery.zen.ping.unicast.hosts: ["hadoop:9300"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes: 3
#集群最小master节点数,防止脑裂,半数以上存活才能保证
discovery.zen.minimum_master_nodes: 1


(2)配置全局环境变量:
vim ~/.profile

export ES_HOME=/usr/cdh/elasticsearch/
export PATH=$PATH:$KAFKA_HOME/bin:$SCALA_HOME/bin:$JAVA_HOME/bin:$HBASE_HOME/bin:$ES_HOME/bin

生效配置  .  ~/.profile


4.启动后发现如下错误:虚拟内存设置过小
 elasticsearch

ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决:增大虚拟内存 
sudo /etc/sysctl.conf
vm.max_map_count=655360

生效配置 sudo sysctl -p

启动后正常 elasticsearch


二.安装ES对应的插件


1.下载解压需要的node 编译器,head软件到指定目录,配置环境变量

xz  -d node-v6.9.1-linux-x64.tar.xz
tar  xvf node-v6.9.1-linux-x64.tar 
ll
mkdir node
tar  xvf node-v6.9.1-linux-x64.tar  -C node


vim ~/.profile
export NODE_HOME=/usr/cdh/node

export PATH=$PATH:$MYSQL_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$ZOOKEEPER_HOME/bin:$HIVE_HOME/bin:$SPARK_HOME/bin:$HBASE_HOME/bin


export PATH=$PATH:$KAFKA_HOME/bin:$SCALA_HOME/bin:$JAVA_HOME/bin:$HBASE_HOME/bin:$ES_HOME/bin:$NODE_HOME/bin

. ~/.profile


node -v
2.npm 安装head

(1)解压文件:

unzip  elasticsearch-head-master.zip 
mv  elasticsearch-head-master esheadmaster 

(2) 设置npm 镜像
npm config set registry https://registry.npm.taobao.org


(3) 进入esheadmaster 目录进行安装:
npm install 
npm install -g grunt


3.安装后配置Gruntfile.js,增加连接主机
vim  Gruntfile.js

 connect: {
                        server: {
                                options: {
                                        port: 9100,
                                        hostname: '0.0.0.0'
                                        base: '.',
                                        keepalive: true
                                }
                        }
                }


4.elasticsearch.yml 添加属性
vim  elasticsearch.yml

http.cors.enabled: true
http.cors.allow-orgin: "*"


5.后台启动 head 服务:
grunt server &

6.启动ES,登陆 http://hadoop:9100页面
安装成功

猜你喜欢

转载自blog.csdn.net/dymkkj/article/details/81278489