init
This commit is contained in:
commit
ba9def34c6
15 changed files with 1707 additions and 0 deletions
1
elastic/.gitignore
vendored
Normal file
1
elastic/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
elasticsearch.keystore
|
4
elastic/data/.gitignore
vendored
Normal file
4
elastic/data/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
*
|
||||
*/
|
||||
!.gitignore
|
||||
!.gitkeep
|
0
elastic/data/.gitkeep
Normal file
0
elastic/data/.gitkeep
Normal file
45
elastic/elasticsearch.yml
Normal file
45
elastic/elasticsearch.yml
Normal file
|
@ -0,0 +1,45 @@
|
|||
# Do not use this configuration in production.
|
||||
# It is for demonstration purposes only.
|
||||
|
||||
path.data: /var/lib/elasticsearch
|
||||
path.logs: /var/log/elasticsearch
|
||||
|
||||
# PATH CONFIG
|
||||
# https://www.elastic.co/guide/en/elasticsearch/reference/7.5/path-settings.html
|
||||
|
||||
#----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------
|
||||
#
|
||||
# The following settings, TLS certificates, and keys have been automatically
|
||||
# generated to configure Elasticsearch security features on 23-10-2024 21:52:59
|
||||
#
|
||||
# --------------------------------------------------------------------------------
|
||||
|
||||
# Enable security features
|
||||
xpack.security.enabled: false
|
||||
|
||||
xpack.security.enrollment.enabled: false
|
||||
|
||||
# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
|
||||
xpack.security.http.ssl:
|
||||
enabled: false
|
||||
#keystore.path: certs/http.p12
|
||||
|
||||
# Enable encryption and mutual authentication between cluster nodes
|
||||
xpack.security.transport.ssl:
|
||||
enabled: false
|
||||
#verification_mode: certificate
|
||||
#keystore.path: certs/transport.p12
|
||||
#truststore.path: certs/transport.p12
|
||||
# Create a new cluster with the current node only
|
||||
# Additional nodes can still join the cluster later
|
||||
cluster.initial_master_nodes: ["grafana-stack-pod"]
|
||||
|
||||
# Allow HTTP API connections from anywhere
|
||||
# Connections are encrypted and require user authentication
|
||||
http.host: 0.0.0.0
|
||||
|
||||
# Allow other nodes to join the cluster from anywhere
|
||||
# Connections are encrypted and mutually authenticated
|
||||
#transport.host: 0.0.0.0
|
||||
|
||||
#----------------------- END SECURITY AUTO CONFIGURATION -------------------------
|
87
elastic/jvm.options
Normal file
87
elastic/jvm.options
Normal file
|
@ -0,0 +1,87 @@
|
|||
################################################################
|
||||
##
|
||||
## JVM configuration
|
||||
##
|
||||
################################################################
|
||||
##
|
||||
## WARNING: DO NOT EDIT THIS FILE. If you want to override the
|
||||
## JVM options in this file, or set any additional options, you
|
||||
## should create one or more files in the jvm.options.d
|
||||
## directory containing your adjustments.
|
||||
##
|
||||
## See https://www.elastic.co/guide/en/elasticsearch/reference/@project.minor.version@/jvm-options.html
|
||||
## for more information.
|
||||
##
|
||||
################################################################
|
||||
|
||||
|
||||
|
||||
################################################################
|
||||
## IMPORTANT: JVM heap size
|
||||
################################################################
|
||||
##
|
||||
## The heap size is automatically configured by Elasticsearch
|
||||
## based on the available memory in your system and the roles
|
||||
## each node is configured to fulfill. If specifying heap is
|
||||
## required, it should be done through a file in jvm.options.d,
|
||||
## which should be named with .options suffix, and the min and
|
||||
## max should be set to the same value. For example, to set the
|
||||
## heap to 4 GB, create a new file in the jvm.options.d
|
||||
## directory containing these lines:
|
||||
##
|
||||
## -Xms4g
|
||||
## -Xmx4g
|
||||
##
|
||||
## See https://www.elastic.co/guide/en/elasticsearch/reference/@project.minor.version@/heap-size.html
|
||||
## for more information
|
||||
##
|
||||
################################################################
|
||||
|
||||
|
||||
################################################################
|
||||
## Expert settings
|
||||
################################################################
|
||||
##
|
||||
## All settings below here are considered expert settings. Do
|
||||
## not adjust them unless you understand what you are doing. Do
|
||||
## not edit them in this file; instead, create a new file in the
|
||||
## jvm.options.d directory containing your adjustments.
|
||||
##
|
||||
################################################################
|
||||
|
||||
-XX:+UseG1GC
|
||||
|
||||
## JVM temporary directory
|
||||
-Djava.io.tmpdir=${ES_TMPDIR}
|
||||
|
||||
# Leverages accelerated vector hardware instructions; removing this may
|
||||
# result in less optimal vector performance
|
||||
20-:--add-modules=jdk.incubator.vector
|
||||
|
||||
# Required to workaround performance issue in JDK 23, https://github.com/elastic/elasticsearch/issues/113030
|
||||
23:-XX:CompileCommand=dontinline,java/lang/invoke/MethodHandle.setAsTypeCache
|
||||
23:-XX:CompileCommand=dontinline,java/lang/invoke/MethodHandle.asTypeUncached
|
||||
|
||||
# Lucene 10: apply MADV_NORMAL advice to enable more aggressive readahead
|
||||
-Dorg.apache.lucene.store.defaultReadAdvice=normal
|
||||
|
||||
## heap dumps
|
||||
|
||||
# generate a heap dump when an allocation from the Java heap fails; heap dumps
|
||||
# are created in the working directory of the JVM unless an alternative path is
|
||||
# specified
|
||||
-XX:+HeapDumpOnOutOfMemoryError
|
||||
|
||||
# exit right after heap dump on out of memory error
|
||||
-XX:+ExitOnOutOfMemoryError
|
||||
|
||||
# specify an alternative path for heap dumps; ensure the directory exists and
|
||||
# has sufficient space
|
||||
#@heap.dump.path@
|
||||
|
||||
# specify an alternative path for JVM fatal error logs
|
||||
#@error.file@
|
||||
|
||||
## GC logging
|
||||
-Xlog:gc*,gc+age=trace,safepoint:file=@loggc@:utctime,level,pid,tags:filecount=32,filesize=64m
|
||||
|
132
elastic/log4j2.properties
Normal file
132
elastic/log4j2.properties
Normal file
|
@ -0,0 +1,132 @@
|
|||
status = error
|
||||
|
||||
appender.console.type = Console
|
||||
appender.console.name = console
|
||||
appender.console.layout.type = PatternLayout
|
||||
appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] [%node_name]%marker %m%consoleException%n
|
||||
|
||||
######## Server JSON ############################
|
||||
appender.rolling.type = RollingFile
|
||||
appender.rolling.name = rolling
|
||||
appender.rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_server.json
|
||||
appender.rolling.layout.type = ECSJsonLayout
|
||||
appender.rolling.layout.dataset = elasticsearch.server
|
||||
|
||||
appender.rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}-%d{yyyy-MM-dd}-%i.json.gz
|
||||
appender.rolling.policies.type = Policies
|
||||
appender.rolling.policies.time.type = TimeBasedTriggeringPolicy
|
||||
appender.rolling.policies.time.interval = 1
|
||||
appender.rolling.policies.time.modulate = true
|
||||
appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
|
||||
appender.rolling.policies.size.size = 128MB
|
||||
appender.rolling.strategy.type = DefaultRolloverStrategy
|
||||
appender.rolling.strategy.fileIndex = nomax
|
||||
appender.rolling.strategy.action.type = Delete
|
||||
appender.rolling.strategy.action.basepath = ${sys:es.logs.base_path}
|
||||
appender.rolling.strategy.action.condition.type = IfFileName
|
||||
appender.rolling.strategy.action.condition.glob = ${sys:es.logs.cluster_name}-*
|
||||
appender.rolling.strategy.action.condition.nested_condition.type = IfAccumulatedFileSize
|
||||
appender.rolling.strategy.action.condition.nested_condition.exceeds = 2GB
|
||||
################################################
|
||||
######## Server - old style pattern ###########
|
||||
appender.rolling_old.type = RollingFile
|
||||
appender.rolling_old.name = rolling_old
|
||||
appender.rolling_old.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}.log
|
||||
appender.rolling_old.layout.type = PatternLayout
|
||||
appender.rolling_old.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] [%node_name]%marker %m%n
|
||||
|
||||
appender.rolling_old.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}-%d{yyyy-MM-dd}-%i.log.gz
|
||||
appender.rolling_old.policies.type = Policies
|
||||
appender.rolling_old.policies.time.type = TimeBasedTriggeringPolicy
|
||||
appender.rolling_old.policies.time.interval = 1
|
||||
appender.rolling_old.policies.time.modulate = true
|
||||
appender.rolling_old.policies.size.type = SizeBasedTriggeringPolicy
|
||||
appender.rolling_old.policies.size.size = 128MB
|
||||
appender.rolling_old.strategy.type = DefaultRolloverStrategy
|
||||
appender.rolling_old.strategy.fileIndex = nomax
|
||||
appender.rolling_old.strategy.action.type = Delete
|
||||
appender.rolling_old.strategy.action.basepath = ${sys:es.logs.base_path}
|
||||
appender.rolling_old.strategy.action.condition.type = IfFileName
|
||||
appender.rolling_old.strategy.action.condition.glob = ${sys:es.logs.cluster_name}-*
|
||||
appender.rolling_old.strategy.action.condition.nested_condition.type = IfAccumulatedFileSize
|
||||
appender.rolling_old.strategy.action.condition.nested_condition.exceeds = 2GB
|
||||
################################################
|
||||
|
||||
rootLogger.level = info
|
||||
rootLogger.appenderRef.console.ref = console
|
||||
rootLogger.appenderRef.rolling.ref = rolling
|
||||
rootLogger.appenderRef.rolling_old.ref = rolling_old
|
||||
|
||||
######## Deprecation JSON #######################
|
||||
appender.deprecation_rolling.type = RollingFile
|
||||
appender.deprecation_rolling.name = deprecation_rolling
|
||||
appender.deprecation_rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation.json
|
||||
appender.deprecation_rolling.layout.type = ECSJsonLayout
|
||||
# Intentionally follows a different pattern to above
|
||||
appender.deprecation_rolling.layout.dataset = deprecation.elasticsearch
|
||||
appender.deprecation_rolling.filter.rate_limit.type = RateLimitingFilter
|
||||
|
||||
appender.deprecation_rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation-%i.json.gz
|
||||
appender.deprecation_rolling.policies.type = Policies
|
||||
appender.deprecation_rolling.policies.size.type = SizeBasedTriggeringPolicy
|
||||
appender.deprecation_rolling.policies.size.size = 1GB
|
||||
appender.deprecation_rolling.strategy.type = DefaultRolloverStrategy
|
||||
appender.deprecation_rolling.strategy.max = 4
|
||||
|
||||
appender.header_warning.type = HeaderWarningAppender
|
||||
appender.header_warning.name = header_warning
|
||||
#################################################
|
||||
|
||||
logger.deprecation.name = org.elasticsearch.deprecation
|
||||
logger.deprecation.level = WARN
|
||||
logger.deprecation.appenderRef.deprecation_rolling.ref = deprecation_rolling
|
||||
logger.deprecation.appenderRef.header_warning.ref = header_warning
|
||||
logger.deprecation.additivity = false
|
||||
|
||||
######## Search slowlog JSON ####################
|
||||
appender.index_search_slowlog_rolling.type = RollingFile
|
||||
appender.index_search_slowlog_rolling.name = index_search_slowlog_rolling
|
||||
appender.index_search_slowlog_rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs\
|
||||
.cluster_name}_index_search_slowlog.json
|
||||
appender.index_search_slowlog_rolling.layout.type = ECSJsonLayout
|
||||
appender.index_search_slowlog_rolling.layout.dataset = elasticsearch.index_search_slowlog
|
||||
|
||||
appender.index_search_slowlog_rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs\
|
||||
.cluster_name}_index_search_slowlog-%i.json.gz
|
||||
appender.index_search_slowlog_rolling.policies.type = Policies
|
||||
appender.index_search_slowlog_rolling.policies.size.type = SizeBasedTriggeringPolicy
|
||||
appender.index_search_slowlog_rolling.policies.size.size = 1GB
|
||||
appender.index_search_slowlog_rolling.strategy.type = DefaultRolloverStrategy
|
||||
appender.index_search_slowlog_rolling.strategy.max = 4
|
||||
#################################################
|
||||
|
||||
#################################################
|
||||
logger.index_search_slowlog_rolling.name = index.search.slowlog
|
||||
logger.index_search_slowlog_rolling.level = trace
|
||||
logger.index_search_slowlog_rolling.appenderRef.index_search_slowlog_rolling.ref = index_search_slowlog_rolling
|
||||
logger.index_search_slowlog_rolling.additivity = false
|
||||
|
||||
######## Indexing slowlog JSON ##################
|
||||
appender.index_indexing_slowlog_rolling.type = RollingFile
|
||||
appender.index_indexing_slowlog_rolling.name = index_indexing_slowlog_rolling
|
||||
appender.index_indexing_slowlog_rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}\
|
||||
_index_indexing_slowlog.json
|
||||
appender.index_indexing_slowlog_rolling.layout.type = ECSJsonLayout
|
||||
appender.index_indexing_slowlog_rolling.layout.dataset = elasticsearch.index_indexing_slowlog
|
||||
|
||||
|
||||
appender.index_indexing_slowlog_rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}\
|
||||
_index_indexing_slowlog-%i.json.gz
|
||||
appender.index_indexing_slowlog_rolling.policies.type = Policies
|
||||
appender.index_indexing_slowlog_rolling.policies.size.type = SizeBasedTriggeringPolicy
|
||||
appender.index_indexing_slowlog_rolling.policies.size.size = 1GB
|
||||
appender.index_indexing_slowlog_rolling.strategy.type = DefaultRolloverStrategy
|
||||
appender.index_indexing_slowlog_rolling.strategy.max = 4
|
||||
#################################################
|
||||
|
||||
|
||||
logger.index_indexing_slowlog.name = index.indexing.slowlog.index
|
||||
logger.index_indexing_slowlog.level = trace
|
||||
logger.index_indexing_slowlog.appenderRef.index_indexing_slowlog_rolling.ref = index_indexing_slowlog_rolling
|
||||
logger.index_indexing_slowlog.additivity = false
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue