首页 > 系统相关 >windows 安装 Elasticsearch

windows 安装 Elasticsearch

时间:2023-02-25 17:23:13浏览次数:52  
标签:bat service windows token Elasticsearch elasticsearch 安装

一.官网下载安装包
Elasticsearch高版本内置jdk,无需使用系统安装的java,本文以 8.3.3 版本为例,无需修改配置文件
1. 下载安装包
https://www.elastic.co/cn/downloads/elasticsearch

 

 

 

2.下载后解压
双击 elasticsearch.bat 启动 elasticsearch 服务

注:第一次启动时, 要注意此时的 ip 地址, 该 ip 地址会被绑定到 enrollment token 中, 在安装 Kibana 时有用

 

 

 

第一次启动会打印一下内容, 要好好记录下来
-> Elasticsearch security features have been automatically configured!
-> Authentication is enabled and cluster connections are encrypted.

-> Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):
+FOyD9Ihzn*6SHmv9Son

-> HTTP CA certificate SHA-256 fingerprint:
61e0476f0849bb2293d6f83152dea0d94985568f6cadaae80f3eef2c621e5629

-> Configure Kibana to use this cluster:
* Run Kibana and click the configuration link in the terminal when Kibana starts.
* Copy the following enrollment token and paste it into Kibana in your browser (valid for the next 30 minutes):
eyJ2ZXIiOiI4LjMuMyIsImFkciI6WyIxOTIuMTY4LjEuNzo5MjAwIl0sImZnciI6IjYxZTA0NzZmMDg0OWJiMjI5M2Q2ZjgzMTUyZGVhMGQ5NDk4NTU2OGY2Y2FkYWFlODBmM2VlZjJjNjIxZTU2MjkiLCJrZXkiOiJwMWZhUDRNQjBWUGo5SW16NElOQzpoczZoU083LVJnbUh1QUZOc0FCUjVBIn0=

-> Configure other nodes to join this cluster:
* On this node:
- Create an enrollment token with `bin/elasticsearch-create-enrollment-token -s node`.
- Uncomment the transport.host setting at the end of config/elasticsearch.yml.
- Restart Elasticsearch.
* On other nodes:
- Start Elasticsearch with `bin/elasticsearch --enrollment-token <token>`, using the enrollment token that you generated.

3.验证安装结果
在浏览器中输入如下链接和用户名密码
https://localhost:9200/

 

 

 


出现以下内容, 则代表启动成功


{
"name" : "DESKTOP-CJ5CSRU",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "Jcp_3e7xRI6edD_yHgKpJA",
"version" : {
"number" : "8.3.3",
"build_flavor" : "default",
"build_type" : "zip",
"build_hash" : "801fed82df74dbe537f89b71b098ccaff88d2c56",
"build_date" : "2022-07-23T19:30:09.227964828Z",
"build_snapshot" : false,
"lucene_version" : "9.2.0",
"minimum_wire_compatibility_version" : "7.17.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "You Know, for Search"
}

4.将 elasticsearch 以服务的方式安装
4.1 添加系统环境变量 Elasticsearch_Server

 

 

 


4.2 在系统环境变量 Path 中添加如下路径
%Elasticsearch_Server%\bin

 

 

 


4.3 安装 Elasticsearch 服务
cmd中执行
elasticsearch-service.bat install

4.4 服务操作命令
启动Elasticsearch服务:
elasticsearch-service.bat start
停止Elasticsearch服务:
elasticsearch-service.bat stop
安装Elasticsearch服务:
elasticsearch-service.bat install
卸载Elasticsearch服务:
elasticsearch-service.bat remove

启动 Elasticsearch 属性gui:
elasticsearch-service.bat manager
1
二.安装 ElasticSearch-head 插件
1.安装 node.js 环境
官网下载 msi版本的 windows安装包:
https://nodejs.org/
1
我所下载的版本为 v14.0.0,下载过程中记得添加入环境变量, 安装成功后进行验证

2.安装 Grunt 工具
cmd中执行
npm install -g grunt-cli

 

 

3.安装 ElasticSearch-head 插件
下载压缩包 elasticsearch-head-master.zip:
https://github.com/mobz/elasticsearch-head

3. 下载后解压启动
在该文件夹内启动cmd, 执行安装命令:
npm install

执行启动命令:
npm run start

4.访问 elasticsearch-head
我们首先需要解决下跨域问题:
在 config/elasticsearch.yml 添加如下配置:
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: "*"

重启 elasticsearch 和 elasticsearch-head

由于本次安装有默认的用户密码, 则我们请求

http://localhost:9100/?auth_user=elastic&auth_password=+FOyD9Ihzn*6SHmv9Son

 

 

三.安装 kibana
1.下载与Elasticsearch 相同版本的 kibana
https://www.elastic.co/cn/downloads/past-releases#kibana
1
2.启动 Kibana服务
bin目录下双击执行 kibana.bat 文件

 

 

3.输入用户密码

 

 

 

 

 


4.中文版界面
修改 config\kibana.yml 文件

将 i18n.locale: “en”, 改为 i18n.locale: “zh-CN”

 

标签:bat,service,windows,token,Elasticsearch,elasticsearch,安装
From: https://www.cnblogs.com/matd/p/17154824.html

相关文章

  • Ant Design Pro 安装
    使用npm安装cnpmnpminstall-gcnpm--registry=https://registry.npm.taobao.org 安装yarncnpminstall-gyarn 安装Umicnpminstall-gumi 安装项......
  • Windows wsl2安装Docker
    wsl2的Ubuntu安装好后,就可以安装Docker了。由于众所周知的原因,国内访问国外的某些网站会访问不了或者访问极慢,Docker的安装网站就在其中。所以推荐使用阿里的镜像进行安......
  • Windows wsl2支持systemd
    背景很多Linux发行版都是使用systemd来管理程序进程,但是在WSL中默认是用init来管理进程的。为了符合长久的使用习惯,且省去不必要的学习成本,就在WSL的发行版(我这里安装的......
  • maven一键构建概念 maven安装
    项目的一键构建我们的项目往往都要经历编译测试运行打包安装部署等一系列过程什么是构建指的是项目从编译测试运行打包安装部署整个过程都交给maven进行管理......
  • windows-win+快捷键用不了
    win10按win+e、win+r、win+d等win键无反应原因:win键盘被锁解决方式fn+win解锁win键即可(如果按过无反应,连按两次三次尝试即可)依旧无反应尝试fn+F2、fn+F6、fn+键盘......
  • 894~895 Maven一键构建概念,和安装
    项目的一键构建我们的项目,往往都要经历编译、测试、运行、打包、安装,部署等一系列过程。什么是构建?指的是项目从编译、测试、运行、打包、安装,部署整个过程......
  • Ubuntu 16.04上安装openjdk7--编译Android6.0使用
    问题背景:需要在编译服务器上编译android6.0代码。这个版本需要使用openjdk7。参考来自官网的信息:https://source.android.com/docs/setup/start/older-versions?hl=zh-c......
  • conda | 创建环境、安装包、删除环境步骤
    在跑项目时,常常会安装很多的包,也通常会遇到需要安装指定版本的包,以及包与包不兼容的问题。比如:在项目1中安装librosa时,会自动安装相应版本的numpy。而如果你把各个项目都......
  • Xcode 11无法成功安装Cocoapods的原因和解决方案: mkmf.rb can't find header files f
    错误信息mkmf.rbcan'tfindheaderfilesforrubyat/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h注意:如果想改回之前使用的X......
  • Windows黑客编程之进程伪装
    描述通过NtQueryInformation函数获取进程信息,并修改peb参数,可以欺骗ProcMon等查看进程信息的工具,将其伪装成一个看起来无害的进程代码实现NtQueryInformationProces......