java.security.AccessControlException
解决过程分为四步:
1、在es安装目录下config里面新建文件ik-plugin.policy,
将windows系统中java安装目录\jre\lib\security\java.policy中内容全部复制过来,
并且在末尾添加一行:
permission java.net.SocketPermission "*", "connect,resolve";
2、编辑es安装目录下的config里面jvm.options文件
找到以下内容:
# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space
在下面添加以下内容:
-Xms1g
-Xmx1g
//等号后面为步骤a,新建文件ik-plugin.policy的绝对路径
-Djava.security.policy=/home/qwe/elasticsearch-6.2.4/config/ik-plugin.policy
3、编辑es安装目录下/plugins/elasticsearch/config/IKAnalyzer.cfg.xml文件,内容如下
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>IK Analyzer 扩展配置</comment>
<!--用户可以在这里配置自己的扩展字典 -->
<entry key="ext_dict">ext_dict.dic</entry>
<!--用户可以在这里配置自己的扩展停止词字典-->
<entry key="ext_stopwords">ext_stopword.dic</entry>
<!--配置远程扩展字典 格式为 协议://ip:port/项目名/文件名 -->
<!--此处ip为远程词典myword.txt所在主机ip-->
<entry key="remote_ext_dict">http://10.103.59.174:8989/ps/myword.txt</entry>
<!--用户可以在这里配置远程扩展停止词字典-->
<!-- <entry key="remote_ext_stopwords">words_location</entry> -->
</properties>
4.重启es 再启动项目
注意:如果你的远程词典在windows上web项目中,在启动es加载远程词典时出现"拒绝连接",
不用慌张,这时去启动项目,
保证在IKAnalyzer.cfg.xml文件中配置的http://10.103.59.174:8989/ps/myword.txt路径能访问到远程词典文件。
等待es启动日志出现 ”重新加载词典完毕“,说明配置成功
(可在将此路径放到windows浏览器上进行测试)