总结—elasticsearch启动失败的几种情况及解决

湖蓝几何球体LinkedIn Banner.png
转载说明:如果您喜欢这篇文章并打算转载它,请私信作者取得授权。感谢您喜爱本文,请文明转载,谢谢。


摘要

本文主要梳理从ES初学以来所遇到的启动失败的几种情况。

1、使用root用户启动失败

在有一次搭建elasticsearch的时候,使用systemctl启动elasticsearch失败,然后在bin目录下面去使用启动脚本启动,发现报错不能用root用户启动,报“Caused by: java.lang.RuntimeException: can not run elasticsearch as root”:

[root@localhost bin]# ./elasticsearch
[2017-12-20T17:01:47,922][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [node-1] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-6.1.1.jar:6.1.1]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-6.1.1.jar:6.1.1]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.1.1.jar:6.1.1]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.1.1.jar:6.1.1]
	at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.1.1.jar:6.1.1]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-6.1.1.jar:6.1.1]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) ~[elasticsearch-6.1.1.jar:6.1.1]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
	at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:104) ~[elasticsearch-6.1.1.jar:6.1.1]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:171) ~[elasticsearch-6.1.1.jar:6.1.1]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:322) ~[elasticsearch-6.1.1.jar:6.1.1]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-6.1.1.jar:6.1.1]
	... 6 more
[root@localhost bin]# cd ..

解决:

创建一个独立的用户,比如elk来启动elasticsearch,不用root用户启动

2、elasticsearch安装目录权限不对

遇到启动elasticsearch失败,使用的是专门的用户elk来启动的,启动日志提示不能加载配置文件:

[elk@docker bin]$ ./elasticsearch
Exception in thread "main" 2018-06-03 17:36:23,881 main ERROR No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging.
2018-06-03 17:36:24,113 main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:585)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1848)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:322)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
        at org.apache.logging.log4j.core.jmx.Server.register(Server.java:389)
        at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:167)
        at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:140)
        at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:556)
        at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:617)
        at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:634)
        at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:229)
        at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:242)
        at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
        at org.apache.logging.log4j.LogManager.getContext(LogManager.java:174)
        at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:618)
        at org.elasticsearch.common.logging.ESLoggerFactory.getLogger(ESLoggerFactory.java:54)
        at org.elasticsearch.common.logging.ESLoggerFactory.getLogger(ESLoggerFactory.java:62)
        at org.elasticsearch.common.logging.Loggers.getLogger(Loggers.java:101)
        at org.elasticsearch.ExceptionsHelper.<clinit>(ExceptionsHelper.java:42)
        at org.elasticsearch.ElasticsearchException.toString(ElasticsearchException.java:663)
        at java.lang.String.valueOf(String.java:2994)
        at java.io.PrintStream.println(PrintStream.java:821)
        at java.lang.Throwable$WrappedPrintStream.println(Throwable.java:748)
        at java.lang.Throwable.printStackTrace(Throwable.java:655)
        at java.lang.Throwable.printStackTrace(Throwable.java:643)
        at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1061)
        at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1052)
        at java.lang.Thread.dispatchUncaughtException(Thread.java:1959)

SettingsException[Failed to load settings from /usr/local/elasticsearch-5.6.0/config/elasticsearch.yml]; nested: AccessDeniedException[/usr/local/elasticsearch-5.6.0/config/elasticsearch.yml];
        at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:102)
        at org.elasticsearch.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:72)
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134)
        at org.elasticsearch.cli.Command.main(Command.java:90)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84)
Caused by: java.nio.file.AccessDeniedException: /usr/local/elasticsearch-5.6.0/config/elasticsearch.yml
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
        at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
        at java.nio.file.Files.newByteChannel(Files.java:361)
        at java.nio.file.Files.newByteChannel(Files.java:407)
        at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
        at java.nio.file.Files.newInputStream(Files.java:152)
        at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1032)
        at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:100)
        ... 6 more
[elk@docker bin]$ 

解决:

看到“Caused by: java.nio.file.AccessDeniedException: /usr/local/elasticsearch-5.6.0/config/elasticsearch.yml”的提示,就去检查目录的权限,果然是root:root权限,使用elk用户去启动,就报错了。
将目录的权限改成elk:elk就好了。

[root@docker ~]# ll /usr/local/
drwxr-xr-x  7 root root       123 9月   7 2017 elasticsearch-5.6.0

[root@docker local]#  chown  -R elk:elk elasticsearch-5.6.0
[root@docker local]# ll
drwxr-xr-x  7 elk  elk        123 9月   7 2017 elasticsearch-5.6.0

3、使用yum安装方式,赋权错误,启动失败

在一次使用yum安装elasticsearch的时候,执行完yum -y install elasticsearch 命令后,进行了下面的操作:
1、修改elasticsearch.yml文件
2、创建elk用户
3、创建/opt/elk/data目录,并且赋权为elk:elk
4、修改/var/log/elasticsearch权限为elk:elk
5、启动服务,但是报下面的错(截取了部分):

[root@test101 init.d]# ./elasticsearch start
Starting elasticsearch: 2018-06-12 15:13:50,287 main ERROR Unable to create file /var/log/elasticsearch/elk.log java.io.IOException: 权限不够
	at java.io.UnixFileSystem.createFileExclusively(Native Method)
	at java.io.File.createNewFile(File.java:1012)
	at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:628)
	at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:608)
	at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:113)
	at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:115)
	at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:188)
	at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:144)
	at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:60)
	at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:958)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:898)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:890)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:513)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:237)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:249)
	at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:545)
	at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:261)
	at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:166)
	at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:122)
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:307)
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132)
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123)
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70)
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134)
	at org.elasticsearch.cli.Command.main(Command.java:90)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84)

2018-06-12 15:13:50,296 main ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@16293aa2] unable to create manager for [/var/log/elasticsearch/elk.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@5158b42f[pattern=/var/log/elasticsearch/elk-%d{yyyy-MM-dd}.log, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[TimeBasedTriggeringPolicy(nextRolloverMillis=0, interval=1, modulate=true)]), strategy=DefaultRolloverStrategy(min=1, max=7, useMax=true), advertiseURI=null, layout=[%d{ISO8601}][%-5p][%-25c{1.}] %marker%.-10000m%n, filePermissions=null, fileOwner=null]] java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@16293aa2] unable to create manager for [/var/log/elasticsearch/elk.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@5158b42f[pattern=/var/log/elasticsearch/elk-%d{yyyy-MM-dd}.log, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[TimeBasedTriggeringPolicy(nextRolloverMillis=0, interval=1, modulate=true)]), strategy=DefaultRolloverStrategy(min=1, max=7, useMax=true), advertiseURI=null, layout=[%d{ISO8601}][%-5p][%-25c{1.}] %marker%.-10000m%n, filePermissions=null, fileOwner=null]]
	at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:115)
	at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:115)
	at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:188)
	at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:144)
	at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:60)
	at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:958)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:898)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:890)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:513)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:237)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:249)
	at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:545)
	at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:261)
	at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:166)
	at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:122)
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:307)
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132)
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123)
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70)
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134)
	at org.elasticsearch.cli.Command.main(Command.java:90)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84)

2018-06-12 15:13:50,311 main ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender
	at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod(PluginBuilder.java:229)
	at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:134)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:958)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:898)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:890)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:513)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:237)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:249)
	at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:545)
	at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:261)
	at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:166)
	at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:122)
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:307)
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132)
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123)
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70)
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134)
	at org.elasticsearch.cli.Command.main(Command.java:90)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84)

解决:

原来在执行yum -y install elasticsearch的时候,就已经自动创建了一个单独的管理用户elasticsearch,但是我又自己创建了一个elk用户,并且把data和log目录授权给elk,所以就会出现“Starting elasticsearch: 2018-06-12 15:13:50,287 main ERROR Unable to create file /var/log/elasticsearch/elk.log java.io.IOException: 权限不够”的报错。
因此只需要将/opt/elk/data和/var/log/elasticsearch目录权限改为elasticsearch:elasticsearch就好了:

然后重启服务成功:

[root@test101 init.d]# ./elasticsearch start
Starting elasticsearch:                                    [  确定  ]
 
[root@test101 init.d]# ps -ef|grep elasticsearch
elastic+   5157      1 80 15:49 ?        00:00:08 /usr/local/jdk1.8.0_151/bin/java -Xms512m -Xmx512m -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -XX:+HeapDumpOnOutOfMemoryError -Des.path.home=/usr/share/elasticsearch -cp /usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -p /var/run/elasticsearch/elasticsearch.pid -d -Edefault.path.logs=/var/log/elasticsearch -Edefault.path.data=/var/lib/elasticsearch -Edefault.path.conf=/etc/elasticsearch
root       5177    921  0 15:50 pts/0    00:00:00 grep --color=auto elasticsearch

[root@test101 init.d]#  netstat -tlunp|grep 9200
tcp6       0      0 :::9200                 :::*                    LISTEN      5157/java           
[root@test101 init.d]# 

4、日志和数据目录权限异常,启动失败

在一次启动elasticsearch的时候启动失败,日志有提示“main ERROR Unable to create file /home/elk/logs/my-application_index_indexing_slowlog.log java.io.IOException: 权限不够”和“Caused by: java.nio.file.AccessDeniedException: /home/elk/data/nodes”。关键日志信息如下(下面两段日志是节选的,日志信息太多了,有很多重复的):

[elk@docker bin]$ ./elasticsearch
2018-06-04 01:15:07,609 main ERROR Unable to create file /home/elk/logs/my-application.log java.io.IOException: 权限不够
        at java.io.UnixFileSystem.createFileExclusively(Native Method)
        at java.io.File.createNewFile(File.java:1012)

后面还有一段:

 Caused by: java.lang.IllegalStateException: Failed to create node environment
        at org.elasticsearch.node.Node.<init>(Node.java:268) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.node.Node.<init>(Node.java:245) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:233) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:233) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.0.jar:5.6.0]
        ... 6 more
Caused by: java.nio.file.AccessDeniedException: /home/elk/data/nodes
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:?]

日志报的“/home/elk/data/”和“/home/elk/logs/”目录都是在elasticsearch.yml配置文件里面配置的两个目录,查看权限果然不对,权限是elk的目录权限是elk,但是下面的data目录和logs目录权限还是root,因此引起了启动失败:

[root@docker home]# ll 
drwx------  5 elk    elk         125 6月   3 17:35 elk       #elk目录权限正常
[root@docker home]# cd elk/
[root@docker elk]# ll
总用量 0
drwxr-xr-x 2 root root 6 6月   3 17:34 data      #下面的data和logs目录还是root
drwxr-xr-x 2 root root 6 6月   3 17:34 logs

解决:

将目录权限修改成elk之后,启动就OK了

[root@docker elk]# chown elk:elk -R ./*
[root@docker elk]# ll
总用量 0
drwxr-xr-x 2 elk elk 6 6月   3 17:34 data
drwxr-xr-x 2 elk elk 6 6月   3 17:34 logs
[root@docker elk]# 

5、内存不够,启动失败

在一次使用虚拟机做实验的过程中启动elasticsearch遇到了这样的报错:

[elk@docker bin]$ ./elasticsearch
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 2060255232 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /usr/local/elasticsearch-5.6.0/bin/hs_err_pid2819.log

解决:

原因:
查看了 /usr/local/elasticsearch-5.6.0/bin/hs_err_pid1027.log日志文件,出现这样的报错,有两种可能:
1、系统进程数达到上限了,部署服务的时候/etc/security/limits.conf文件修改没有生效。
2、确实物理内存不够

解决:
通过命令查看系统限制:ulimit -a查看open files不够大,如果不够大,就尝试通过设大该值:

[root@docker ~]# ulimit -n
1024

果然是部属的时候修改的/etc/security/limits.conf文件没有生效。于是将机器reboot了一下,在查看就生效了:

[root@docker ~]# ulimit -n
65536

但是在启动的时候还是报同样的错,查看了一下内存,这个虚拟机的内存只有1G,那应该就是物理内存不够了。目前还剩下这么多:

[root@docker ~]# free -h
              total        used        free      shared  buff/cache   available
Mem:           974M        119M         79M        7.7M        775M        680M
Swap:          819M          0B        819M

手动清理了一下内存:

[root@docker ~]# echo 3 > /proc/sys/vm/drop_caches  
[root@docker ~]# free -h
              total        used        free      shared  buff/cache   available
Mem:           974M        114M        789M        7.7M         69M        739M
Swap:          819M          0B        819M
[root@docker ~]# 

但是在启动报错依旧。
于是增加物理内存到2G:

[root@docker elk]# free -h
              total        used        free      shared  buff/cache   available
Mem:           1.8G        1.6G         77M          4K         72M         29M
Swap:          819M        691M        128M

然后切换到elk用户去启动服务,就OK了:

[elk@docker bin]$ ./elasticsearch     #为了看启动日志就前台启动的,ctrl+c 进程就会over掉

检查端口,起来了

[root@docker elk]# netstat -tlunp|grep 9200
tcp6       0      0 10.0.0.16:9200          :::*                    LISTEN      9628/java           
[root@docker elk]# 

然后关掉进程重新后台启动:

[elk@docker bin]$ nohup ./elasticsearch >/dev/null 2>&1 &     #后台启动
[2] 9808
[elk@docker bin]$ ps -ef|grep elasticsearch   #检查进程
elk        9808   4115 10 01:29 pts/0    00:00:23 /usr/local/jdk1.8.0_151/bin/java -Xms2g -Xmx2g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -XX:+HeapDumpOnOutOfMemoryError -Des.path.home=/usr/local/elasticsearch-5.6.0 -cp /usr/local/elasticsearch-5.6.0/lib/* org.elasticsearch.bootstrap.Elasticsearch
elk        9890   4115  0 01:32 pts/0    00:00:00 grep --color=auto elasticsearch
[elk@docker bin]$ 
[root@docker elk]# netstat -tlunp|grep 9200    #用root用户检查端口
tcp6       0      0 10.0.0.16:9200          :::*                    LISTEN      9808/java           
[root@docker elk]# 

6、 elasticsearch.yml的bind的IP写错,服务起不来

在一次安装 elasticsearc的时候,服务起不来,提示“Failed to bind to [9300-9400]”。启动服务报下面的错误:


[elk@host1 bin]$ ./elasticsearch
[2018-06-15T09:56:53,019][INFO ][o.e.n.Node               ] [node1] initializing ...
[2018-06-15T09:56:53,141][INFO ][o.e.e.NodeEnvironment    ] [node1] using [1] data paths, mounts [[/data (/dev/mapper/data-data)]], net usable_space [179.8gb], net total_space [179.9gb], spins? [possibly], types [xfs]
[2018-06-15T09:56:53,142][INFO ][o.e.e.NodeEnvironment    ] [node1] heap size [1.9gb], compressed ordinary object pointers [true]
[2018-06-15T09:56:53,143][INFO ][o.e.n.Node               ] [node1] node name [node1], node ID [F0PzQ9qSRPWq8YNcwjj0vg]
[2018-06-15T09:56:53,144][INFO ][o.e.n.Node               ] [node1] version[5.6.0], pid[27627], build[781a835/2017-09-07T03:09:58.087Z], OS[Linux/3.10.0-514.el7.x86_64/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_102/25.102-b14]
[2018-06-15T09:56:53,144][INFO ][o.e.n.Node               ] [node1] JVM arguments [-Xms2g, -Xmx2g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djdk.io.permissionsUseCanonicalPath=true, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j.skipJansi=true, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/usr/local/elasticsearch-5.6.0]
[2018-06-15T09:56:54,161][INFO ][o.e.p.PluginsService     ] [node1] loaded module [aggs-matrix-stats]
[2018-06-15T09:56:54,162][INFO ][o.e.p.PluginsService     ] [node1] loaded module [ingest-common]
[2018-06-15T09:56:54,162][INFO ][o.e.p.PluginsService     ] [node1] loaded module [lang-expression]
[2018-06-15T09:56:54,162][INFO ][o.e.p.PluginsService     ] [node1] loaded module [lang-groovy]
[2018-06-15T09:56:54,162][INFO ][o.e.p.PluginsService     ] [node1] loaded module [lang-mustache]
[2018-06-15T09:56:54,162][INFO ][o.e.p.PluginsService     ] [node1] loaded module [lang-painless]
[2018-06-15T09:56:54,163][INFO ][o.e.p.PluginsService     ] [node1] loaded module [parent-join]
[2018-06-15T09:56:54,163][INFO ][o.e.p.PluginsService     ] [node1] loaded module [percolator]
[2018-06-15T09:56:54,163][INFO ][o.e.p.PluginsService     ] [node1] loaded module [reindex]
[2018-06-15T09:56:54,163][INFO ][o.e.p.PluginsService     ] [node1] loaded module [transport-netty3]
[2018-06-15T09:56:54,163][INFO ][o.e.p.PluginsService     ] [node1] loaded module [transport-netty4]
[2018-06-15T09:56:54,164][INFO ][o.e.p.PluginsService     ] [node1] no plugins loaded
[2018-06-15T09:56:55,941][INFO ][o.e.d.DiscoveryModule    ] [node1] using discovery type [zen]
[2018-06-15T09:56:56,770][INFO ][o.e.n.Node               ] [node1] initialized
[2018-06-15T09:56:56,770][INFO ][o.e.n.Node               ] [node1] starting ...
[2018-06-15T09:56:57,059][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [node1] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: BindTransportException[Failed to bind to [9300-9400]]; nested: BindException[Cannot assign requested address];
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.6.0.jar:5.6.0]
Caused by: org.elasticsearch.transport.BindTransportException: Failed to bind to [9300-9400]
        at org.elasticsearch.transport.TcpTransport.bindToPort(TcpTransport.java:771) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.transport.TcpTransport.bindServer(TcpTransport.java:736) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.transport.netty4.Netty4Transport.doStart(Netty4Transport.java:173) ~[?:?]
        at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:69) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.transport.TransportService.doStart(TransportService.java:209) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:69) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.node.Node.start(Node.java:694) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:278) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:351) ~[elasticsearch-5.6.0.jar:5.6.0]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.0.jar:5.6.0]
        ... 6 more
Caused by: java.net.BindException: Cannot assign requested address
        at sun.nio.ch.Net.bind0(Native Method) ~[?:?]
        at sun.nio.ch.Net.bind(Net.java:433) ~[?:?]
        at sun.nio.ch.Net.bind(Net.java:425) ~[?:?]
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[?:?]
        at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:128) ~[?:?]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:554) ~[?:?]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1258) ~[?:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:501) ~[?:?]
        at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:486) ~[?:?]
        at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:980) ~[?:?]
        at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:250) ~[?:?]
        at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:365) ~[?:?]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[?:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403) ~[?:?]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462) ~[?:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) ~[?:?]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_102]
[2018-06-15T09:56:57,822][INFO ][o.e.n.Node               ] [node1] stopping ...
[2018-06-15T09:56:57,826][INFO ][o.e.n.Node               ] [node1] stopped
[2018-06-15T09:56:57,826][INFO ][o.e.n.Node               ] [node1] closing ...
[2018-06-15T09:56:57,839][INFO ][o.e.n.Node               ] [node1] closed
[elk@host1 bin]$ 
[elk@host1 bin]$ 


[root@host1 bin]# netstat -tlunp|grep 9300
[root@host1 bin]# netstat -tlunp|grep 9200
[root@host1 bin]#

解决:

开始以为是端口被占用了,检查端口,发现并没有被占用:

[root@host1 bin]# netstat -tlunp|grep 9300
[root@host1 bin]# netstat -tlunp|grep 9200
[root@host1 bin]#

然后检查配置,发现 elasticsearch.yml文件里面有一行的IP写错了:

network.host: 10.0.0.10   #这一行的IP地址写错了,不是本机IP

修改elasticsearch.yml文件,将IP改正确,重新启动服务,就OK了

7、配置文件elasticsearch.yml的权限异常,导致启动失败

有一次在安装elasticsearch的时候,因为elasticsearch.yml文件改得有问题,就从原来备份的elasticsearch.yml.bak文件cp重新生成了一份elasticsearch.yml,改好之后启动报错不能加载配置文件:

[elk@es bin]$ ./elasticsearch
Exception in thread "main" 2018-09-14 09:04:49,470 main ERROR No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging.
SettingsException[Failed to load settings from /usr/local/elasticsearch-5.6.0/config/elasticsearch.yml]; nested: AccessDeniedException[/usr/local/elasticsearch-5.6.0/config/elasticsearch.yml];
	at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:102)
	at org.elasticsearch.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:72)
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67)
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134)
	at org.elasticsearch.cli.Command.main(Command.java:90)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84)
Caused by: java.nio.file.AccessDeniedException: /usr/local/elasticsearch-5.6.0/config/elasticsearch.yml
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
	at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
	at java.nio.file.Files.newByteChannel(Files.java:361)
	at java.nio.file.Files.newByteChannel(Files.java:407)
	at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
	at java.nio.file.Files.newInputStream(Files.java:152)
	at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1032)
	at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:100)
	... 6 more
[elk@es bin]$ 

原来新生成的配置文件elasticsearch.yml还是root权限,用elk用户去启动,当然加载不了:

[root@es config]# ll
total 20
-rw-r----- 1 root root 2961 Sep 14 09:04 elasticsearch.yml
-rw-r----- 1 elk  elk  2854 Sep 14 08:49 elasticsearch.yml.bak
-rw-rw---- 1 elk  elk  3064 Sep  7  2017 jvm.options
-rw-rw---- 1 elk  elk  4456 Sep  7  2017 log4j2.properties
[root@es config]# 

解决:

修改配置文件elasticsearch.yml的权限,再重新启动就好了:

[root@es config]# chown elk:elk elasticsearch.yml
[root@es config]# ll
total 20
-rw-r----- 1 elk elk 2961 Sep 14 09:04 elasticsearch.yml
-rw-r----- 1 elk elk 2854 Sep 14 08:49 elasticsearch.yml.bak
-rw-rw---- 1 elk elk 3064 Sep  7  2017 jvm.options
-rw-rw---- 1 elk elk 4456 Sep  7  2017 log4j2.properties
[root@es config]# 

8、yum安装的elasticsearch,找不到java路径,启动失败

今天使用yum安装elasticsearch的过程中,发现elasticsearch起不来,messages日志有如下的报错:

May 31 14:00:19 test103 systemd: Started Elasticsearch.
May 31 14:00:19 test103 systemd: Starting Elasticsearch...
May 31 14:00:19 test103 elasticsearch: which: no java in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin)   #elasticsearch在这个路径下面去找java,没有找到
May 31 14:00:19 test103 systemd: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
May 31 14:00:19 test103 elasticsearch: warning: Falling back to java on path. This behavior is deprecated. Specify JAVA_HOME
May 31 14:00:19 test103 elasticsearch: could not find java; set JAVA_HOME
May 31 14:00:19 test103 systemd: Unit elasticsearch.service entered failed state.
May 31 14:00:19 test103 systemd: elasticsearch.service failed.

报错说找不到java,但是实际上我是安装过jdk了,查看当前java路径为:

[root@test103 ~]# whereis java
java: /usr/local/jdk1.8.0_151/bin/java
[root@test103 ~]# 

然后查看/usr/local/sbin/目录下没有java,所以elasticsearch在启动的时候找不到java路径。

解决:

把/usr/local/jdk1.8.0_151/bin/java做了个软连接到 /usr/local/sbin下面:

[root@test103 sbin]# ln -s /usr/local/jdk1.8.0_151/bin/java /usr/local/sbin/java
[root@test103 sbin]# ll
总用量 0
lrwxrwxrwx 1 root root 32 5月  31 14:01 java -> /usr/local/jdk1.8.0_151/bin/java

现在查看java路径,就有/usr/local/sbin/java了:

[root@test103 sbin]# whereis java
java: /usr/local/sbin/java /usr/local/jdk1.8.0_151/bin/java
[root@test103 sbin]# 

然后重新启动elasticsearch,发现就可以正常启动了:

[root@test103 sbin]# systemctl start elasticsearch
[root@test103 sbin]# ps -ef|grep elasticsearch
elastic+  13635      1 70 14:02 ?        00:00:12 /usr/local/sbin/java -Xms1g -Xmx1g -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 -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.io.tmpdir=/tmp/elasticsearch-7859403592413850651 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/lib/elasticsearch -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/var/log/elasticsearch/gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=32 -XX:GCLogFileSize=64m -Des.path.home=/usr/share/elasticsearch -Des.path.conf=/etc/elasticsearch -Des.distribution.flavor=default -Des.distribution.type=rpm -cp /usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -p /var/run/elasticsearch/elasticsearch.pid --quiet
elastic+  13692  13635  0 14:02 ?        00:00:00 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller
root      13698  10140  0 14:02 pts/0    00:00:00 grep --color=auto elasticsearch

[root@test103 sbin]# netstat -tlunp|grep 9300
tcp6       0      0 10.0.0.103:9300         :::*                    LISTEN      13635/java          
[root@test103 sbin]# netstat -tlunp|grep 9200
tcp6       0      0 10.0.0.103:9200         :::*                    LISTEN      13635/java          
[root@test103 sbin]# 

更多链接:《升级Elasticsearch到8.7.1版本,我给自己挖了很多坑…》

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/371856.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

16-Verilog实现二线制I2C CMOS串行EEPROM的读写操作

Verilog实现二线制I2C CMOS串行EEPROM的读写操作 1&#xff0c;二线制I2C CMOS串行EEPROM的简单介绍2&#xff0c;I2C总线特征介绍3&#xff0c;二线制I2C、CMOS串行EEPROM的读写操作4&#xff0c;EEPROM的Verilog HDL程序4.1&#xff0c;EEPROM的行为模型思路如下&#xff1a;…

Jmeter性能测试: Jmeter 5.6.3 分布式部署

目录 一、实验 1.环境 2.jmeter 配置 slave 代理压测机 3.jmeter配置master控制器压测机 4.启动slave从节点检查 5.启动master主节点检查 6.运行jmeter 7.观察jmeter-server主从节点变化 二、问题 1.jmeter 中间请求和响应乱码 一、实验 1.环境 &#xff08;1&#…

kubesphere部署k8s-v1.23.10

功能&#xff1a; &#x1f578; 部署 Kubernetes 集群 &#x1f517; Kubernetes 多集群管理 &#x1f916; Kubernetes DevOps &#x1f50e; 云原生可观测性 &#x1f9e9; 基于 Istio 的微服务治理 &#x1f4bb; 应用商店 &#x1f4a1; Kubernetes 边缘节点管理 &#x1…

[职场] 财务共享是什么 #笔记#笔记#知识分享

财务共享是什么 财务共享作为一种创新的财务管理模式&#xff0c;已经得到了我国众多企业的认可和实践。通过实施财务共享&#xff0c;企业可以有效提高财务管理效率&#xff0c;降低成本&#xff0c;优化资源配置&#xff0c;从而为企业的可持续发展提供有力保障。本文会进行…

myql 项目数据库和表的设计

1.表的设计和创建 2.在navicate运行这些代码 create table user(id int not null auto_increment primary key,name varchar(50) not null unique,password varchar(50) not null,state enum(online,offline) default offline ); create table friend(userid int not null,…

操作系统基础:文件系统基础【下】

&#x1f308;个人主页&#xff1a;godspeed_lucip &#x1f525; 系列专栏&#xff1a;OS从基础到进阶 ⚔️1 文件的基本操作⚖️1.1 总览⚖️1.2 几种基本操作&#x1f52d;1.2.1 创建文件&#x1f52d;1.2.2 删除文件&#x1f52d;1.2.3 打开文件&#x1f52d;1.2.4 关闭文件…

mysql:事务的特性ACID、并发事务(脏读、不可重复读、幻读、如何解决、隔离级别)、undo log和redo log的区别、相关面试题和答案

事务是一组操作的集合&#xff0c;它会把所有的操作作为一个整体一起向系统提交或撤销操作请求&#xff0c;即这些操作要么同时成功&#xff0c;要么同时失败。 事务的特性&#xff08;ACID&#xff09; 原子性&#xff08;Atomicity&#xff09;&#xff1a;事务是不可分割的…

React16源码: React中处理hydrate的核心流程源码实现

hydrate 1 &#xff09;概述 hydrate 在react当中不算特别重要, 但是很多时候会用到的一个API这个 API 它主要作用就是在进入第一次渲染的时候&#xff0c;如果本身 dom 树上面已经有一个dom结构存在是否可以去利用这一部分已经存在的dom&#xff0c;然后去避免掉在第一次渲染…

2024/2/4 备战蓝桥杯 5-1 前缀和

目录 求和 0求和 - 蓝桥云课 (lanqiao.cn) 可获得的最小取值 0可获得的最小取值 - 蓝桥云课 (lanqiao.cn) 领地选择 P2004 领地选择 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 求和 0求和 - 蓝桥云课 (lanqiao.cn) 思路&#xff1a;先对公式进行合并同类相&#x…

浅压缩、深压缩、双引擎、计算机屏幕编码……何去何从?

专业视听领域尤其显示控制和坐席控制领域&#xff0c;最近几年最激动人心的技术&#xff0c;莫过于分布式了。 分布式从推出之日就备受关注&#xff1a;担心稳定性的&#xff0c;质疑同步性能的&#xff0c;怀疑画面质量的…… 诚然&#xff0c;我们在此前见多了带着马赛克的…

windows安装Visual Studio Code,配置C/C++运行环境(亲测可行)

一.下载 Visual Studio Code https://code.visualstudio.com/ 二.安装 选择想要安装的位置: 后面的点击下一步即可。 三.下载编译器MinGW vscode只是写代码的工具&#xff0c;使用编译器才能编译写的C/C程序&#xff0c;将它转为可执行文件。 MinGW下载链接&#xff1a;…

day31 JS执行机制

目录 前言同步和异步JS执行机制 前言 JavaScript语言的一大特点是单线程。 JavaScript是为处理页面中用户的交互&#xff0c;以及操作DOM而诞生的。比如对某个DOM元素进行添加和删除操作&#xff0c;不能同时进行&#xff0c;应该先进行添加再继续删除。 示例&#xff08;解…

【日常总结】SourceTree 1.5.2.0 更换用户名称和密码

一、场景 二、问题 三、解决方案 > 方案一&#xff1a;删除缓存文件 > 方案二&#xff1a;更新最新版本&#xff0c;可以直接修改密码&#xff08;推荐&#xff09; 方案一&#xff1a;删除缓存文件 Stage 1&#xff1a;设置显示隐藏文件 Stage 2&#xff1a;打开…

基于时频分析的SAR目标微波视觉特性智能感知方法与应用

源自&#xff1a;雷达学报 作者&#xff1a;黄钟泠, 吴冲, 姚西文 “人工智能技术与咨询” 发布 摘 要 合成孔径雷达(SAR)目标识别智能算法目前仍面临缺少鲁棒性、泛化性和可解释性的挑战&#xff0c;理解SAR目标微波特性并将其结合先进的深度学习算法&#xff0c;实现高效…

Springboot写一个对接钉钉机器人的小插件

钉钉机器人 有时候我门需要监控各种事件&#xff0c;需要机器人给我发给提醒 如&#xff1a;git代码交接&#xff0c;代码合并&#xff0c; 服务器异常捕获&#xff0c;。。。。 参照钉钉给我们的开发文档&#xff0c;可以发现对接起来是非常简单哈哈 这是我写的小插件以及例子…

内衣迷你洗衣机什么牌子好?口碑最好的小型洗衣机推荐

随着人们的生活水平的提升&#xff0c;越来越多小伙伴来开始追求更高的生活水平&#xff0c;一些智能化的小家电就被发明出来&#xff0c;而且内衣洗衣机是其中一个。现在通过内衣裤感染到细菌真的是越来越多&#xff0c;所以我们对内衣裤的清洗频次会高于普通衣服&#xff0c;…

大数据知识图谱之深度学习——基于BERT+LSTM+CRF深度学习识别模型医疗知识图谱问答可视化系统

文章目录 大数据知识图谱之深度学习——基于BERTLSTMCRF深度学习识别模型医疗知识图谱问答可视化系统一、项目概述二、系统实现基本流程三、项目工具所用的版本号四、所需要软件的安装和使用五、开发技术简介Django技术介绍Neo4j数据库Bootstrap4框架Echarts简介Navicat Premiu…

【开源】JAVA+Vue+SpringBoot实现二手车交易系统

目录 一、摘要1.1 项目介绍1.2 项目录屏 二、功能模块2.1 数据中心模块2.2 二手车档案管理模块2.3 车辆预约管理模块2.4 车辆预定管理模块2.5 车辆留言板管理模块2.6 车辆资讯管理模块 三、系统设计3.1 E-R图设计3.2 可行性分析3.2.1 技术可行性分析3.2.2 操作可行性3.2.3 经济…

【【制作100个unity游戏之24】unity制作一个3D动物AI生态系统游戏(附项目源码)

最终效果 文章目录 最终效果前言导入AI导航系统导航烘培添加羊添加捕食者动画控制随着地面法线旋转在地形上随机生成动物不同部位颜色不同最终效果源码完结前言 欢迎来到【制作100个Unity游戏】系列!本系列将引导您一步步学习如何使用Unity开发各种类型的游戏。在这第24篇中,…

windows10 利用DDNS-GO解析IPV6 IPV4 阿里云 腾讯云 华为云

这里写目录标题 [工具包DDNS-GO Windows 版](https://github.com/jeessy2/ddns-go/releases)创建ddns-go windows服务打开浏览器 输入127.0.0.1:9876 就可以使用ddns-go解析ipv4 或者 IPV6 了创建的服务已经在windows的服务管理里面自动启动了 工具包DDNS-GO Windows 版 创建dd…