ElasticSearch集群安装笔记

ElasticSearch集群安装文档


ElasticSearch安装配置

下载elasticsearch2.4.2

wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.4.2/elasticsearch-2.4.2.tar.gz

解压到指定目录

tar -zxvf elasticsearch-2.4.2.tar.gz /cluster/elasticSearch/

配置conf文件

vim /cluster/elasticSearch/elasticsearch-2.4.2/config/elasticsearch.yml 
cluster.name: elasticsearch
node.name: "node_01"
node.master: true
node.data: true
node.rack: rack_01
index.number_of_shards: 5
index.number_of_replicas: 3
network.bind_host: 0.0.0.0
network.publish_host: bi_server_01
network.host: bi_server_01
transport.tcp.port: 9300
transport.tcp.compress: true
http.port: 9200
http.max_content_length: 50mb
http.enabled: true
discovery.zen.minimum_master_nodes: 2
discovery.zen.ping.timeout: 120s
discovery.zen.ping.multicast.enabled: true
discovery.zen.ping.unicast.hosts: ["bi_server_01","bi_server_02","bi_server_03"]

分发elasticsearch-2.4.2到bi_server_02,bi_server_03 并修改conf文件的host配置、node.name

安装head

sudo elasticsearch-2.4.2/bin/plugin install mobz/elasticsearch-head

安装kopf(待测试)

sudo elasticsearch-2.4.2/bin/plugin install lmenezes/elasticsearch-kopf

安装ik分词

从github上获取analysis-ik项目
切换到对应版本
编译,将target/releases/下zip包 解压到elasticsearch-2.4.2/plugins/ik

启动集群

在集群的每台机器上执行

elasticsearch-2.4.2/bin/elasticsearch

查看elasticsearch状态

ps aux|grep elasticsearch

进入head页面查看集群状态

http://bi-server-01:9200/_plugin/head/

附maven 安装

wget http://mirrors.cnnic.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz

解压到/usr/local/apache-maven-3.3.9

配置环境变量,执行 vi /etc/profile 文件,插入如下内容

JAVA_HOME=/usr/java/jdk1.8.0_112
JRE_HOME=/usr/java/jdk1.8.0_112/jre
M2_HOME=/usr/local/apache-maven-3.3.9

PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$M2_HOME/bin

export JAVA_HOME JRE_HOME M2_HOME

保存并退出编辑器,执行 source /etc/profile 命令使改动生效

你可能感兴趣的:(大数据)