什javaapi_走进大数据丨 ElasticSearch6.X的JavaAPI环境部署

  • 使用环境:IDEA、Maven

    创建maven工程进行API的使用

  • pom依赖:

                        junit            junit            4.12            test                                    org.elasticsearch.client            transport            6.1.1                            org.elasticsearch            elasticsearch            6.1.1                                    org.apache.logging.log4j            log4j-core            2.9.1        

注意:完成上述操作后既可以正常编写ElasticSearchAPI了,运行的时候会出现以下异常

ERROR StatusLogger 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.

出现该异常的原因:缺少ElasticSearch的log4j2.properties文件。

解决方法:在maven工程的resources目录中新建一个文件命名为“log4j2.properties”,文件中添加以下内容

appender.console.type = Consoleappender.console.name = consoleappender.console.layout.type = PatternLayoutappender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%m%nrootLogger.level = inforootLogger.appenderRef.console.ref = console

如此ElasticSearch6.X的JavaAPI环境部署成功!

Linux部署ElasticSearch集群:安装Elasticsearch及其遇到的坑

ElasticSearch的Chrome的插件安装:安装elasticsearch-head.crx插件

5ce884472aae31d2e5d84f61ee26d584.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值