ElasticSearch安装部署,基本配置(Ubuntu14.04)

ElasticSearch部署文档(Ubuntu 14.04)


安装java

sudo add-apt-repository ppa:webupd8team/java

sudo apt-get update

sudo apt-get install oracle-java8-installer

sudo apt-get install oracle-java8-set-default

安装ElasticSearch

wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

echo "deb http://packages.elastic.co/elasticsearch/1.6/debian stable main" | sudo tee -a /etc/apt/sources.list

sudo apt-get update

sudo apt-get install elasticsearch

sudo update-rc.d elasticsearch defaults 95 10

ElasticSearch各个目录说明

type

description

location

home

Home of elasticsearch installation

/usr/share/elasticsearch

bin

Binary scripts including elasticsearch to start a node

/usr/share/elasticsearch/bin

conf

Configuration files elasticsearch.yml and logging.yml

/etc/elasticsearch

conf

Environment variables including heap size,file descriptors

/etc/default/elasticsearch

data

The location of the data files

/var/lib/elasticsearch/

logs

Log files location

/var/log/elasticsearch

plugins

Plugin files location

/usr/share/elasticsearch/plugins

配置

ES_HEAP_SIZE

# 在/etc/default/elasticsearch中修改:

ES_HEAP_SIZE=4g    #不要超过32g,如果整台机器只部署ES,一半内存用于Java heap,另一半给Lucene

File Descriptors

cat <<EOF>> /etc/security/limits.conf

elasticsearch - nofile 65535

EOF

 

# 在/etc/default/elasticsearch中修改:

MAX_OPEN_FILES=65535

Virtual memory

cat <<EOF>> /etc/sysctl.conf

vm.max_map_count=262144

EOF

 

sysctl -p

Memory Settings

# 在/etc/elasticsearch/elasticsearch.yml中修改:

bootstrap.mlockall: true

# 在/etc/default/elasticsearch中修改:

MAX_LOCKED_MEMORY=unlimited

其他

在/etc/elasticsearch/elasticsearch.yml中修改:

 

# 集群名称,同一集群,名称要设置相同

cluster.name: elasticsearch_production

# 节点名称

node.name: elasticsearch_001_data

 

# 数据路径,可配置多个,英文逗号分开,注意目录的权限,保证elasticsearch用户可写

path.data: /path/to/data1,/path/to/data2

# 日志路径,注意目录的权限,保证elasticsearch用户可写

path.logs: /path/to/logs

# 插件路径

path.plugins: /path/to/plugins

 

# 该属性是为了形成一个集群,有主节点资格并互相连接的节点的最小数目

# (number of master-eligible nodes / 2) + 1。 下面的值是在3个有主节点资格的情况下设定

# 因为节点数,以后可以增加,或者减少,故该配置可以动态修改

discovery.zen.minimum_master_nodes: 2

 

# 恢复控制

gateway.recover_after_nodes: 2

gateway.expected_nodes: 3

gateway.recover_after_time: 5m

 

#关闭多播,用单播。并指定至少一个能接受单播的主机

discovery.zen.ping.multicast.enabled: false

discovery.zen.ping.unicast.hosts: ["192.168.2.1:9300", "192.168.2.2:9300", "192.168.2.3:9300"]

启动

sudo /etc/init.d/elasticsearch start

# 验证上面一些配置是否配置成功

curl localhost:9200/_nodes/process?pretty

参考链接

标签: ElasticSearchES

 

Ubuntu16.04安装Elasticsearch

 

一、安装工作

1 wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

2 sudo apt-get install apt-transport-https

3 echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/

4 apt-get update && sudo apt-get install elasticsearch

二、启动工作:

1 cd /usr/share/elasticsearch/bin

2 vim ./elasticsearch.in.sh

3 JAVA_OPTS="$JAVA_OPTS -Des.insecure.allow.root=true"

4 ./elasticsearch

三、验证:

 

3 IK分词器的安装

我们目前使用的ES是 5.1.1版本,所以需要下载对应的5.1.1版本的IK分词器。

下载地址:https://github.com/medcl/elasticsearch-analysis-ik/releases 找到对应版本的分词器,点击zip压缩包链接进行下载。

下载好的压缩包,直接解压到ES的plugins目录下既可使用,重新启动ES,如果解压正确,则不会有异常输出。

注意:

  • 最好不要使用clone命令进行下载,否则下载的是源码,需要自己打包。
  • 如果用clone命令下载了源码,则需要安装maven进行打包,执行maven package命令。

 https://www.cnblogs.com/pigzhu/p/4705870.html

博文最后更新时间:


评论

  • TlcAX

    Meds information for patients. What side effects? <a href="https://topregabalin.top">cost generic lyrica without a prescription</a> in the USA Best information about medication. Read here.

  • JaniceWaics

    cialis daily <a href="https://mycialistabs.com/">cialis goodrx</a> taking cialis

  • Tiffanyhot

    cialis vs viagra reddit <a href="https://toptadalafiltabs.com/">cialis otc</a> cialis for sale online

  • StellaDep

    write my essay for me cheap <a href="https://topessaywriterfas.com/">https://topessaywriterfas.com/</a> how to write a play name in an essay

  • RebeccaDrord

    essay service tips <a href="http://writemyessayslfd.com/">help writing college essay</a> best essay writihg service

  • FrancesClaby

    sildenafil 50mg <a href="https://mrviagrashop.com">viagra over the counter usa</a> buy generic 100mg viagra online

发表评论

博客统计

访问量:5264088

博文总数:750 评论总数:910100

原创126 翻译20 转载604