当前位置: 首页 > wzjs >正文

网站建设毕业设计个人总结汕头seo优化项目

网站建设毕业设计个人总结,汕头seo优化项目,安装wordpress连接不上数据库文件,关于申请建设网站申请报告可以通过华为官方提供的Java客户端,来实现基于Kerberos认证访问和操作华为云Elasticsearch;亦可以使用更加通用的开源Elasticsearch Java客户端bboss,来实现基于Kerberos认证访问和操作华为云Elasticsearch。 本文介绍使用bboss实现基于Kerb…

可以通过华为官方提供的Java客户端,来实现基于Kerberos认证访问和操作华为云Elasticsearch;亦可以使用更加通用的开源Elasticsearch Java客户端bboss,来实现基于Kerberos认证访问和操作华为云Elasticsearch。

本文介绍使用bboss实现基于Kerberos认证访问和操作华为云Elasticsearch的方法。

1. bboss介绍

bboss是一个高性能高兼容性的Elasticsearch java客户端框架:
在这里插入图片描述
更多bboss介绍,可以访问文档了解:https://esdoc.bbossgroups.com/#/README

2. 集成bboss

集成bboss非常简单,只需在项目中导入bboss对应的maven坐标即可:

<dependency><groupId>com.bbossgroups.plugins</groupId><artifactId>bboss-datatran-jdbc</artifactId><version>7.3.5</version>
</dependency>

实际bboss版本号可以参考文档获取:
https://esdoc.bbossgroups.com/#/changelog

3. 配置和使用Elasticsearch数据源

在项目中导入bboss maven坐标后,定义基于Kerberos认证的Elasticsearch数据源以及通过ClientInterface验证数据源:

		Map properties = new HashMap();/*** 配置Elasticsearch数据源参数,这里只设置必须的配置项,更多配置参考文件:* https://gitee.com/bboss/elasticsearchdemo/blob/master/src/main/resources/application.properties*///定义Elasticsearch数据源名称:esDS,后续通过esDS获取对应数据源的客户端API操作和访问Elasticsearchproperties.put("elasticsearch.serverNames","esDS");//es服务器地址和端口,多个用逗号分隔properties.put("esDS.elasticsearch.rest.hostNames","192.168.137.1:8200");//是否在控制台打印dsl语句,log4j组件日志级别为INFO或者DEBUGproperties.put("esDS.elasticsearch.showTemplate","true");//集群节点自动发现,关闭服务发现机制properties.put("esDS.elasticsearch.discoverHost","false");//Kerberos安全认证配置--开始properties.put("esDS.http.kerberos.serverRealmPath","/elasticsearch/serverrealm");//配置华为云Elasticsearch服务端Princpal查询服务地址properties.put("esDS.http.kerberos.useSubjectCredsOnly","false");//华为云Elasticsearch krb5.conf文件,由华为提供properties.put("esDS.http.kerberos.krb5Location","C:/environment/es/8.13.2/elasticsearch-8.13.2/config/krb5.conf");//华为云Elasticsearch jaas.conf文件,由华为提供properties.put("esDS.http.kerberos.loginConfig","C:/environment/es/8.13.2/elasticsearch-8.13.2/config/jaas.conf");//配置登录模块名称,与华为云Elasticsearch jaas.conf文件中的模块名称一致properties.put("esDS.http.kerberos.loginContextName","ESClient");//配置是否debug Kerberos认证详细日志properties.put("esDS.http.kerberos.debug","true");//Kerberos安全认证配置--结束//启动和初始化Elasticsearch数据源ElasticSearchBoot.boot(properties);//通过Elasticsearch数据源名称esDS获取对应数据源的客户端API,操作和访问Elasticsearch//可以反复根据数据源名称esDS,调用下面的方法获取ClientInterface接口实例,始终返回单实例多线程安全的ClientInterface对象ClientInterface clientInterface = ElasticSearchHelper.getRestClientUtil("esDS");//验证客户端:通过Elasticsearch rest服务获取ES集群信息String result = clientInterface.executeHttp("/?pretty", ClientInterface.HTTP_GET);logger.info(result);//验证客户端:通过API获取ES集群配置参数logger.info(clientInterface.getClusterSettings());//验证客户端:通过API判断索引demo是否存在boolean exist = clientInterface.existIndice("demo");logger.info(exist+"");//验证客户端:通过API从索引demo获取文档id为1的文档数据(String报文)String doc = clientInterface.getDocument("demo","1");logger.info(doc+"");//验证客户端:通过API从索引demo获取文档id为1的文档数据(or mapping示例:返回Map结构的数据,亦可以转换为PO对象)Map mapdoc = clientInterface.getDocument("demo","1",Map.class);

基于配置Kerberos认证实现代码非常简洁,只需在平常数据源参数配置的基础上,增加Kerberos认证相关的参数即可。上述代码中涉及的华为云Kerberos配置文件krb5.conf和jaas.conf,由华为云Elasticsearch提供,这里不单独介绍,需要注意一下:http.kerberos.loginContextName参数对应的值需与jaas.conf配置文件中认证模块名称一致,这里是ESClient。

下面是一个jaas.conf配置内容样例:

ESClient {com.sun.security.auth.module.Krb5LoginModule requireduseKeyTab=truekeyTab="C:/environment/es/8.13.2/elasticsearch-8.13.2/config/elastic.keytab"principal="elastic/admin@BBOSSGROUPS.COM"useTicketCache=falsestoreKey=truedebug=false;
};

其中的elastic.keytab文件由华为云Elasticsearch提供即可。更多ClientInterface api使用方法,可以访问下面参考资料中提供的链接了解。

本文对应的代码源码工程下载地址:

码云 https://gitee.com/bboss/eshelloword-booter
Github https://github.com/bbossgroups/eshelloword-booter

对应的Kerberos认证Java Demo CustormInitAndBootKerberosAuth.java

4. 参考资料

Elasticsearch文档增删改查操作介绍 https://esdoc.bbossgroups.com/#/document-crud

高性能elasticsearch ORM开发库使用介绍 https://esdoc.bbossgroups.com/#/development

快速开始bboss https://esdoc.bbossgroups.com/#/quickstart

开发交流 https://esdoc.bbossgroups.com/#/supportus

http://www.dtcms.com/wzjs/504461.html

相关文章:

  • 工作做ppt课件的网站百度代理服务器
  • 广州建设网站企业网站关键词优化方案
  • 安装wordpress连接不了数据库黑帽seo寄生虫
  • 适合权重小的网站做的专题重庆镇海seo整站优化价格
  • 山东网络建站推广西安百度提升优化
  • 网站的模糊搜索怎么做北京seo收费
  • 秀山网站建设免费收录平台
  • 自己模板做网站广州关于进一步优化疫情防控措施
  • 加强农业网站建设上海百度关键词推广
  • 网站建设与规划试卷站点
  • 一起做网站女装夏季电脑培训机构
  • 通付盾 网站建设公司百度知道网页入口
  • 防城港做网站山东移动网站建设
  • 青海环保网站建设公司网站推广业务
  • bc网站开发长沙seo排名收费
  • 免费的网页域名台州网站seo
  • 建网360 网站建设seo公司怎么推广宣传
  • 益阳市网站建设科技搜索引擎优化搜索优化
  • 网站建设安全标准博客可以做seo吗
  • 草桥做网站公司网推项目接单平台
  • 广告流量投放seo免费优化软件
  • 电商网站规划品牌传播策划方案
  • 2017织梦网站怎么做seo外贸如何做网站推广
  • 哪些网站的做的好看快速排名推荐
  • 网站定制公司排行榜东莞全网营销推广
  • 简历模板免费下载网站优化网站seo方案
  • 邢台做网站哪家好网站在线优化检测
  • 电子商务网站设计的原则成都疫情最新消息
  • 免费建设互动的网站深圳防疫措施优化
  • 健康类网站模板太原网站快速排名提升