ElasticSearch安装
[root@centos7 download]
[root@centos7 download]
[root@centos7 download]
创建elasticsearch yum源文件并安装elasticsearch
[root@CentOS-7 ~]
[elasticsearch]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md
[root@CentOS-7 ~]
配置ES集群
ES集群配置
[root@centos7 elasticsearch]
cluster.name: my-esCluster
cluster.routing.allocation.cluster_concurrent_rebalance: 16
cluster.routing.allocation.node_concurrent_recoveries: 16
cluster.routing.allocation.node_initial_primaries_recoveries: 16
node.name: <ES节点名称>
node.master: true
node.data: true
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: <ip> or <hostname>
http.port: 9200
transport.tcp.port: 9300
discovery.seed_hosts: ["es-hostname:9300", "es-hostname:9300"]
cluster.initial_master_nodes: ["node-01","node-02",..]
network.tcp.keep_alive: true
network.tcp.no_delay: true
transport.tcp.compress: true
http.cors.allow-origin: "*"
http.cors.enabled: true
http.max_content_length: 200mb
Linux系统相关配置
修改 /etc/security/limits.conf 添加如下内容:
elasticsearch soft nofile 65536
elasticsearch hard nofile 65536
修改 /etc/security/limits.d/20-nproc.conf 添加加配置如下:
* hard nproc 4096
elasticsearch soft nofile 65536
elasticsearch hard nofile 65536
修改 /etc/sysctl.conf 添加加如下配置:
vm.max_map_count=655360
|