elasticSearch6.X使用问题汇总
2018-01-09 11:18
330 查看
1、开启ES时报错:
12345678910111213141516 | [2016-11-14T10:05:29,358][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread[main]org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as rootat org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:116) ~[elasticsearch-5.0.0.jar:5.0.0]at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:103) ~[elasticsearch-5.0.0.jar:5.0.0]at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) ~[elasticsearch-5.0.0.jar:5.0.0]at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:96) ~[elasticsearch-5.0.0.jar:5.0.0]at org.elasticsearch.cli.Command.main(Command.java:62) ~[elasticsearch-5.0.0.jar:5.0.0]at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80) ~[elasticsearch-5.0.0.jar:5.0.0]at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:73) ~[elasticsearch-5.0.0.jar:5.0.0] |
· 创建elsearch用户组及elsearch用户groupadd elsearchuseradd elsearch -gelsearch -p elasticsearch使用elsearch启动ES后又会遇到以下问题ERROR: bootstrapchecks failedmax file descriptors[10240]for elasticsearch process likely too low, increase to at least[65536]max number of threads[1024]for user [elsearch] likely too low, increase to at least [2048]max virtual memory areasvm.max_map_count [65530] likely too low, increase to at least [262144][2016-11-14T10:22:17,569][INFO ][o.e.n.Node ] [mysteel-node1] stopping ...[2016-11-14T10:22:17,615][INFO ][o.e.n.Node ] [mysteel-node1] stopped[2016-11-14T10:22:17,615][INFO ][o.e.n.Node ] [mysteel-node1] closing ...[2016-11-14T10:22:17,638][INFO ][o.e.n.Node ] [mysteel-node1] closed 临时解决方案:
sudo su
ulimit –n 65536
su zth 永久解决方案:解决方法参考 :http://www.cnblogs.com/sloveling/p/elasticsearch.html切换到root用户vi/etc/security/limits.conf添加如下内容:* soft nofile65536 * hard nofile131072 * soft nproc2048 * hard nproc4096
vi /etc/security/limits.d/90-nproc.conf修改如下内容: * soft nproc1024 #修改为 * soft nproc2048 vi /etc/sysctl.conf 添加下面配置: vm.max_map_count=655360并执行命令: sysctl -p然后,重新启动elasticsearch,即可启动成功。
二、插入数据
问题描述curl -XPOST 192.168.14.173:32000/test_index_1221/test_type/5-d '{'user_name':"xiaoming"}'
{"error":"Content-Typeheader [application/x-www-form-urlencoded] is not supported","status":406}
1
2
官方解释:
官方改变
解决方法
curl -H "Content-Type:application/json" -XPOST 192.168.14.173:32000/test_index_1221/test_type/5 -d'{'user_name':"xiaoming"}'
{"error":"Content-Typeheader [application/x-www-form-urlencoded] is not supported","status":406}
1
2
指定header头即可
as the final mapping would have more than 1 type:
as the final mapping would have more than 1 type:
三、java index api插入数据
nested: IllegalArgumentException[Rejecting mapping update to [lzn] as the final mapping would have more than 1 type: [lzn, test]];产生问题的原因是6.0.1之后的es每个index下只能放一个type修改方式就是换一个index或者采取该index下唯一的type
相关文章推荐
- VC 使用过程中所遇到的一些问题,汇总在这里,希望对后来者有些许帮助
- IMCO正品行货机使用问题汇总与解答
- jdmail邮件系统安装和使用中的常见问题汇总
- 打开新窗口的window.open使用方法以及最大化等问题解决方法汇总
- VSS使用问题汇总
- 在Vmware下使用OpenSolaris问题汇总
- DataGrid的使用问题汇总
- Mini2440 串口 KITL使用问题汇总
- 黄聪:Delphi中使用ReportMachine 6.5中汇总行不进行汇总的设置问题
- SQL SERVER 2000使用问题汇总
- CGI和BOA使用期间遇到的问题汇总(转)
- Eclipse 和Jboss联合使用问题汇总
- WINDOW7蓝屏错误代码、使用常见问题、解决方法汇总
- 打开新窗口的window.open使用方法以及最大化等问题解决方法汇总
- 水晶报表问题汇总(水晶报表的使用与查询条件生成报表、注册码、打印问题、模式使用示例、C#.Net的WinForm中的使用、程序发布与部署)
- VSS使用问题汇总
- 使用vs.net过程中问题汇总
- BugFree 安装和使用常见问题汇总
- 使用C++.NET常见问题汇总
- Oracle使用总结(三):Oracle JOB问题解决汇总