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