Linux离线安装elasticsearch|header|kibna插件最详细

1.准备软件安装包

[hadoop@host152 elasticsearch]$ ll
-rw-r--r--. 1 hadoop hadoop 515807354 9月  23 23:40 elasticsearch-8.1.1-linux-x86_64.tar.gz
-rw-r--r--. 1 hadoop hadoop   1295593 9月  23 23:48 elasticsearch-head-master.tar.gz
-rw-r--r--. 1 hadoop hadoop 269733374 9月  23 23:46 kibana-8.1.1-linux-x86_64.tar.gz
-rw-r--r--. 1 hadoop hadoop  22290256 9月  21 17:47 node-v16.3.0-linux-x64.tar.xz

百度云链接:https://pan.baidu.com/s/1BN80_GIw4k9Vd9u-x_RSxg 
提取码:ujph

2.安装elasticsearch-8.1.1

2.1解压安装包

[hadoop@host152 elasticsearch]$ tar -xvf elasticsearch-8.1.1-linux-x86_64.tar.gz

2.2修改配置文件

[hadoop@host152 elasticsearch]$ cd elasticsearch-8.1.1/
[hadoop@host152 elasticsearch-8.1.1]$ cd config/
[hadoop@host152 config]$ vim elasticsearch.yml
cluster.name: my-es8.1.1
node.name: node-1
network.host: 192.168.72.152
http.port: 9200

2.3启动elasticsearch-8.1.1

[hadoop@host152 bin]$ ./elasticsearch -d

2.4启动报错常见问题

ERROR: [2] bootstrap checks failed. You must address the points described in the following [2] lines before starting Elasticsearch.
bootstrap check failure [1] of [2]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
bootstrap check failure [2] of [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
ERROR: Elasticsearch did not exit normally - check the logs at /home/hadoop/opensource/elasticsearch/elasticsearch-8.1.1/logs/elasticsearch.log

        说上述有两个错误,第一个是说elasticsearch进程为4096太小,请调整为至少65535,解决办法切换root用户在limits.conf末尾添加文件如下(此配置修改后需要退出重新登陆才生效):

[root@host152 ~]# vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 131072
* soft nproc 65535
* hard nproc 65535

        另一个错误是说elasticsearch用户拥有的内存权限太小,至少需要262144,解决办法也是切换root用户修改sysctl.conf,添加内容如下:
[root@host152 ~]# vim /etc/sysctl.conf
vm.max_map_count=262144

刷新系统配置即可
[root@host152 ~]# sysctl -p
vm.max_map_count = 262144

2.5再次启动elasticsearch

[hadoop@host152 bin]$ ./elasticsearch  >elasticsearch.log &

启动没报错,但是访问不能成功,把安全关闭,es8默认开启了此开关
xpack.security.enabled: false
xpack.security.enrollment.enabled: false

修改上述配置再重启,即可访问成功
[hadoop@host152 elasticsearch-8.1.1]$ curl 192.168.72.152:9200
{
  "name" : "node-1",
  "cluster_name" : "my-es8.1.1",
  "cluster_uuid" : "a2A4dXZhT6OlJ4Cbao2FPA",
  "version" : {
    "number" : "8.1.1",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "d0925dd6f22e07b935750420a3155db6e5c58381",
    "build_date" : "2022-03-17T22:01:32.658689558Z",
    "build_snapshot" : false,
    "lucene_version" : "9.0.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

2.6本地浏览器访问

输入访问地址http://192.168.72.152:9200/

若果不能访问,请检查防火墙

查看状态
[root@host152 ~]# firewall-cmd --state
running

关闭防火墙
[root@host152 ~]# systemctl stop firewalld.service

禁止开机启动
[root@host152 ~]# systemctl disable firewalld.service

3.安装node

3.1检查服务是否已经安装node

[root@host152 ~]# node -v
bash: node: 未找到命令...
[root@host152 ~]# npm -v
bash: npm: 未找到命令...

3.2安装node

解压node
[hadoop@host152 elasticsearch]$ tar -xvf node-v16.3.0-linux-x64.tar.xz

切换到用户的根目录
[hadoop@host152 node-v16.3.0-linux-x64]$ cd
[hadoop@host152 ~]$ ll -a
[hadoop@host152 ~]$ more .bashrc

修改用户.bashrc,添加node环境变量只给当前用户
[hadoop@host152 ~]$ cd 
[hadoop@host152 ~]$ echo 'export JAVA_HOME=/usr/local/jdk1.8.0' >> .bashrc
[hadoop@host152 ~]$ echo 'export NODE_HOME=/home/hadoop/opensource/elasticsearch/node-v16.3.0-linux-x64' >> .bashrc
[hadoop@host152 ~]$ echo 'export NODE_PATH=$NODE_HOME/lib/node_modules' >> .bashrc
[hadoop@host152 ~]$ echo 'export PATH=$JAVA_HOME/bin:$NODE_HOME/bin:$PATH' >> .bashrc
[hadoop@host152 ~]$ source .bashrc
[hadoop@host152 ~]$ npm -v
7.15.1
[hadoop@host152 ~]$ node -v
v16.3.0

4.离线安装grunt

安装grunt之前必须安装node,即grunt依赖node环境,在线安装node如下
[root@host151 ~]#curl -sL https://rpm.nodesource.com/setup_8.x | bash -
[root@host151 ~]#yum install -y nodejs

4.1安装grunt

先找一台联网的机器,全局安装grunt-cli客户端
[root@host151 lib]# npm install -g grunt-cli
[root@host151 lib]# grunt -version
grunt-cli v1.4.3

此时只能执行grunt --version和grunt --completion两个命令,如果执行grunt --help,则会报错如下:
grunt-cli: The grunt command line interface (v1.3.2)
If you're seeing this message, grunt hasn't been installed locally to
your project. For more information about installing and configuring grunt,
please see the Getting Started guide:
https://gruntjs.com/getting-started

再安装局部grunt
[root@host151 lib]#npm install grunt
[root@host151 elasticsearch-head-master]$ grunt --version
grunt-cli v1.4.3
grunt v1.6.1

为了防止后面运行es-heaer报下出错误:
>> Local Npm module "grunt-contrib-concat" not found. Is it installed?
>> Local Npm module "grunt-contrib-watch" not found. Is it installed?
>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-contrib-copy" not found. Is it installed?
>> Local Npm module "grunt-contrib-jasmine" not found. Is it installed?

还应该提前安装的模块如下:
[root@host151 lib]#npm install grunt-contrib-clean --registry=https://registry.npm.taobao.org
[root@host151 lib]#npm install grunt-contrib-concat --registry=https://registry.npm.taobao.org
[root@host151 lib]#npm install grunt-contrib-watch --registry=https://registry.npm.taobao.org
[root@host151 lib]#npm install grunt-contrib-connect --registry=https://registry.npm.taobao.org
[root@host151 lib]#npm install grunt-contrib-copy --registry=https://registry.npm.taobao.org
[root@host151 lib]#npm install grunt-contrib-jasmine --registry=https://registry.npm.taobao.org

找到grunt-cli安装目录node_modules目录
[root@host151 lib]# which grunt
/bin/grunt
[root@host151 lib]# ll /bin/grunt
lrwxrwxrwx. 1 root root 35 9月  24 12:21 /bin/grunt -> ../lib/node_modules/grunt/bin/grunt
[root@host151 lib]# 

打包ftp上传或者scp到对应内网机器,这里是152作为内网机器为例
[root@host151 node_modules]# scp -r node_modules hadoop@192.168.72.152:/home/hadoop/opensource/elasticsearch

登陆152机器,找到bin目录,测试grunt是否移植成功,若出现版本号即可
[hadoop@host152 elasticsearch]$ cd grunt-cli
[hadoop@host152 grunt-cli]$ ll
总用量 16
drwxr-xr-x.  2 hadoop hadoop   19 9月  24 11:10 bin
-rw-r--r--.  1 hadoop hadoop 1267 9月  24 11:10 CHANGELOG.md
drwxr-xr-x.  2 hadoop hadoop   29 9月  24 11:10 completion
drwxr-xr-x.  2 hadoop hadoop   42 9月  24 11:10 lib
drwxr-xr-x. 61 hadoop hadoop 4096 9月  24 11:10 node_modules
-rw-r--r--.  1 hadoop hadoop 1662 9月  24 11:10 package.json
-rw-r--r--.  1 hadoop hadoop 1731 9月  24 11:10 README.md
[hadoop@host152 grunt-cli]$ cd bin
[hadoop@host152 bin]$ ./grunt --version
grunt-cli v1.4.3
grunt v1.6.1

4.2配置grunt的全局环境变量,配置grunt-cli的即可

切换到用户目录,修改用户环境变量.bashrc,注释原来的PATH,复制后保存
[hadoop@host152 ~]$ vim .bashrc
export GRUNT_CLIENT_HOME=/home/hadoop/opensource/elasticsearch/node_modules/grunt-cli
export GRUNT_PATH=$GRUNT_CLIENT_HOME/lib/node_modules
export PATH=$JAVA_HOME/bin:$NODE_HOME/bin:$GRUNT_CLIENT_HOME/bin:$PATH
[hadoop@host152 ~]$ source .bashrc
[hadoop@host152 ~]# grunt --version
grunt-cli v1.4.3
grunt v1.6.1

配置文件最终修改如下:

5.安装header插件

5.1解压安装elasticsearch-head安装包

[hadoop@host152 elasticsearch]$ tar -xvf elasticsearch-head-master.tar.gz

修改Gruntfile.js配置文件,增加hostname: '*' 属性
[hadoop@host152 elasticsearch]$ cd elasticsearch-head-master
[hadoop@host152 elasticsearch-head-master]$ vim Gruntfile.js

修改app.js,设置访问elastic-header地址,搜索关键字localhost,修改为访问ES的http地址
[hadoop@host152 elasticsearch-head-master]$ cd _site/
[hadoop@host152 _site]$ vim app.js 

编写启动header的脚本
[hadoop@host152 elasticsearch-head-master]$ touch start.sh
[hadoop@host152 elasticsearch-head-master]$ vim start.sh 
[hadoop@host152 elasticsearch-head-master]$ more start.sh 
grunt server &
[hadoop@host152 elasticsearch-head-master]$ sh start.sh 
Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100

5.2停止grunt任务

[hadoop@host152 elasticsearch-head-master]$ lsof -i:9100
COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
grunt   18727 hadoop   21u  IPv6  76547      0t0  TCP *:jetdirect (LISTEN)
[hadoop@host152 elasticsearch-head-master]$ kill -9 18727

5.3修改ES的配置文件并重启访问header

上述发现还是不能访问,请修改elasticsearch.yml添加配置如下
[hadoop@host152 config]$ vim elasticsearch.yml
http.cors.enabled: true
http.cors.allow-origin: "*"

6.kibana安装

6.1解压安装kibana

解压,并修改配置文件
[hadoop@host152 elasticsearch]$ tar -xvf kibana-8.1.1-linux-x86_64.tar.gz
[hadoop@host152 config]$ vim kibana.yml 
server.port: 5601
server.host: 192.168.72.152
elasticsearch.hosts: ["http://192.168.72.152:9200"]

编写启动脚本
[hadoop@host152 kibana-8.1.1]$ touch start.sh
[hadoop@host152 kibana-8.1.1]$ vim start.sh 
./bin/kibana > start.log &
[hadoop@host152 kibana-8.1.1]$ chmod 755 start.sh 
[hadoop@host152 kibana-8.1.1]$ sh start.sh 

安装启动成功,访问默认端口http://192.168.72.152:5601/

6.2kibana使用

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/89493.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

记录一个 GUI 库的对比测试结果

1,Java 的 JavaFX 2,golang 的 Fyne 1, Java 测试的是一个俄罗斯方块的 GUI 程序。一切正常。 2,Golang github 的原仓库网络问题,没能测试上,使用以下库 https://gitee.com/mirrors/Fyne 下载代码后提示“编译失…

Tomcat 与 JDK 对应版本关系

对应关系 Tomcat版本 jdk版本11.0.x JDK 21及以后10.1.x JDK11及以后10.0.xJDK1.8及以后9.0.x JDK1.8及以后8.5.xJDK1.7及以后8.0.x JDK1.7及以后 查看对应关系方法: 登陆Tomcat官网:Apache Tomcat - Welcome! 结果:

Picgo

title: “Picgo” createTime: 2021-07-01T12:05:5808:00 updateTime: 2021-07-01T12:05:5808:00 draft: false author: “name” tags: [“未标签”] categories: [“未分类”] description: “测试的” picgo 地址 : /home/zhu/software/node/node-v14.15.0-linux-x64/bin文…

河北吉力宝以步力宝健康鞋引发的全新生活生态商

在当今瞬息万变的商业世界中,成功企业通常都是那些不拘泥于传统、勇于创新的先锋之选。河北吉力宝正是这样一家企业,通过打造一双步力宝健康鞋,他们以功能性智能科技穿戴品为核心,成功创造了一种结合智能康养与时尚潮流的独特产品…

C#读取CAD文件(dwg/dxf)并处理

文章目录 一、前言二、调研过程2.1 CAD相关2.2 DWG2.3 DXF2.4 小结三、解析CAD的库3.1 netDxf3.2 Teigha3.2.1 官网获取3.2.2 网上获取四、图形计算一、前言 需求: 项目要求识别CAD图纸(图纸内容与现实事物比例是1:1)中的内容,并提取出一些关键信息。 这里的CAD图纸是指C…

unity 实用框架

单例模式基类 类不继承mono的单例基类 /// <summary> /// 单例基类 /// </summary> //泛型解决&#xff0c;给他一个约束要么是这个类本身要么是它的子类 public class SingleBase<T>where T : SingleBase<T> {protected SingleBase() { }//线程锁。…

C++ 类和对象(4)构造函数

C的目标之一是让使用类对象就像使用标准类型一样&#xff0c;但是常规的初始化语法不适用于类似类型Stock&#xff1a; int year 2001&#xff1b; struct thing {char * pn;int m; }; thing amabob {"wodget",-23}; //有效初始化 Stock hot {"Sukies Autos…

Leetcode 992. K 个不同整数的子数组

文章目录 题目代码&#xff08;9.27 首刷看解析&#xff09; 题目 Leetcode 992. K 个不同整数的子数组 代码&#xff08;9.27 首刷看解析&#xff09; 滑动窗口&#xff0c;恰好转换为&#xff1a;最多K个不同的数 - 最多K-1个不同的数 class Solution { public:int subarr…

kafka伪集群部署,使用KRAFT模式

1:拉去管理kafka界面UI镜像 docker pull provectuslabs/kafka-ui2:拉去管理kafka镜像 docker pull bitnami/kafka3:docker-compose.yml version: 3.8 services:kafka-1:container_name: kafka1image: bitnami/kafka ports:- "19092:19092"- "19093:19093&quo…

测试用例的八大基本准则

测试用例的八大基本准则 测试用例的八大基本准则功能测试性能测试兼容性测试安全测试可靠性测试易用性测试数据库测试接口测试 测试案例 测试用例的八大基本准则 上节测试用例的设计中我们讨论如何设计一个测试用例&#xff0c;知道了测试用例的设计有&#xff1a;“边界值&am…

Linux命令(87)之pwd

linux命令之pwd 1.pwd介绍 linux命令pwd(全称&#xff1a;print working directory)用来列出当前目录 2.pwd用法 pwd [参数] pwd参数(了解即可&#xff0c;99.99%用不到) 参数说明-L显示逻辑路径-P显示实际物理路径 3.实例 3.1.显示当前目录 命令&#xff1a; pwd [ro…

如何制作gif动图gif (多图合成gif、GIF录制软件、视频制作成GIF动图)

文章目录 1 在线制作多图合成gif动画2 GIF录制软件3 将现有的视频 制作成GIF动图 1 在线制作多图合成gif动画 在线制作gif动画链接:https://www.matools.com/gif ①选择需要制作gif动画的图片将其添加 ②调整时间间隔&#xff0c;图片宽高等设置 ③一键生成gif ④下载到本…

目标检测YOLO实战应用案例100讲-区域卷积网络在阴影环境目标检测上的研究与应用(下)

目录 5.2 阴影检测模块与街景检测模块实验设置 5.2.1 实验环境与工具 5.2.3 损失函数 5.2.4 实验具体流程 5.3 实验评估与对比 5.3.1 两类实验的评估标准 5.3.2 两类实验结果对比 阴影环境下街景目标检测系统的实现 6.1 系统概述 6.2 系统软硬件环境 6.3 功能模块设计 6.4 系统…

【OpenSSH漏洞修复】升级到openssh9.4p1版本

实战环境 操作系统:Centos7.9 openssh版本:7.4 重要的升级文件 使用rpm包升级 D:\Linux基线离线安装包\openssh9.4-升级包 的目录openssh-9.4p1-4.el7.x86_64.rpm openssh-clients-9.4p1-4.el7.x86_64.rpm openssh-server-9.4p1-4.el7.x86_64.rpm需要自己去官网下载离线rp…

自定义子组件的v-model

一、传统的父子传参 作为前端程序员&#xff0c;我们在开发时&#xff0c;用到最多的就是父子传参了吧&#xff0c;这一点相信大家都很熟悉了&#xff0c;在这里简单的说一下 1.父传子 &#xff08;1&#xff09; 在父组件中引入子组件&#xff0c;并在父组件的components中注…

基于PLE结合卡尔曼滤波的RSSI定位算法matlab仿真

目录 1.算法运行效果图预览 2.算法运行软件版本 3.部分核心程序 4.算法理论概述 5.算法完整程序工程 1.算法运行效果图预览 2.算法运行软件版本 MATLAB2022a 3.部分核心程序 ............................................................... for Num_xb Num_xb2Num_…

C++思考和一些代码规范(09/28)

文章目录 一、C的一些思考记录1&#xff09;C函数进化&#xff08;函数->函数指针->函数模板->仿函数|函数对象->lambda表达式&#xff09; 一、C的一些思考记录 1&#xff09;C函数进化&#xff08;函数->函数指针->函数模板->仿函数|函数对象->lamb…

golang: Code of Conduct

目录 1. golang: Code of Conduct 1. golang: Code of Conduct Go Community Code of Conduct

目标检测YOLO实战应用案例100讲-面向路边停车场景的目标检测(下)

目录 4.3 引入正则化方法 4.3.1 正则化方法原理 4.3.2 何处引入正则化方法

小白vite+vue3搭建项目整个流程

第一步 查看npm 版本npm -v&#xff0c;npm版本是7&#xff0c;创建项目命令&#xff1a; npm create vitelatest threejsVue -- --template vue第二步 // 进入项目名为threejsVue的项目命令 cd threejsVue // 安装路由 npm install vue-router4 // 安装css npm install -D s…