elasticsearch 学习教程之二 配置文件

elasticsearch.yml 如下

# ======================== Elasticsearch Configuration =========================  
  
# ---------------------------------- Cluster -----------------------------------  
#集群名称  
cluster.name: clusterName  
  
# ------------------------------------ Node ------------------------------------  
#当前节点名称  
node.name: node-2  
#node.attr.rack: r1  
  
# ----------------------------------- Paths ------------------------------------  
#配置日志和数据目录,这两个目录一般挂载大磁盘  
#path.data: /path/to/data  
#path.logs: /path/to/logs  
  
# ----------------------------------- Memory -----------------------------------  
  
#bootstrap.memory_lock: true  
bootstrap.system_call_filter: false  
  
# ---------------------------------- Network -----------------------------------  
#网络设置  
network.host: 0.0.0.0  
http.port: 9500  
transport.tcp.port: 9501  
http.cors.enabled: true    
http.cors.allow-origin: "*"  
  
# --------------------------------- Discovery ---------------------------------  


#集群中的节点配置
discovery.zen.ping.unicast.hosts: ["10.111.2.62:9401","10.111.3.63:9401","10.111.2.64:9401"]  
discovery.zen.minimum_master_nodes: 1   
  
# ---------------------------------- Gateway -----------------------------------  
  
#gateway.recover_after_nodes: 3  
  
# ---------------------------------- Various -----------------------------------  
  
#action.destructive_requires_name: true  




jvm.options     注要是内存设置

## JVM configuration


################################################################
## IMPORTANT: JVM heap size
################################################################


-Xms4g
-Xmx4g


################################################################
## Expert settings
################################################################


################################################################


## GC configuration
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly


-XX:+AlwaysPreTouch


-Xss1m
-Djava.awt.headless=true
-Dfile.encoding=UTF-8
-Djna.nosys=true


-XX:-OmitStackTraceInFastThrow


-Dio.netty.noUnsafe=true
-Dio.netty.noKeySetOptimization=true
-Dio.netty.recycler.maxCapacityPerThread=0


-Dlog4j.shutdownHookEnabled=false
-Dlog4j2.disable.jmx=true


-Djava.io.tmpdir=${ES_TMPDIR}


## heap dumps
-XX:+HeapDumpOnOutOfMemoryError


#-XX:HeapDumpPath=/heap/dump/path


## JDK 8 GC logging


8:-XX:+PrintGCDetails
8:-XX:+PrintGCDateStamps
8:-XX:+PrintTenuringDistribution
8:-XX:+PrintGCApplicationStoppedTime
8:-Xloggc:logs/gc.log
8:-XX:+UseGCLogFileRotation
8:-XX:NumberOfGCLogFiles=32
8:-XX:GCLogFileSize=64m


# JDK 9+ GC logging
9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m
9-:-Djava.locale.providers=COMPAT











评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值