Linux下离线安装head,linux下elasticSearch安装及head安装

一、安装elasticsearch

前提

首先,确保jdk为jdk1.8.0_73以上,并已确保安装ok。

1、下载elasticsearch

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.1.1.tar.gz

tar -zxvf elasticsearch-5.1.1.tar.gz

cd elasticsearch-5.1.1

2、修改limit限制(5.0以后都要修改)

> vi /etc/security/limits.conf

* soft nofile 65536

* hard nofile 65536

> echo 'vm.max_map_count=262144'>> /etc/sysctl.conf

> sysctl -p

> vi /etc/security/limits.d/90-nproc.conf

* soft nproc 2048

3、设置配置文件

> vim config/elasticsearch.yml

node.name: node-1

path.data: /tmp/elasticsearch/data

path.logs: /tmp/elasticsearch/logs

network.host: 192.168.x.x

http.port: 9200

# 跨域

http.cors.enabled: true

http.cors.allow-origin: "*"

4、创建用户

# 创建elasticsearch用户

groupadd elasticsearch

useradd elasticsearch -g elasticsearch -p elasticsearch

# 赋权限

chown elasticsearch:elasticsearch -R /usr/local/elasticsearch-5.1.1

5、启动

su - elasticsearch -c "nohup /usr/local/elasticsearch-5.1.1/bin/elasticsearch >/dev/null 2>&1 &"

二、head插件的安装

1、下载

git clone git://github.com/mobz/elasticsearch-head.git

cd elasticsearch-head

在elasticsearch-head目录下node_modules/grunt下如果没有grunt二进制程序,需要执行

cd elasticsearch-head

npm install grunt --save

2、修改服务器监听地址

修改elasticsearch-head下Gruntfile.js文件,默认监听在127.0.0.1下9200端口

55cdc7ee4a7339091a262dd40239a758.png

修改head的连接地址: 目录:head/_site/app.js

this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "https://localhost:9200";

把localhost修改成你es的服务器地址,如:

this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "https://x.x.x.10:9200";

然后在head目录中,执行npm install下载依赖的包:

npm install

3、启动服务

/usr/local/elasticsearch-head/node_modules/grunt/bin/grunt server

fb8606b13040845bb19e3f9cef000743.png

a672c4fcd803d8c8ee75ccab9174518d.png

三、如果没有npm,则需安装npm

curl https://npmjs.org/install.sh | sh

sh install.sh

如果出现

npm cannot be installed without Node.js.

Install Node.js first, and then try again.

则需要 安装Node.js

yum install -y nodejs

如果node.js版本过低,则需要升级

升级node.js

# 第一步:首先安装 n 模块:

npm install -g n

# 第二步:升级node.js到最新稳定版

n stable

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值