实战教你ElasticSearch-8.13集群搭建
elasticsearch8.13集群部署
-
elasticsearch8.13
-
analysis-ik
-
elastiknn
环境准备(每台节点都需要修改)
修改系统参数-----https://www.elastic.co/guide/en/elasticsearch/reference/current/system-config.html(官方推荐)
# vim /etc/security/limits.conf 新增内容如下: * hard nofile 65536 * soft nproc 2048 * hard nproc 4096 * soft memlock unlimited * hard memlock unlimited elasticsearch soft memlock unlimited elasticsearch hard memlock unlimited
# vim /etc/sysctl.conf
vm.max_map_count=262144
fs.file-max=655360
# sysctl -p
--修改jvm启动内存--运行内存
#vim /etc/elasticsearch/jvm.options (两个之和不要大过物理内存的百分之50)
-Xms1g
-Xmx1g
安装地址:(https://www.elastic.co/guide/en/elasticsearch/reference/8.13/rpm.html)
sudo rpm -ivh elasticsearch-8.13.0-x86_64.rpm
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
配置elasticsearch.yml(诸台节点配置)
cluster.name: es-ai_cluster node.name: es-ai_node7 node.roles: [ master, data ] path.data: /home/es/data/elasticsearch_813 path.logs: /var/log/elasticsearch network.host: 0.0.0.0 network.publish_host: 192.168.253.8 http.port: 9200 transport.port: 9300 discovery.seed_hosts: ["192.168.254.175", "192.168.252.188", "192.168.253.8"] #cluster.initial_master_nodes: ["es-ai_node5", "es-ai_node6", "es-ai_node7"] (第一次启动集群需要打开) http.cors.enabled: true http.cors.allow-origin: "*" action.destructive_requires_name: true bootstrap.memory_lock: true # Enable security features xpack.security.enabled: false xpack.security.transport.ssl.enabled: false xpack.security.http.ssl.enabled: false
配置jvm.options
-Xms8g(添加)
-Xmx8g
安装好es后执行(bootstrap.memory_lock)限制内存
systemctl edit elasticsearch.service
[Service]
LimitMEMLOCK=infinity
运行:
sudo systemctl start elasticsearch.service
插件安装地址:
cd /usr/share/elasticsearch/plugins
elasticsearch-analysis-ik-8.13.0.zip (解压放上面目录) elastiknn-8.13.0.0.zip