时间 : 20-04-09 栏目 : 数据库 作者 : 冰镇宝贝321 评论 : 0 点击 : 1,443 次
按官网上的方法安装ik后ES无法启动,报错
1.compile
checkout ik version respective to your elasticsearch version
git checkout tags/{version}
mvn package
copy and unzip target/releases/elasticsearch-analysis-ik-{version}.zip to your-es-root/plugins/ik
2.restart elasticsearch
错误信息:
Exception in thread "main" java.security.AccessControlException: access denied ("java.io.FilePermission" "D:\Program%20Files\elasticsearch-2.4.1\plugins\ik\config\IKAnalyzer.cfg.xml" "read") at java.security.AccessControlContext.checkPermission(AccessControlContext.java:372) at java.security.AccessController.checkPermission(AccessController.java:559) at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) at java.lang.SecurityManager.checkRead(SecurityManager.java:888) at java.io.FileInputStream.<init>(FileInputStream.java:135) at org.wltea.analyzer.dic.Dictionary.<init>(Dictionary.java:114) at org.wltea.analyzer.dic.Dictionary.initial(Dictionary.java:148) at org.wltea.analyzer.cfg.Configuration.<init>(Configuration.java:47) at org.elasticsearch.indices.analysis.IKIndicesAnalysis.<init>(IKIndicesAnalysis.java:30) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at <<<guice>>> at org.elasticsearch.node.Node.<init>(Node.java:213) at org.elasticsearch.node.Node.<init>(Node.java:140) at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:143) at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:194) at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:286) at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
找到错误了。。。路径文件夹名称中带空格,路径错误
排查半天,原来是我把elasticsearch放到了Program Files 这个在程序解析ik分词器的时候会读取成 Program%20Files 当然找不到对应的文件,导致 ik失败,甚至使用 kibana 也启动异常,需要注意,需要放到没有空格的文件夹中
除非注明,文章均为( 冰镇宝贝321 )原创,转载请保留链接: https://bkqv5.com/archives/467.html