vieyahn2017 / iBlog

44 stars 0 forks source link

3.22 Elasticsearch安装使用 #258

Closed vieyahn2017 closed 5 years ago

vieyahn2017 commented 5 years ago

at home

vieyahn2017 commented 5 years ago

https://www.elastic.co/downloads/elasticsearch

vieyahn2017 commented 5 years ago

进入elasticsearch/bin下运行elasticsearch脚本启动

cd elasticsearch/bin
    ./elasticsearch

如果是用root启动,需要继续下面步骤 如果是用root账号启动,会报以下错误

Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root.
        at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:93)
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:144)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
        Refer to the log for complete error details.

这是出于系统安全考虑设置的条件。由于ElasticSearch可以接收用户输入的脚本并且执行,为了系统安全考虑, 建议创建一个单独的用户用来运行ElasticSearch

# 创建elsearch用户组及elsearch用户
groupadd elsearch
useradd elsearch -g elsearch -p elasticsearch

# 更改elasticsearch文件夹及内部文件的所属用户及组为elsearch:elsearch
cd /opt
chown -R elsearch:elsearch  elasticsearch

# 切换到elsearch用户再启动
su elsearch cd elasticsearch/bin
./elasticsearch

ElasticSearch后端启动命令

./elasticsearch -d
vieyahn2017 commented 5 years ago

vi elasticsearch.yml

cluster.name: mycluster1
node.name: node1

访问
curl http://localhost:9200/

{
  "name" : "node1",
  "cluster_name" : "mycluster1",
  "cluster_uuid" : "EGKmsMEoRBO8s3s-sS6IWA",
  "version" : {
    "number" : "6.6.2",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "3bd3e59",
    "build_date" : "2019-03-06T15:16:26.864148Z",
    "build_snapshot" : false,
    "lucene_version" : "7.6.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}
vieyahn2017 commented 5 years ago

测试使用:

curl -X POST 'http://localhost:9200/tutorial/helloworld/1' -d '{ "message": "Hello World!" }'

问题: elasticsearch6.x {“error”:”Content-Type header [application/x-www-form-urlencoded] is not supported”

描述:

curl -XPOST 192.168.14.173:32000/test_index_1221/test_type/5 -d '{'user_name':"xiaoming"}'

响应报错:

{
    "error":"Content-Type header [application/x-www-form-urlencoded] is not supported",
    "status":406  
}

官方改变: https://www.elastic.co/blog/strict-content-type-checking-for-elasticsearch-rest-requests

解决方法:

curl -H "Content-Type: application/json" -XPOST 192.168.14.173:32000/test_index_1221/test_type/5 -d '{'user_name':"xiaoming"}'
vieyahn2017 commented 5 years ago
curl -H "Content-Type: application/json" -XPOST 'http://localhost:9200/mytest/test/1' -d '{ "message": "Hello World!" }'

响应:

{"_index":"mytest","_type":"test","_id":"1","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":0,"_primary_term":1}

查看:

curl -X GET 'http://localhost:9200/mytest/test/2'

您可能已经注意到上述请求中的额外参数pretty。它支持可读的格式,因此您可以在新行上写入每个数据字段。您还可以在检索数据时“美化”您的结果并获得更好的输出,如下所示:

curl -X GET 'http://localhost:9200/mytest/test/2?pretty'
vieyahn2017 commented 5 years ago

启动日志

elsearch@localhost:/home/hw/elasticsearch-6.6.2/bin$ ./elasticsearch
[2019-03-22T10:38:31,911][INFO ][o.e.e.NodeEnvironment    ] [t0AtFEo] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [25.1gb], net total_space [47.6gb], types [rootfs]
[2019-03-22T10:38:31,954][INFO ][o.e.e.NodeEnvironment    ] [t0AtFEo] heap size [1015.6mb], compressed ordinary object pointers [true]
[2019-03-22T10:38:31,966][INFO ][o.e.n.Node               ] [t0AtFEo] node name derived from node ID [t0AtFEoJSaSwGKlnqi8sJg]; set [node.name] to override
[2019-03-22T10:38:31,967][INFO ][o.e.n.Node               ] [t0AtFEo] version[6.6.2], pid[5738], build[default/tar/3bd3e59/2019-03-06T15:16:26.864148Z], OS[Linux/3.16.0-30-generic/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_91/25.91-b14]
[2019-03-22T10:38:31,967][INFO ][o.e.n.Node               ] [t0AtFEo] JVM arguments [-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-8761621912942661906, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/home/huawei/elasticsearch-6.6.2, -Des.path.conf=/home/huawei/elasticsearch-6.6.2/config, -Des.distribution.flavor=default, -Des.distribution.type=tar]
[2019-03-22T10:38:40,569][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [aggs-matrix-stats]
[2019-03-22T10:38:40,569][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [analysis-common]
[2019-03-22T10:38:40,570][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [ingest-common]
[2019-03-22T10:38:40,571][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [lang-expression]
[2019-03-22T10:38:40,571][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [lang-mustache]
[2019-03-22T10:38:40,573][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [lang-painless]
[2019-03-22T10:38:40,573][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [mapper-extras]
[2019-03-22T10:38:40,573][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [parent-join]
[2019-03-22T10:38:40,574][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [percolator]
[2019-03-22T10:38:40,574][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [rank-eval]
[2019-03-22T10:38:40,575][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [reindex]
[2019-03-22T10:38:40,575][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [repository-url]
[2019-03-22T10:38:40,576][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [transport-netty4]
[2019-03-22T10:38:40,576][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [tribe]
[2019-03-22T10:38:40,576][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [x-pack-ccr]
[2019-03-22T10:38:40,577][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [x-pack-core]
[2019-03-22T10:38:40,577][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [x-pack-deprecation]
[2019-03-22T10:38:40,577][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [x-pack-graph]
[2019-03-22T10:38:40,578][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [x-pack-ilm]
[2019-03-22T10:38:40,578][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [x-pack-logstash]
[2019-03-22T10:38:40,578][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [x-pack-ml]
[2019-03-22T10:38:40,578][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [x-pack-monitoring]
[2019-03-22T10:38:40,579][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [x-pack-rollup]
[2019-03-22T10:38:40,579][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [x-pack-security]
[2019-03-22T10:38:40,580][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [x-pack-sql]
[2019-03-22T10:38:40,583][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [x-pack-upgrade]
[2019-03-22T10:38:40,583][INFO ][o.e.p.PluginsService     ] [t0AtFEo] loaded module [x-pack-watcher]
[2019-03-22T10:38:40,589][INFO ][o.e.p.PluginsService     ] [t0AtFEo] no plugins loaded
[2019-03-22T10:38:57,259][INFO ][o.e.x.s.a.s.FileRolesStore] [t0AtFEo] parsed [0] roles from file [/home/huawei/elasticsearch-6.6.2/config/roles.yml]
[2019-03-22T10:39:00,192][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [t0AtFEo] [controller/5795] [Main.cc@109] controller (64 bit): Version 6.6.2 (Build 62531230b275d3) Copyright (c) 2019 Elasticsearch BV
[2019-03-22T10:39:02,579][DEBUG][o.e.a.ActionModule       ] [t0AtFEo] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2019-03-22T10:39:03,623][INFO ][o.e.d.DiscoveryModule    ] [t0AtFEo] using discovery type [zen] and host providers [settings]
[2019-03-22T10:39:07,082][INFO ][o.e.n.Node               ] [t0AtFEo] initialized
[2019-03-22T10:39:07,086][INFO ][o.e.n.Node               ] [t0AtFEo] starting ...
[2019-03-22T10:39:07,878][INFO ][o.e.t.TransportService   ] [t0AtFEo] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
[2019-03-22T10:39:07,952][WARN ][o.e.b.BootstrapChecks    ] [t0AtFEo] max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2019-03-22T10:39:07,957][WARN ][o.e.b.BootstrapChecks    ] [t0AtFEo] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2019-03-22T10:39:11,160][INFO ][o.e.c.s.MasterService    ] [t0AtFEo] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {t0AtFEo}{t0AtFEoJSaSwGKlnqi8sJg}{YwzD8l_JR92HU7lJP5KN_Q}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=2091634688, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}
[2019-03-22T10:39:11,184][INFO ][o.e.c.s.ClusterApplierService] [t0AtFEo] new_master {t0AtFEo}{t0AtFEoJSaSwGKlnqi8sJg}{YwzD8l_JR92HU7lJP5KN_Q}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=2091634688, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {t0AtFEo}{t0AtFEoJSaSwGKlnqi8sJg}{YwzD8l_JR92HU7lJP5KN_Q}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=2091634688, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[2019-03-22T10:39:11,465][INFO ][o.e.h.n.Netty4HttpServerTransport] [t0AtFEo] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[2019-03-22T10:39:11,465][INFO ][o.e.n.Node               ] [t0AtFEo] started
[2019-03-22T10:39:11,485][WARN ][o.e.x.s.a.s.m.NativeRoleMappingStore] [t0AtFEo] Failed to clear cache for realms [[]]
[2019-03-22T10:39:11,709][INFO ][o.e.g.GatewayService     ] [t0AtFEo] recovered [0] indices into cluster_state
[2019-03-22T10:39:13,675][INFO ][o.e.c.m.MetaDataIndexTemplateService] [t0AtFEo] adding template [.watch-history-9] for index patterns [.watcher-history-9*]
[2019-03-22T10:39:13,797][INFO ][o.e.c.m.MetaDataIndexTemplateService] [t0AtFEo] adding template [.watches] for index patterns [.watches*]
[2019-03-22T10:39:13,901][INFO ][o.e.c.m.MetaDataIndexTemplateService] [t0AtFEo] adding template [.triggered_watches] for index patterns [.triggered_watches*]
[2019-03-22T10:39:14,032][INFO ][o.e.c.m.MetaDataIndexTemplateService] [t0AtFEo] adding template [.monitoring-logstash] for index patterns [.monitoring-logstash-6-*]
[2019-03-22T10:39:14,168][INFO ][o.e.c.m.MetaDataIndexTemplateService] [t0AtFEo] adding template [.monitoring-es] for index patterns [.monitoring-es-6-*]
[2019-03-22T10:39:14,281][INFO ][o.e.c.m.MetaDataIndexTemplateService] [t0AtFEo] adding template [.monitoring-beats] for index patterns [.monitoring-beats-6-*]
[2019-03-22T10:39:14,381][INFO ][o.e.c.m.MetaDataIndexTemplateService] [t0AtFEo] adding template [.monitoring-alerts] for index patterns [.monitoring-alerts-6]
[2019-03-22T10:39:14,475][INFO ][o.e.c.m.MetaDataIndexTemplateService] [t0AtFEo] adding template [.monitoring-kibana] for index patterns [.monitoring-kibana-6-*]
[2019-03-22T10:39:14,759][INFO ][o.e.l.LicenseService     ] [t0AtFEo] license [5196fb1a-4296-4b4c-bad7-d8a19b169db0] mode [basic] - valid
vieyahn2017 commented 5 years ago

使用日志


[2019-03-22T10:52:17,370][INFO ][o.e.x.s.a.s.FileRolesStore] [node1] parsed [0] roles from file [/home/huawei/elasticsearch-6.6.2/config/roles.yml]
[2019-03-22T10:52:19,172][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [node1] [controller/6164] [Main.cc@109] controller (64 bit): Version 6.6.2 (Build 62531230b275d3) Copyright (c) 2019 Elasticsearch BV
[2019-03-22T10:52:20,784][DEBUG][o.e.a.ActionModule       ] [node1] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2019-03-22T10:52:21,572][INFO ][o.e.d.DiscoveryModule    ] [node1] using discovery type [zen] and host providers [settings]
[2019-03-22T10:52:24,144][INFO ][o.e.n.Node               ] [node1] initialized
[2019-03-22T10:52:24,145][INFO ][o.e.n.Node               ] [node1] starting ...
[2019-03-22T10:52:24,751][INFO ][o.e.t.TransportService   ] [node1] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
[2019-03-22T10:52:24,932][WARN ][o.e.b.BootstrapChecks    ] [node1] max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2019-03-22T10:52:24,937][WARN ][o.e.b.BootstrapChecks    ] [node1] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2019-03-22T10:52:28,089][INFO ][o.e.c.s.MasterService    ] [node1] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {node1}{t0AtFEoJSaSwGKlnqi8sJg}{am92Ae-STnijUtCHXDIAbA}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=2091634688, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}
[2019-03-22T10:52:28,136][INFO ][o.e.c.s.ClusterApplierService] [node1] new_master {node1}{t0AtFEoJSaSwGKlnqi8sJg}{am92Ae-STnijUtCHXDIAbA}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=2091634688, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {node1}{t0AtFEoJSaSwGKlnqi8sJg}{am92Ae-STnijUtCHXDIAbA}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=2091634688, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[2019-03-22T10:52:28,343][INFO ][o.e.h.n.Netty4HttpServerTransport] [node1] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[2019-03-22T10:52:28,344][INFO ][o.e.n.Node               ] [node1] started
[2019-03-22T10:52:29,409][WARN ][o.e.x.s.a.s.m.NativeRoleMappingStore] [node1] Failed to clear cache for realms [[]]
[2019-03-22T10:52:29,627][INFO ][o.e.l.LicenseService     ] [node1] license [5196fb1a-4296-4b4c-bad7-d8a19b169db0] mode [basic] - valid
[2019-03-22T10:52:29,692][INFO ][o.e.g.GatewayService     ] [node1] recovered [0] indices into cluster_state
[2019-03-22T11:24:26,118][INFO ][o.e.c.m.MetaDataCreateIndexService] [node1] [mytest] creating index, cause [auto(bulk api)], templates [], shards [5]/[1], mappings []
[2019-03-22T11:24:31,603][WARN ][o.e.m.j.JvmGcMonitorService] [node1] [gc][young][1911][33] duration [4.6s], collections [1]/[5s], total [4.6s]/[6.3s], memory [128.1mb]->[94.3mb]/[1015.6mb], all_pools {[young] [64.3mb]->[339.2kb]/[66.5mb]}{[survivor] [6.6mb]->[3mb]/[8.3mb]}{[old] [57.1mb]->[90.9mb]/[940.8mb]}
[2019-03-22T11:24:31,611][WARN ][o.e.m.j.JvmGcMonitorService] [node1] [gc][1911] overhead, spent [4.6s] collecting in the last [5s]
[2019-03-22T11:24:35,171][INFO ][o.e.c.m.MetaDataMappingService] [node1] [mytest/KhfVJ4zkQLuPojjejsmtcg] create_mapping [test]
vieyahn2017 commented 5 years ago

权限不够报错的日志:

2019-03-22 10:34:45,049 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:235)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:135)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
    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:116)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)

2019-03-22 10:34:45,075 main ERROR RollingFileManager (/home/hh/elasticsearch-6.6.2/logs/elasticsearch_deprecation.log) java.io.FileNotFoundException: /home/hh/elasticsearch-6.6.2/logs/elasticsearch_deprecation.log (权限不够) java.io.FileNotFoundException: /home/hh/elasticsearch-6.6.2/logs/elasticsearch_deprecation.log (权限不够)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:133)
    at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:640)
    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:114)
    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:145)
    at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:61)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:123)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
    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:116)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)

2019-03-22 10:34:45,098 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@7ab802f4] unable to create manager for [/home/hh/elasticsearch-6.6.2/logs/elasticsearch_deprecation.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@72ce812e[pattern=/home/hh/elasticsearch-6.6.2/logs/elasticsearch_deprecation-%i.log.gz, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[SizeBasedTriggeringPolicy(size=1073741824)]), strategy=DefaultRolloverStrategy(min=1, max=4, useMax=true), advertiseURI=null, layout=[%d{ISO8601}][%-5p][%-25c{1.}] [%node_name]%marker %.-10000m%n, filePermissions=null, fileOwner=null]] java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@7ab802f4] unable to create manager for [/home/hh/elasticsearch-6.6.2/logs/elasticsearch_deprecation.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@72ce812e[pattern=/home/hh/elasticsearch-6.6.2/logs/elasticsearch_deprecation-%i.log.gz, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[SizeBasedTriggeringPolicy(size=1073741824)]), strategy=DefaultRolloverStrategy(min=1, max=4, useMax=true), advertiseURI=null, layout=[%d{ISO8601}][%-5p][%-25c{1.}] [%node_name]%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:114)
    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:145)
    at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:61)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:123)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
    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:116)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)

2019-03-22 10:34:45,100 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:235)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:135)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
    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:116)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)

2019-03-22 10:34:45,105 main ERROR RollingFileManager (/home/hh/elasticsearch-6.6.2/logs/elasticsearch_index_search_slowlog.log) java.io.FileNotFoundException: /home/hh/elasticsearch-6.6.2/logs/elasticsearch_index_search_slowlog.log (权限不够) java.io.FileNotFoundException: /home/hh/elasticsearch-6.6.2/logs/elasticsearch_index_search_slowlog.log (权限不够)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:133)
    at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:640)
    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:114)
    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:145)
    at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:61)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:123)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
    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:116)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)

2019-03-22 10:34:45,130 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@7ab802f4] unable to create manager for [/home/hh/elasticsearch-6.6.2/logs/elasticsearch_index_search_slowlog.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@5fed9976[pattern=/home/hh/elasticsearch-6.6.2/logs/elasticsearch_index_search_slowlog-%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] [%node_name]%marker %.-10000m%n, filePermissions=null, fileOwner=null]] java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@7ab802f4] unable to create manager for [/home/hh/elasticsearch-6.6.2/logs/elasticsearch_index_search_slowlog.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@5fed9976[pattern=/home/hh/elasticsearch-6.6.2/logs/elasticsearch_index_search_slowlog-%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] [%node_name]%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:114)
    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:145)
    at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:61)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:123)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
    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:116)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)

2019-03-22 10:34:45,136 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:235)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:135)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
    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:116)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)

2019-03-22 10:34:45,159 main ERROR RollingFileManager (/home/hh/elasticsearch-6.6.2/logs/elasticsearch_index_indexing_slowlog.log) java.io.FileNotFoundException: /home/hh/elasticsearch-6.6.2/logs/elasticsearch_index_indexing_slowlog.log (权限不够) java.io.FileNotFoundException: /home/hh/elasticsearch-6.6.2/logs/elasticsearch_index_indexing_slowlog.log (权限不够)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:133)
    at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:640)
    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:114)
    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:145)
    at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:61)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:123)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
    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:116)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)

2019-03-22 10:34:45,162 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@7ab802f4] unable to create manager for [/home/hh/elasticsearch-6.6.2/logs/elasticsearch_index_indexing_slowlog.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@4017fe2c[pattern=/home/hh/elasticsearch-6.6.2/logs/elasticsearch_index_indexing_slowlog-%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] [%node_name]%marker %.-10000m%n, filePermissions=null, fileOwner=null]] java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@7ab802f4] unable to create manager for [/home/hh/elasticsearch-6.6.2/logs/elasticsearch_index_indexing_slowlog.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@4017fe2c[pattern=/home/hh/elasticsearch-6.6.2/logs/elasticsearch_index_indexing_slowlog-%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] [%node_name]%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:114)
    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:145)
    at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:61)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:123)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
    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:116)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)

2019-03-22 10:34:45,163 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:235)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:135)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
    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:116)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)

2019-03-22 10:34:45,175 main ERROR RollingFileManager (/home/hh/elasticsearch-6.6.2/logs/elasticsearch_access.log) java.io.FileNotFoundException: /home/hh/elasticsearch-6.6.2/logs/elasticsearch_access.log (权限不够) java.io.FileNotFoundException: /home/hh/elasticsearch-6.6.2/logs/elasticsearch_access.log (权限不够)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:133)
    at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:640)
    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:114)
    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:145)
    at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:61)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:123)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
    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:116)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)

2019-03-22 10:34:45,183 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@7ab802f4] unable to create manager for [/home/hh/elasticsearch-6.6.2/logs/elasticsearch_access.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@7cfb0c4c[pattern=/home/hh/elasticsearch-6.6.2/logs/elasticsearch_access-%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}] %m%n, filePermissions=null, fileOwner=null]] java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@7ab802f4] unable to create manager for [/home/hh/elasticsearch-6.6.2/logs/elasticsearch_access.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@7cfb0c4c[pattern=/home/hh/elasticsearch-6.6.2/logs/elasticsearch_access-%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}] %m%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:114)
    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:145)
    at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:61)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:123)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
    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:116)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)

2019-03-22 10:34:45,185 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:235)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:135)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
    at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
    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:116)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)

2019-03-22 10:34:45,191 main ERROR Null object returned for RollingFile in Appenders.
2019-03-22 10:34:45,197 main ERROR Null object returned for RollingFile in Appenders.
2019-03-22 10:34:45,198 main ERROR Null object returned for RollingFile in Appenders.
2019-03-22 10:34:45,218 main ERROR Null object returned for RollingFile in Appenders.
2019-03-22 10:34:45,220 main ERROR Null object returned for RollingFile in Appenders.
2019-03-22 10:34:45,220 main ERROR Null object returned for RollingFile in Appenders.
2019-03-22 10:34:45,220 main ERROR Unable to locate appender "rolling" for logger config "root"
2019-03-22 10:34:45,222 main ERROR Unable to locate appender "index_indexing_slowlog_rolling" for logger config "index.indexing.slowlog.index"
2019-03-22 10:34:45,222 main ERROR Unable to locate appender "audit_rolling" for logger config "org.elasticsearch.xpack.security.audit.logfile.LoggingAuditTrail"
2019-03-22 10:34:45,223 main ERROR Unable to locate appender "index_search_slowlog_rolling" for logger config "index.search.slowlog"
2019-03-22 10:34:45,225 main ERROR Unable to locate appender "deprecated_audit_rolling" for logger config "org.elasticsearch.xpack.security.audit.logfile.DeprecatedLoggingAuditTrail"
2019-03-22 10:34:45,225 main ERROR Unable to locate appender "deprecation_rolling" for logger config "org.elasticsearch.deprecation"
[2019-03-22T10:34:48,853][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [unknown] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Unable to access 'path.data' (/home/hh/elasticsearch-6.6.2/data)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.6.2.jar:6.6.2]
    at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.6.2.jar:6.6.2]
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.6.2.jar:6.6.2]
Caused by: java.lang.IllegalStateException: Unable to access 'path.data' (/home/hh/elasticsearch-6.6.2/data)
    at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:70) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:299) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:254) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.bootstrap.Security.configure(Security.java:123) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:207) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.6.2.jar:6.6.2]
    ... 6 more
Caused by: java.nio.file.AccessDeniedException: /home/hh/elasticsearch-6.6.2/data
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:1.8.0_91]
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:1.8.0_91]
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:1.8.0_91]
    at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[?:1.8.0_91]
    at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0_91]
    at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8.0_91]
    at java.nio.file.Files.createDirectories(Files.java:767) ~[?:1.8.0_91]
    at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:413) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:68) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:299) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:254) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.bootstrap.Security.configure(Security.java:123) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:207) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.6.2.jar:6.6.2]
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.6.2.jar:6.6.2]
    ... 6 more
vieyahn2017 commented 5 years ago

占位

vieyahn2017 commented 5 years ago

这个帖子不错

记录Linux下安装elasticSearch时遇到的一些错误

https://blog.csdn.net/gebitan505/article/details/54709515

本人安装ElasticSearch的步骤完全参照官方文档来进行,在此仅记录下安装过程遇到的一些错误以及解决的办法。 错误一 cannot allocate memory 记录Linux下安装elasticSearch时遇到的一些错误 解决方案: 虚拟机内存不够,关掉centos,重新加大内存分配,原先是512M,现在分配到1800M

记录Linux下安装elasticSearch时遇到的一些错误

错误二 can not run elasticsearch as root

记录Linux下安装elasticSearch时遇到的一些错误 解决方案: 不能用root用户登录来执行,切换为普通用户,

错误三 切换为普通用户后,权限不够 解决方案:https://my.oschina.net/topeagle/blog/591451?fromerr=mzOr2qzZ

错误四 max virtual memory areas vm.max_count [65530] likely too low,increase to at least [26244]

vieyahn2017 commented 5 years ago

安装es-head插件

进入elasticsearch/bin目录,输入命令./plugin –install mobz/elasticsearch-head 安装head插件。如图

【略】