ES-7.2.0单节点配置样例

elasticsearch.yml :


cluster.name: local

node.name: node-1

path.data: G:\Elastic\elasticsearch-7.2.0\data

path.logs: G:\Elastic\elasticsearch-7.2.0\logs

network.host: 0.0.0.0

http.port: 9200
#transport.tcp.port: 9300

discovery.seed_hosts: ["127.0.0.1"]

cluster.initial_master_nodes: ["node-1"]


http.cors.enabled: true
http.cors.allow-origin: "*"

xpack.license.self_generated.type: basic


cluster.max_shards_per_node: 3000

jvm.options

-Xms3g
-Xmx3g
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-Des.networkaddress.cache.ttl=60
-Des.networkaddress.cache.negative.ttl=10
-XX:+AlwaysPreTouch

-Xss1m

-Djava.awt.headless=true

-Dfile.encoding=UTF-8

-Djna.nosys=true

-XX:-OmitStackTraceInFastThrow

# flags to configure Netty
-Dio.netty.noUnsafe=true
-Dio.netty.noKeySetOptimization=true
-Dio.netty.recycler.maxCapacityPerThread=0

# log4j 2
-Dlog4j.shutdownHookEnabled=false
-Dlog4j2.disable.jmx=true

-Djava.io.tmpdir=${ES_TMPDIR}

## 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
-XX:+HeapDumpOnOutOfMemoryError

# specify an alternative path for heap dumps; ensure the directory exists and
# has sufficient space
-XX:HeapDumpPath=data

# specify an alternative path for JVM fatal error logs
-XX:ErrorFile=logs/hs_err_pid%p.log

## 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
# due to internationalization enhancements in JDK 9 Elasticsearch need to set the provider to COMPAT otherwise
# time/date parsing will break in an incompatible way for some date patterns and locals
9-:-Djava.locale.providers=COMPAT

windows上启动,电脑总内存64G,闲置内存超过56G,但是

-Xms3g
-Xmx3g

一旦设置为4g,就会报错:

Exception in thread "main" java.lang.OutOfMemoryError: Direct buffer memory
        at java.nio.Bits.reserveMemory(Bits.java:695)
        at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:123)
        at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:311)
        at sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:241)
        at sun.nio.ch.IOUtil.read(IOUtil.java:195)
        at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:159)
        at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65)
        at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:109)
        at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103)
        at com.fasterxml.jackson.dataformat.yaml.UTF8Reader.readBytes(UTF8Reader.java:327)
        at com.fasterxml.jackson.dataformat.yaml.UTF8Reader.loadMore(UTF8Reader.java:447)
        at com.fasterxml.jackson.dataformat.yaml.UTF8Reader.read(UTF8Reader.java:185)
        at com.fasterxml.jackson.dataformat.yaml.UTF8Reader.read(UTF8Reader.java:148)
        at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:184)
        at org.yaml.snakeyaml.reader.StreamReader.<init>(StreamReader.java:60)
        at com.fasterxml.jackson.dataformat.yaml.YAMLParser.<init>(YAMLParser.java:152)
        at com.fasterxml.jackson.dataformat.yaml.YAMLFactory._createParser(YAMLFactory.java:420)
        at com.fasterxml.jackson.dataformat.yaml.YAMLFactory.createParser(YAMLFactory.java:321)
        at org.elasticsearch.common.xcontent.yaml.YamlXContent.createParser(YamlXContent.java:85)
        at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1087)
        at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1070)
        at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:83)
        at org.elasticsearch.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:95)
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
        at org.elasticsearch.cli.Command.main(Command.java:90)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这个错误提示是因为安装ansible-7.2.0-1.el8.noarch软件包时,需要依赖于Python 3.11版本,但系统中没有找到这个版本的Python安装包。要解决这个问题,可以采取以下步骤: 1. 检查系统中安装的Python版本:使用命令`python3 --version`或`python --version`查看系统中当前的Python版本。如果没有安装Python或版本过低,需要先安装或升级Python。 2. 检查系统中Python可用的软件源:使用命令`sudo yum repolist`查看当前系统中可用的软件源。如果没有合适的软件源,可以尝试添加EPEL(Extra Packages for Enterprise Linux)软件源,该源提供了更多的软件包选择。 3. 安装Python 3.11:如果系统中没有可用的Python 3.11安装包,可以尝试从其他来源或第三方软件源安装该版本的Python。可以在Python官方网站上下载Python 3.11源码,并按照官方文档中的指引进行编译和安装。 4. 更新软件源:确保已经添加并更新了可用的软件源。使用命令`sudo yum update`更新系统中的软件包列表。 5. 安装ansible-7.2.0-1.el8.noarch软件包:在确保Python 3.11已经安装并可用的情况下,使用命令`sudo yum install ansible-7.2.0-1.el8.noarch`安装所需的软件包。 6. 验证安装:安装完成后,可以使用命令`ansible --version`验证Ansible的安装和版本号。 请注意,对于使用不同的操作系统版本和软件源的情况,上述步骤可能会有所不同。建议根据具体情况进行调整。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值