ElasticSearch学习(十一)—— es7.2升级log4j版本

  1. 下载log4j2.17

    下载地址:Apache Logging Servicesicon-default.png?t=M3K6https://logging.apache.org/

  2. 查找es安装目录下需要替换的log4j文件
    /opt/elk# find . -name log4j*
    ./elasticsearch-7.2.0/lib/log4j-api-2.11.1.jar
    ./elasticsearch-7.2.0/lib/log4j-core-2.11.1.jar
    ./elasticsearch-7.2.0/lib/log4j-1.2-api-2.11.1.jar
    ./elasticsearch-7.2.0/modules/x-pack-security/log4j-slf4j-impl-2.11.1.jar
    ./elasticsearch-7.2.0/config/log4j2.properties
  3. 备份旧文件
    #四个需要替换的旧文件
    ./elasticsearch-7.2.0/lib/log4j-api-2.11.1.jar
    ./elasticsearch-7.2.0/lib/log4j-core-2.11.1.jar
    ./elasticsearch-7.2.0/lib/log4j-1.2-api-2.11.1.jar
    ./elasticsearch-7.2.0/modules/x-pack-security/log4j-slf4j-impl-2.11.1.jar
    
  4. 将2.11.1文件替换为2.17.2
    ./elasticsearch-7.2.0/lib/log4j-1.2-api-2.17.2.jar
    ./elasticsearch-7.2.0/lib/log4j-api-2.17.2.jar
    ./elasticsearch-7.2.0/lib/log4j-core-2.17.2.jar
    ./elasticsearch-7.2.0/modules/x-pack-security/log4j-slf4j-impl-2.17.2.jar
  5. 修改替换的文件权限
    chown -R esuser:esgroup ./elasticsearch-7.2.0/lib/log4j-1.2-api-2.17.2.jar
    chown -R esuser:esgroup ./elasticsearch-7.2.0/lib/log4j-api-2.17.2.jar
    chown -R esuser:esgroup ./elasticsearch-7.2.0/lib/log4j-core-2.17.2.jar
    chown -R esuser:esgroup ./elasticsearch-7.2.0/modules/x-pack-security/log4j-slf4j-impl-2.17.2.jar

    权限给到es用户

  6. 重新启动
  7. 启动报错
    [2022-05-08T19:17:33,019][INFO ][o.e.n.Node               ] [node-1] initialized
    [2022-05-08T19:17:33,021][INFO ][o.e.n.Node               ] [node-1] starting ...
    [2022-05-08T19:17:33,376][INFO ][o.e.t.TransportService   ] [node-1] publish_address {192.168.1.105:9301}, bound_addresses {[::]:9301}
    [2022-05-08T19:17:33,420][INFO ][o.e.b.BootstrapChecks    ] [node-1] bound or publishing to a non-loopback address, enforcing bootstrap checks
    [2022-05-08T19:17:33,462][INFO ][o.e.c.c.Coordinator      ] [node-1] cluster UUID [KsPJM8nLRxW8pLFH14GvQQ]
    [2022-05-08T19:17:33,813][WARN ][o.e.t.TcpTransport       ] [node-1] exception caught on transport layer [Netty4TcpChannel{localAddress=0.0.0.0/0.0.0.0:9300, remoteAddress=/0:0:0:0:0:0:0:1:60676}], closing connection
    io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: no cipher suites in common
    	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:472) ~[netty-codec-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278) ~[netty-codec-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [netty-transport-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [netty-transport-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [netty-transport-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1408) [netty-transport-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [netty-transport-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [netty-transport-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930) [netty-transport-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [netty-transport-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:682) [netty-transport-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:582) [netty-transport-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:536) [netty-transport-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) [netty-transport-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:906) [netty-common-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.35.Final.jar:4.1.35.Final]
    	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
    Caused by: javax.net.ssl.SSLHandshakeException: no cipher suites in common
    	at sun.security.ssl.Handshaker.checkThrown(Handshaker.java:1529) ~[?:?]
    	at sun.security.ssl.SSLEngineImpl.checkTaskThrown(SSLEngineImpl.java:535) ~[?:?]
    	at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:813) ~[?:?]
    	at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:781) ~[?:?]
    	at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624) ~[?:1.8.0_161]
    	at io.netty.handler.ssl.SslHandler$SslEngineType$3.unwrap(SslHandler.java:295) ~[netty-handler-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1332) ~[netty-handler-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1227) ~[netty-handler-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1274) ~[netty-handler-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502) ~[netty-codec-4.1.35.Final.jar:4.1.35.Final]
    	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441) ~[netty-codec-4.1.35.Final.jar:4.1.35.Final]
    	... 16 more

    解决

    network.host: 192.168.1.105

    修改elasticsearch.yml文件中的host 将默认的0.0.0.0修改为对应的服务器ip地址

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
elasticsearch log4j2.properties是用于配置elasticsearch日志记录工具log4j2的属性文件。log4j2是elasticsearch用于记录系统日志的工具,通过配置log4j2.properties文件可以定义日志的输出位置、格式和级别等相关信息。 首先,log4j2在elasticsearch中使用的目的是帮助开发人员和系统管理员对elasticsearch进行故障排除和监控。通过日志记录,可以了解系统的运行状态、发现问题和异常,从而及时采取措施解决。而log4j2.properties文件则是对日志记录进行属性配置的文件。 在log4j2.properties文件中,可以定义多个logger,每个logger对应不同的日志输出方式。通常,我们可以定义一个根logger和多个自定义logger。根logger通常用于记录整个系统的日志,而自定义logger可以针对具体的模块、组件进行日志记录。 在每个logger里,可以定义日志输出的级别(如TRACE、DEBUG、INFO、WARN、ERROR和FATAL),级别越高,记录的日志也越详细。除了级别,还可以配置日志输出的格式,如日期格式、日志内容格式等。 此外,log4j2.properties文件还可以配置日志输出的位置。可以将日志输出到控制台、文件、数据库等不同的目的地。在配置日志输出的位置时,可以指定日志文件的名称、路径和最大大小等属性。 总而言之,elasticsearch log4j2.properties文件用于配置log4j2日志记录工具的属性,通过它我们可以定义日志的输出位置、格式和级别,使系统管理员和开发人员更好地进行故障排除和监控工作。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值