你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
chendaoqiu - 90后IT
赞同来自:
xtc001
jzbrt
lulongzhou
lydouble0
yanlei
要回复问题请先登录或注册
8 个回复
chendaoqiu - 90后IT
赞同来自:
xtc001
赞同来自:
jzbrt
赞同来自:
lulongzhou
赞同来自:
lydouble0
赞同来自:
lulongzhou
赞同来自:
public static void main(String[] args) throws UnknownHostException {
Settings settings = Settings.builder()
.put("path.home", ".")
.put("path.conf", "E:\\workspace_idea\\es_test\\src\\main\\resources")
.put("cluster.name", "es-cluster")
.put("searchguard.ssl.transport.enabled", true)
.put("searchguard.ssl.transport.keystore_filepath", "sgadmin-keystore.jks")
.put("searchguard.ssl.transport.truststore_filepath", "truststore.jks")
.put("searchguard.ssl.http.keystore_password", "password")
.put("searchguard.ssl.http.truststore_password", "password")
.put("searchguard.ssl.transport.keystore_password", "password")
.put("searchguard.ssl.transport.truststore_password", "password")
.put("searchguard.ssl.transport.enforce_hostname_verification", false)
.build();
TransportClient client = new PreBuiltTransportClient(settings, SearchGuardSSLPlugin.class)
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("ip-1"), 9300))
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("ip-2"), 9300))
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("ip-3"), 9300));
client.admin().cluster().nodesInfo(new NodesInfoRequest()).actionGet();
//搜索数据
GetResponse response = client.prepareGet("test", "name", "1").execute().actionGet();
//输出结果
System.out.println(response.getSourceAsString());
//关闭client
client.close();
}
lydouble0
赞同来自:
yanlei
赞同来自:
Exception in thread "main" ElasticsearchSecurityException[no permissions for indices:data/read/search]