1.节点服务器配置node
Master: 10.10.10.46 Slave1:10.10.10.53 Slave2:10.10.10.49
2.Master节点配置
bootstrap
Cluster:集群名称修改 # ---------------------------------- Cluster ----------------------------------- # # Use a descriptive name for your cluster: # cluster.name: YZYX-xianwei Node:修改节点名 # ------------------------------------ Node ------------------------------------ # # Use a descriptive name for the node: # node.name: master-46 # # Add custom attributes to the node: # #node.attr.rack: r1 Paths:修改数据及日志目录 # ----------------------------------- Paths ------------------------------------ # # Path to directory where to store the data (separate multiple locations by comma): # path.data: /usr/local/elk/data # # Path to log files: # path.logs: /usr/local/elk/log Discovery:定义ES角色(Master/slave); 配置单播hosts # --------------------------------- Discovery ---------------------------------- # # Pass an initial list of hosts to perform discovery when new node is started: # The default list of hosts is ["127.0.0.1", "[::1]"] node.master: true node.data: true #discovery.zen.ping.unicast.hosts: ["10.10.10.46", "10.10.10.53","10.10.10.49"] # # Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1): # #discovery.zen.minimum_master_nodes: # # For more information, consult the zen discovery module documentation. discovery.zen.ping_timeout: 10s discovery.zen.minimum_master_nodes: 3
3.ES7.x 配置方法跨域
cluster.name: YZYX-xianwei 集群名称,相同名称为一个集群 node.name: ks46 节点名称,集群模式下每一个节点名称惟一 node.master: true 当前节点是否能够被选举为master节点,是:true、否:false node.data: true 当前节点是否用于存储数据,是:true、否:false path.data: /data/elasticsearch,/data2/elasticsearch 索引数据存放的位置 path.logs: /usr/local/elasticsearch-7.3.1/logs 日志文件存放的位置 bootstrap.memory_lock: true 需求锁住物理内存,是:true、否:false bootstrap.system_call_filter: true SecComp检测,是:true、否:false network.host: 10.10.23.46 监听地址,用于访问该es http.port: 9200 es对外提供的http端口,默认 9200 discovery.seed_hosts: ["10.10.23.44:9300", "10.10.23.45:9300","10.10.23.46:9300"] 写入候选主节点的设备地址,在开启服务后能够被选为主节点 cluster.initial_master_nodes: ["10.10.23.44:9300", "10.10.23.45:9300", "10.10.23.46:9300"] 初始化一个新的集群时须要此配置来选举master http.cors.enabled 是否支持跨域,是:true,在使用head插件时须要此配置 http.cors.allow-origin "*" 表示支持全部域名
4.查看集群状态bash
http://10.10.10.46:9200/_cluster/health?pretty
http://10.10.10.49:9200/
http://10.10.10.49:9200/_cat/nodes?v
7.查看全部索引运维
http://10.10.10.49:9200/_cat/indices?v
8.配置全局变量,方便运维启动elasticsearch
export KS_HOME=/usr/local/elasticsearch-7.3.1 export PATH=$KS_HOME/bin:$PATH