当前位置: 首页 > >

Linux(CentOS 7.x£©´î½¨Elasticsearch7.8.0¼¯Èº

发布时间:



ÎÄÕÂĿ¼
ÉÏ´«Elasticsearch°²×°°üÉÏ´«Elasticsearch°²×°°ü¶þ¡¢´´½¨ÆÕͨÓû§1.´´½¨ÆÕͨÓû§2.ΪÐÂÓû§ÊÚȨ
±à¼­ÅäÖÃÎļþÅäÖÃϵͳ²ÎÊý×î´ó¿É´´½¨ÎļþÊý̫С×î´óÐéÄâ»úÄÚ´æ̫СÖØмÓÔØ£¬ÊäÈëÏÂÃæÃüÁî
Æô¶¯Elasticsearch¹Ø±Õ·À»ðǽ²âÊÔµ¥»ú²¿ÊðÊÇ·ñ³É¹¦¼¯ÈºÅäÖÃÎļþ²âÊÔ¼¯ÈºÊÇ·ñ´î½¨³É¹¦



ÉÏ´«Elasticsearch°²×°°ü

ÉÏ´«Elasticsearch°²×°°ü

tar -zxvf elasticsearch-7.8.0-linux-x86_64.tar.gz -C /usr/local/services


¶þ¡¢´´½¨ÆÕͨÓû§

ÒòΪ°²È«ÎÊÌ⣬Elasticsearch²»ÔÊÐírootÓû§Ö±½ÓÔËÐУ¬ËùÒÔÒª´´½¨ÐÂÓû§£¬ÔÚrootÓû§Öд´½¨ÐÂÓû§£¬Ö´ÐÐÈçÏÂÃüÁî


1.´´½¨ÆÕͨÓû§

useradd es #ÐÂÔöesÓû§
passwd es #ΪesÓû§ÉèÖÃÃÜÂë

userdel -r es #Èç¹û´íÁË£¬¿ÉÒÔɾ³ýÔÙ¼Ó

2.ΪÐÂÓû§ÊÚȨ

chown -R es:es /usr/local/services/elasticsearch-7.8.0 #Îļþ¼ÐËùÓÐÕß


±à¼­ÅäÖÃÎļþ

vi /etc/local/services/elasticsearch-7.8.0/config/elasticsearch.yml


# ¼ÓÈëÈçÏÂÅäÖÃ
cluster.name: elasticsearch
node.name: node-1
network.host: 0.0.0.0
http.port: 9200
cluster.initial_master_nodes: ["node-1"]


ÅäÖÃϵͳ²ÎÊý
×î´ó¿É´´½¨ÎļþÊý̫С

vi /etc/security/limits.conf
# ÔÚÎļþĩβÖÐÔö¼ÓÏÂÃæÄÚÈÝ
es soft nofile 65536
es hard nofile 65536

vi /etc/security/limits.d/20-nproc.conf
# ÔÚÎļþĩβÖÐÔö¼ÓÏÂÃæÄÚÈÝ
es soft nofile 65536
es hard nofile 65536
* hard nproc 4096
# ×¢£º* ´ø±íLinuxËùÓÐÓû§Ãû³Æ

×î´óÐéÄâ»úÄÚ´æ̫С

vi /etc/sysctl.conf
# ÔÚÎļþÖÐÔö¼ÓÏÂÃæÄÚÈÝ
vm.max_map_count=655360

ÖØмÓÔØ£¬ÊäÈëÏÂÃæÃüÁî

sysctl -p


Æô¶¯Elasticsearch

cd /usr/local/elasticsearch-7.8.0/
#Æô¶¯
./bin/elasticsearch
#ºǫ́Æô¶¯
./bin/elasticsearch -d


¹Ø±Õ·À»ðǽ

#ÔÝʱ¹Ø±Õ·À»ðǽ
systemctl stop firewalld

#ÓÀ¾Ã¹Ø±Õ·À»ðǽ
systemctl enable firewalld.service #´ò¿ª·Å»õÇÀÓÀ¾ÃÐÔÉúЧ£¬Ö*ôºó²»»á¸´Ô­
systemctl disable firewalld.service #¹Ø±Õ·À»ðǽ£¬ÓÀ¾ÃÐÔÉúЧ£¬Ö*ôºó²»»á¸´Ô­


²âÊÔµ¥»ú²¿ÊðÊÇ·ñ³É¹¦

http://192.168.1.88:9200/



¼¯ÈºÅäÖÃÎļþ

#¼¯ÈºÃû³Æ
cluster.name: cluster-Es
#½ÚµãÃû³Æ
node.name: node_1
#ipµØÖ·
network.host: 192.168.1.88
#ÊDz»ÊÇÓÐ×ʸñÖ÷½Úµã
node.master: true
node.data: true
# head ²å¼þÐèÒªÕâ´ò¿ªÕâÁ½¸öÅäÖÃ
http.cors.allow-origin: "*"
http.cors.enabled: true
http.max_content_length: 200mb
#es7.x Ö®ºóÐÂÔöµÄÅäÖ㬳õʼ»¯Ò»¸öеļ¯ÈºÊ±ÐèÒª´ËÅäÖÃÀ´Ñ¡¾Ùmaster
cluster.initial_master_nodes: ["192.168.1.88:9300","192.168.1.77:9300","192.168.1.66:9300"]
#es7.x Ö®ºóÐÂÔöµÄÅäÖ㬽ڵ㷢ÏÖ
discovery.seed_hosts: ["192.168.1.88:9300","192.168.1.77:9300","192.168.1.66:9300"]
gateway.recover_after_nodes: 2
network.tcp.keep_alive: true
network.tcp.no_delay: true
transport.tcp.compress: true
#¼¯ÈºÄÚͬʱÆô¶¯µÄÊý¾ÝÈÎÎñ¸öÊý£¬Ä¬ÈÏÊÇ2¸ö
cluster.routing.allocation.cluster_concurrent_rebalance: 16
#Ìí¼Ó»òɾ³ý½Úµã¼°¸ºÔؾùºâʱ²¢·¢»Ö¸´µÄÏ̸߳öÊý£¬Ä¬ÈÏ4¸ö
cluster.routing.allocation.node_concurrent_recoveries: 16
#³õʼ»¯Êý¾Ý»Ö¸´Ê±£¬²¢·¢»Ö¸´Ï̵߳ĸöÊý£¬Ä¬ÈÏ4¸ö
cluster.routing.allocation.node_initial_primaries_recoveries: 16


²âÊÔ¼¯ÈºÊÇ·ñ´î½¨³É¹¦

http://192.168.1.88:9200/_cat/nodes


相关推荐


友情链接: