【ElasticSearch】windows server 2019安装ES8.9.1 + kibana8.9.1 + IK分词器

目录

准备工作

ES

Kibana

IK

安装

es

es访问测试

将es安装为系统服务

Kibana

配置es

运行kibana

访问测试

IK

补充


准备工作

ES8.9.1 + kibana8.9.1 + IK的版本最好要对应上!!!

ES

es8.9.1:

https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.9.1-windows-x86_64.zip

es历史版本下载页面:

https://www.elastic.co/cn/downloads/past-releases#elasticsearch

Kibana

kibana8.9.1:

https://artifacts.elastic.co/downloads/kibana/kibana-8.9.1-windows-x86_64.zip

kibana历史版本下载页面:

Past Releases of Elastic Stack Software | Elastic

IK

IK8.9.0(ik没有8.9.1的版本,但是可以通过修改配置文件适配8.9.1的es):

IK历史版本下载页面:

https://github.com/infinilabs/analysis-ik/tags

安装

es

将压缩包解压后放到你想放置的位置就行。

修改配置文件(config/elasticsearch.yml):

复制代码
# 开放远程访问
network.host: 0.0.0.0

接着进入bin目录,在地址栏里输入cmd回车:

复制代码
# 切换到utf-8编码
chcp 65001

# 运行es的脚本
elasticsearch.bat

在第一次运行完成后会弹出elastic用户的密码和token信息(配置kibana将会用到),注意只有第一次弹出!!!

关键信息位置如下两个地方,自行找到对应的位置:

密码:

Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):

xxxxxxxxxxxxxxxx

token:

Copy the following enrollment token and paste it into Kibana in your browser (valid for the next 30 minutes):

xxxxxxxxxxxxxxxxxx

es访问测试

浏览器访问

复制代码
https://127.0.0.1:9200

访问如果提示什么不安全链接,忽略即可,页面中应该会有更多选项的按钮,选择继续访问即可。

然后就会要你输入账号密码,账号是elastic,密码就是cmd窗口中弹出的信息(就是上面说的首次启动会弹出的信息),假如你没记下来,可以通过以下命令重置下密码:

复制代码
elasticsearch-reset-password -u elastic

如果重置失败了,尝试下把es服务运行起来后再去运行命令。

访问成功了会弹出版本信息,如:

将es安装为系统服务

进入es的bin目录,然后在地址栏中输入cmd,在黑窗口中执行。

命令如下:

复制代码
# 安装为系统服务(必须先运行这个命令安装)
elasticsearch-service.bat install

# 将es移出系统服务
elasticsearch-service.bat remove

# 启动es服务
elasticsearch-service.bat start

# 停止es服务
elasticsearch-service.bat stop

# 打开es服务管理器
elasticsearch-service.bat manager

在安装好之后如果你需要设置自动运行,那么你需要运行下elasticsearch-service.bat manager,在弹出的窗口中设置为跟我的一样的即可:

Kibana

解压后放到你想放置的位置即可。

修改配置文件(config/kibana.yml):

复制代码
# 开放远程访问
server.host: 0.0.0.0

配置es

进入bin目录后在地址栏输入cmd,然后在黑窗口中输入以下命令:

复制代码
kibana-setup

接着会提示你要输入token,这个token就是前面说的es首次启动时弹出的关键信息其中之一。

如果你没有记录,或者是前面的token过期了,可以通过进入es的bin目录中在地址栏打开cmd,输入以下命令创建新的token:

复制代码
elasticsearch-create-enrollment-token -s kibana

然后将token输入后kibana就会自行去配置了。

运行kibana

双击kibana.bat即可运行。

访问测试

浏览器访问

复制代码
http://127.0.0.1:5601

账户名elastic,密码跟前面的一致,其实这个账户密码就是es的登录账户和密码。

IK

将压缩包解压后放在es中的plugins位置即可。然后停止es服务再启动即可。

测试ik分词器的两种模式:

复制代码
GET _analyze
{
    "analyzer": "ik_smart",
    "text": "我是中国人"
}

GET _analyze
{
    "analyzer": "ik_max_word",
    "text": "我是中国人"
}

补充

如果需要修改elastic的密码只需要在kibana发请求:

复制代码
POST /_security/user/elastic/_password
{
    "password": "123456"
}
相关推荐
永洪科技3 小时前
永洪科技荣获商业智能品牌影响力奖,全力打造”AI+决策”引擎
大数据·人工智能·科技·数据分析·数据可视化·bi
weixin_307779133 小时前
Hive集群之间迁移的Linux Shell脚本
大数据·linux·hive·bash·迁移学习
大只鹅4 小时前
解决 Spring Boot 对 Elasticsearch 字段没有小驼峰映射的问题
spring boot·后端·elasticsearch
上海锝秉工控6 小时前
防爆拉线位移传感器:工业安全的“隐形守护者”
大数据·人工智能·安全
cv高级工程师YKY7 小时前
SRE - - PV、UV、VV、IP详解及区别
大数据·服务器·uv
bxlj_jcj8 小时前
深入Flink核心概念:解锁大数据流处理的奥秘
大数据·flink
云资源服务商8 小时前
阿里云Flink:开启大数据实时处理新时代
大数据·阿里云·云计算
Aurora_NeAr9 小时前
Spark SQL架构及高级用法
大数据·后端·spark
王小王-1239 小时前
基于Hadoop的公共自行车数据分布式存储和计算平台的设计与实现
大数据·hive·hadoop·分布式·hadoop公共自行车·共享单车大数据分析·hadoop共享单车
数据与人工智能律师9 小时前
数字资产革命中的信任之锚:RWA法律架构的隐形密码
大数据·网络·人工智能·云计算·区块链