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

资阳网站优化互联网营销推广渠道

资阳网站优化,互联网营销推广渠道,中国建设银行网站功能模块,网站建设细节差异化下载elasticsearch和kibana安装包 原文连接:https://juejin.cn/post/7261262567304298554 elasticsearch官网下载比较慢,有时还打不开,可以通过https://elasticsearch.cn/download/下载,先找到对应的版本,最好使用迅…

下载elasticsearch和kibana安装包

原文连接:https://juejin.cn/post/7261262567304298554

elasticsearch官网下载比较慢,有时还打不开,可以通过https://elasticsearch.cn/download/下载,先找到对应的版本,最好使用迅雷下载,秒下的,我的下载速度可以达到40M/S
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

解压安装

安装 elasticsearch

解压后点击elasticsearch-7.10.0\bin\elasticsearch.bat运行成功后,输入http://120.0.0.1:9200,可以访问说明ES启动成功
在这里插入图片描述

安装 kibana

点击kibana-7.10.0-windows-x86_64\bin\kibana.bat 启动成功后,输入http://localhost:5601/即可进入kibana

在这里插入图片描述

配置登录账号密码

ealsticsearch设置账号密码

打开config/ealsticsearch.yml增加开启密码配置,然后重启ealsticsearch

xpack.security.enabled: true
xpack.license.self_generated.type: basic
xpack.security.transport.ssl.enabled: true

在这里插入图片描述
输入.\bin\elasticsearch-setup-passwords.bat interactive设置密码,这里有一些ES内置的账号密码,比如kibana_system这个账号密码需要配置到kibana.yml中,这里要记一下,本地测试我都设置成123456好了,生产环境密码强度要设置大点,不可用简单密码

PS D:\service\ES\elasticsearch-7.10.0> .\bin\elasticsearch-setup-passwords.bat interactive
future versions of Elasticsearch will require Java 11; your Java version from [C:\Program Files\Java\jdk1.8.0_191\jre] does not meet this requirement
Initiating the setup of passwords for reserved users elastic,apm_system,kibana,kibana_system,logstash_system,beats_system,remote_monitoring_user.
You will be prompted to enter passwords as the process progresses.
Please confirm that you would like to continue [y/N]y
Enter password for [elastic]:
Reenter password for [elastic]:
Enter password for [apm_system]:
Reenter password for [apm_system]:
Enter password for [kibana_system]:
Reenter password for [kibana_system]:
Enter password for [logstash_system]:
Reenter password for [logstash_system]:
Enter password for [beats_system]:
Reenter password for [beats_system]:
Passwords do not match.
Try again.
Enter password for [beats_system]:
Reenter password for [beats_system]:
Enter password for [remote_monitoring_user]:
Reenter password for [remote_monitoring_user]:
Changed password for user [apm_system]
Changed password for user [kibana_system]
Changed password for user [kibana]
Changed password for user [logstash_system]
Changed password for user [beats_system]
Changed password for user [remote_monitoring_user]
Changed password for user [elastic]

在这里插入图片描述
再次打开http://localhost:9200,输入账号elastic账号,密码123456,登录成功说明密码设置成功;
在这里插入图片描述

kibana中设置es账号密码

打开kibana-7.10.0-windows-x86_64\config\kiban.yml设置账号密码后,重启kibana,再次输入localhost:5601就可以使用账号密码登录了

elasticsearch.hosts: ["http://localhost:9200"]
elasticsearch.username: "kibana_system"
elasticsearch.password: "123456"

在这里插入图片描述

导测试数据

使用Kiban创建索引并导入测试数据 ,点击kibandev Tools执行创建索引和插入数据
在这里插入图片描述

PUT /news
{"mappings": {"properties": {"id": {"type": "long"},"title": {"type": "text","analyzer": "standard"},"tags": {"type": "keyword"},"read_count": {"type": "long"},"like_count": {"type": "long"},"comment_count": {"type": "long"},"rank": {"type": "double"},"location": {"type": "geo_point"},"pub_time": {"type": "date","format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd HH:mm||yyyy-MM-dd||epoch_millis"}}}
}
POST _bulk
{"create": {"_index": "news", "_id": 1}}
{"comment_count":600,"id":1,"like_count":2000,"location":[118.55199,24.78144],"pub_time":"2023-07-29 09:47","rank":0.0,"read_count":10000,"tags":["台风","杜苏芮","福建"],"title":"台风“杜苏芮”登陆福建晋江 多部门多地全力应对"}
{"create": {"_index": "news", "_id": 2}}
{"comment_count":60,"id":2,"like_count":200,"location":[116.23128,40.22077],"pub_time":"2023-06-29 14:49:38","rank":0.0,"read_count":1000,"tags":["台风","杜苏芮","北京"],"title":"受台风“杜苏芮”影响 北京7月29日至8月1日将有强降雨"}
{"create": {"_index": "news", "_id": 3}}
{"comment_count":6,"id":3,"like_count":20,"location":[120.21201,30.208],"pub_time":"2020-07-29 14:49:38","rank":0.99,"read_count":100,"tags":["台风","杭州"],"title":"杭州解除台风蓝色预警信号"}

JAVA客户端连接

pom引入elasticsearch-rest-high-level-client

        <dependency><groupId>org.elasticsearch.client</groupId><artifactId>elasticsearch-rest-high-level-client</artifactId><version>7.10.0</version></dependency>

创建RestHighLevelClient并完成查询

   public static RestHighLevelClient esClient;static {CredentialsProvider credentialsProvider = new BasicCredentialsProvider();credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("elastic", "123456"));RestClientBuilder builder = RestClient.builder(new HttpHost("127.0.0.1", 9200)).setHttpClientConfigCallback(httpClientBuilder -> httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider));esClient = new RestHighLevelClient(builder);}public static Map<String, Object> getById(String index, String id) throws IOException {GetRequest request = new GetRequest(index, id);GetResponse getResponse = esClient.get(request, RequestOptions.DEFAULT);return  getResponse.getSourceAsMap();}public static void main(String[] args) throws IOException {var doc=getById("news","1");doc.forEach((k,v)-> System.out.println(k+":"+v));}

测试运行

测试运行通过,可完成查询
在这里插入图片描述

http://www.tj-hxxt.cn/news/102707.html

相关文章:

  • 广西教育平台网站建设网络营销的方法有哪些
  • 哪个网站做的最好排行榜百度
  • ppt设计师兼职seo客服
  • 公司网站建设北京推广点击器
  • 装饰公司营销网站模板百度推广客户端app
  • 在线客服接入网站搜索引擎营销流程是什么?
  • 政府网站开发需求报告株洲seo优化公司
  • 金湖县住房和城乡建设局网站seo软件工具
  • 自己做网站要不要钱seo发贴软件
  • 模板网站修改中国营销网站
  • 企业网站制作机构排名百度信息流广告
  • php网站开发数据列表排重广告电话
  • 可以看网站的浏览器有哪些网站seo推广方案
  • 新开神途手游发布网站国际婚恋网站排名
  • 福建厦门网站建设公司小网站怎么搜关键词
  • 网站域名怎么做分录有效果的网站排名
  • 那个网站教做菜做的好百度网站收录查询
  • 武汉云优化网站建设推广类软文案例
  • 用canvas做网站网站优化的意义
  • 汝城县网站建设公司竞价开户
  • 东莞网站优化一般多少钱公司企业网站建设
  • wordpress数据库出错怎么做seo关键词优化
  • 网站怎么样做不违规营销策划与运营
  • 郑州做网站网站建设费用想要推广页
  • 怎么样可以自己做网站seo狂人
  • 塘厦基础网站建设seo优化易下拉排名
  • 软件开发平台合同东莞搜索优化十年乐云seo
  • 从零开始学ui设计谷歌seo排名工具
  • 工艺品网站设计百度公司图片
  • 做公司网站教程视频优化推广网站怎么做最好