elasticsearch集羣部署

自行到https://www.elastic.co/downloads/elasticsearch下載所對應的ES版本,選擇RPM 版本,我所使用的是6.4.1

1,安裝ES 

#rpm -ivh elasticsearch-6.4.1.rpm

創建ES所需要的目錄

#mkdir -pv /data/elasticsearch 

#mkdir -p /data/logs/elasticsearch

#chown -R elasticsearch.elasticsearch /data

編譯ES 配置文件


vim /etc/elasticsearch/elasticsearch.yml


cluster.name: elaseicsearch


indices.memory.index_buffer_size: 30%

indices.breaker.fielddata.limit: 20%

indices.fielddata.cache.size: 15%

indices.breaker.request.limit: 10%

indices.breaker.total.limit: 40%


thread_pool.bulk.size: 3

thread_pool.bulk.queue_size: 1000

#hread_pool.search.queue_size: 3000

 

gateway.recover_after_nodes: 1

gateway.expected_nodes: 1


discovery.zen.ping_timeout: 30s

discovery.zen.minimum_master_nodes: 1

http.max_initial_line_length: 1mb


discovery.zen.ping.unicast.hosts: ["1.1.1.1", "1.1.1.2", "1.1.1.3"]

processors: 2


discovery.zen.fd.ping_interval: 5s

discovery.zen.fd.connect_on_network_disconnect: true

index.store.type: niofs

#script.max_compilations_per_minute: 100000

network.tcp.keep_alive: false

transport.ping_schedule: 10s

bootstrap.memory_lock: false

bootstrap.system_call_filter: false

cluster.routing.allocation.same_shard.host: true

path.data: /data/elasticsearch

path.logs: /data/logs/elasticsearch

network.host: 1.1.1.1

http.port: 9200

node.name: test

node.master: false (哪臺設置爲主節點需要將此改爲true)

node.data: true

node.ingest: true

xpack.graph.enabled: true

xpack.ml.enabled: true

xpack.monitoring.enabled: true

#xpack.reporting.enabled: true

xpack.security.enabled: false

注:根據實際環境自行更改配置

修改jvm內存


vim /etc/elasticsearch/jvm.options 

image.png

將內存修改成主機的一半

2,安裝插件 x-pack ik分詞器

下載最新版本的包

wget https://artifacts.elastic.co/downloads/packs/x-pack/x-pack-6.2.4.zip

安裝x-pack

#cd /usr/share/elasticsearch/bin

#./elasticsearch-plugin install file:///root/x-pack-6.2.4.zip

安裝分詞器

#cd /usr/share/elasticsearch/plugins/

#mkdir ik

#mkdir pinyin

下載分詞器

#wget https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.4.1/elasticsearch-analysis-ik-6.4.1.zip

#wget https://github.com/medcl/elasticsearch-analysis-pinyin/releases/download/v6.4.1/elasticsearch-analysis-pinyin-6.4.1.zip

只需要將分詞器解壓到對應目錄就OK 

#unzip elasticsearch-analysis-ik-6.4.1.zip -d /usr/share/elasticsearch/plugins/ik/

#unzip elasticsearch-analysis-pinyin-6.4.1.zip -d /usr/share/elasticsearch/plugins/pinyin/

啓動ES 

#/etc/init.d/elasticsearch restart












發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章