elasticsearch2.3.3搭建及插件安装

来源:互联网 发布:sql语句创建视图 编辑:程序博客网 时间:2024/05/30 05:00

小弟大学刚毕业,进公司后需要使用elasticsearch做全文检索,所以我手动搭建了elasticsearch集群(测试)并安装了相关插件支持我开发使用。

当然我也是参考了网上很多大神的博客~~~~~~

下面介绍一下我的elasticsearch的安装情况

elasticsearch-2.3.3集群及插件安装

环境

虚拟机VMware vSphere 6.5

机器

192.168.16.131

192.168.16.132

192.168.16.131

配置

磁盘20G

内存2g

Cpu1核


安装包

elasticsearch-2.3.3.tar.gz

kibana-4.5.2-linux-x64.tar.gz

elasticsearch-analysis-ik-1.9.3.zip

elasticsearch-jdbc-2.3.3.0-dist.zip

marvel-2.3.3.tar.gz


安装elasticsearch

1. 下载elasticsearch-2.3.3.tar.gz

2. 上传elasticsearch-2.3.3.tar.gz

3. 解压tar zxvf elasticsearch-2.3.3.tar.gz

4. 移动解压目录,修改属组属主

mv elasticsearch-2.3.3 /home/el ;chown -R el:el /home/el/elasticsearch-2.3.3

5. 安装Head

mkdir/home/el/elasticsearch-2.3.3/plugins/head

mkdir/home/el/elasticsearch-2.3.3/plugins/kopf

下载的zip解压,然后将解压后的文件夹内所有的文件copy到上面创建的目录

6. 修改ES配置文件

1. elasticsearch

在启动文件中加入如下配置配置Open文件数和内存bin/elasticsearch)(本次没有设置)

ES_HEAP_SIZE=4g

MAX_OPEN_FILES=65535

2. elasticsearch.yml

进入config下修改elasticsearch.yml

# Use a descriptive name for your cluster:

cluster.name:my-application

# ------------------------------------ Node------------------------------------

# Use a descriptive name for the node:

node.name: node-3

# Add custom attributes to the node:

# node.rack: r1

# ----------------------------------- Paths------------------------------------

# Path to directory where to store the data(separate multiple locations by comma):

path.data: /home/el/data

# Path to log files:

path.logs: /home/el/logs

# ----------------------------------Network -----------------------------------

# Set the bind address to a specific IP(IPv4 or IPv6):

network.host:192.168.16.131

# Set a custom port for HTTP:

http.port: 9200

# For more information, see thedocumentation at:

#<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>

# ---------------------------------Discovery ----------------------------------

# Pass an initial list of hosts to performdiscovery when new node is started:

# The default list of hosts is["127.0.0.1", "[::1]"]

discovery.zen.ping.unicast.hosts:["es1", "es2","es3"]

# Prevent the "split brain" byconfiguring the majority of nodes (total number of nodes / 2 + 1):

discovery.zen.minimum_master_nodes:2

# For more information, see thedocumentation at:

# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html>

7. 安装ik

1.       在目录./elasticsearch-2.3.3/plugins下创建目录ik

2.       下载和上传elasticsearch-analysis-ik-1.9.3.zip

3.       将elasticsearch-analysis-ik-1.9.3.zip解压到ik目录

4.       cd 到./elasticsearch-2.3.3/plugins/ik目录

  unzip elasticsearch-analysis-ik-1.9.3.zip

8. 192.168.16.132和192.168.16.133同上(改一下参数配置)

9. elasticsearch开启和关闭

开启elasticsearch

./elasticsearch-2.3.3/bin/elasticsearch

关闭elasticsearch

ps -ef | grep elasticsearch

Kill -9 *****

安装Kibana

1. 下载kibana-4.5.2-linux-x64.tar.gz

2. 上传kibana-4.5.2-linux-x64.tar.gz

3. 解压tar zxvfkibana-4.5.2-linux-x64.tar.gz

4. 移动解压目录,修改属组属主

mv kibana-4.5.2-linux-x64 /home/el ;chown -R el:el /home/el/kibana-4.5.2-linux-x64

5. 安装Marvel

首先先要安装在elasticsearch上安装license和mavel-agent

elasticsearch-2.3.3/bin/plugin install license

elasticsearch-2.3.3/bin/plugin install marvel-agent

使用Kibana安装最新版本的marvel:

./kibana-4.5.2-linux-x64/bin/kibana plugin—install elasticsearch/marvel/latest

mavel不是免费插件,需要注册使用,官网注册能够使用一年

删除

kibana-4.5.2-linux-x64/installedPlugins/marvel下的所有文件

6.安装sense

1.下载sense安装包。

2. 上传sense-2.0.0-beta7-tar.gz

3. 在kibana/bin目录下执行命令安装sense

./kibanainstall –i sense –ufile:下载sense的文件目录

6.修改配置文件

kibana.yml

./kibana-4.5.2-linux-x64/config/kibana.yml

server.port: 5601

elasticsearch.url:"http://192.168.16.131:9200"(其他配置可自配置)

7. 192.168.16.132和192.168.16.133同上(改一下参数配置)

8. Kibana的启动和关闭

开启Kibana

./kibana-4.5.2-linux-x64/bin/kibana

关闭Kibana

fuser -n tcp 5601

Kill -9 *****

安装安装elasticsearch-jdbc

(同步mysql数据库)

1. 下载elasticsearch-jdbc-2.3.3.0-dist.zip

2. 上传elasticsearch-jdbc-2.3.3.0-dist.zip

3. 解压tar zxvfelasticsearch-jdbc-2.3.3.0-dist.zip

4. 移动解压目录,修改属组属主

mv elasticsearch-jdbc-2.3.3.0 /home/el ;chown -R el:el/home/el/elasticsearch-jdbc-2.3.3.0




有不对的地方希望各位大神批评指正,小弟谢过大家!!!



0 0
原创粉丝点击