Elasticsearch安装与测试验证详解

1、Elasticsearch安装

# cd /usr/local

下载:

wgethttps://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/zip/elasticsearch/2.3.2/elasticsearch-2.3.2.zip

# unzip elasticsearch-2.3.2.zip

# mkdir -p /data/logs/elasticsearch

# mkdir -p /data/elasticsearch/{data,work,plugins,scripts}

# useradd elasticsearch -s /bin/bash


# chown -R elasticsearch:elasticsearch /data/logs/elasticsearch /data/elasticsearch


2、Elasticsearch配置

1)主配置(./config/elasticsearch.yml)

qc-hermes-es-1:

cluster.name: qc-hermes-search-cluster

node.name: qc-hermes-es-1     #同hostname cat /etc/hostname

path.data: /data/elasticsearch/data

path.logs: /data/logs/elasticsearch

path.plugins: /data/elasticsearch/plugins

path.scripts: /data/elasticsearch/scripts

bootstrap.mlockall: true

network.host: 192.168.0.10   #本机IP地址

http.port: 9200

discovery.zen.ping.unicast.hosts: ["qc-hermes-es-1:9200", "qc-hermes-es-2:9200"]

node.master: true

node.data: true

index.number_of_shards: 8

index.number_of_replicas: 1

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

2)服务启动

# cd /opt/elasticsearch

# su elasticsearch (注意:root账号会报错)

$ bin/elasticsearch -d

说明:2.x的版本需要以普通用户权限启动,否则会报错,无法正常启动。


3)验证启动成功:

Elasticsearch安装与测试验证详解

上一篇:教你50招提升ASP.NET性能(二十一):避免使用会话状态


下一篇:五.OC基础--1.多态,2.类对象,3.点语法,4.@property&@synthesize,5.动态类型,内省(判断对象是否遵循特定的协议,以及是否可以响应特定的消息)