elasticsearch-6.0.1安装
elasticsearch-6.0.1安装

Python
1
2
|
tar -zxvf elasticsearch-6.0.1.tar.gz
mv elasticsearch-6.0.1.tar.gz /usr/local/elasticsearch
|
Python
1
2
3
4
5
6
7
8
9
10
11
12
13
|
cluster.name: cluster-es
node.name: es-node1
path.data: /usr/local/elasticsearch/data
path.logs: /usr/local/elasticsearch/logs
network.host: 172.16.64.137
http.port: 9200
discovery.zen.minimum_master_nodes: 1
discovery.zen.ping.unicast.hosts: ["172.16.64.137", "172.16.64.138", "172.16.64.147"]
node.master: true
node.data: false
discovery.zen.fd.ping_timeout: 180s
discovery.zen.fd.ping_retries: 10
discovery.zen.fd.ping_interval: 30s
|
Python
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
cluster.name: cluster-es
# 集群名称
node.name: es-node1
# 节点名称,其余两台为es-node2、es-node3
path.data: /usr/local/elasticsearch/data
# 数据目录
path.logs: /usr/local/elasticsearch/logs
# 日志目录
network.host: 172.16.64.137
# 本机IP
http.port: 9200
# 本机http端口
discovery.zen.minimum_master_nodes: 1
# 指定集群中的节点中有几个有master资格的节点
discovery.zen.ping.unicast.hosts: ["172.16.64.137", "172.16.64.138", "172.16.64.147"]
# 指定集群中其他节点的IP
node.master: true
# 是否为master
node.data: false
# 是否为数据节点
discovery.zen.fd.ping_timeout: 180s
# 设置集群中自动发现其它节点时ping连接超时时间
discovery.zen.fd.ping_retries: 10
# 集群中节点之间ping的次数
discovery.zen.fd.ping_interval: 30s
# 集群中节点之间ping的时间间隔
|
Python
1
2
3
|
vim /usr/local/elasticsearch/config/jvm.options
-Xms2g
-Xmx2g
|
Python
1
2
3
4
5
6
7
8
9
|
# 创建用户
useradd ela
# 赋予ela用户所有者权限
chown -R ela:ela /usr/local/elasticsearch
su - ela
[ela@test1 ~]$/usr/local/elasticsearch/bin/elasticsearch -d # -d参数是后台运行
# 建议按以下命令启动
[ela@test1 ~]$ nohup /usr/local/elasticsearch/bin/elasticsearch &
|
Python
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
{
"name" : "dcV-DRJ",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "N6qGE15TQqq9-RQedQqqEw",
"version" : {
"number" : "6.1.1",
"build_hash" : "bd92e7f",
"build_date" : "2017-12-17T20:23:25.338Z",
"build_snapshot" : false,
"lucene_version" : "7.1.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
|
Python
1
2
3
4
5
6
7
|
vi /etc/security/limits.conf
#添加如下内容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
|
Python
1
2
3
4
5
|
vim /etc/sysctl.conf 添加一行
vm.max_map_count=655360
# 执行命令:
sysctl -p
|
Python
1
2
3
4
5
|
tar node-v8.9.3.tar.gz
cd node-v8.9.3
./configure --prefix=/usr/local/node/
make # make时间较长
make install
|
Python
1
2
3
4
5
6
|
vim /etc/profile
export NODEJS_HOME=/usr/local/node/
export PATH=$PATH:$NODEJS_HOME/bin
# 使变量生效
source /etc/profile
|
Python
1
2
|
[root@test1 bin]# node -v
v8.9.3
|
Python
1
2
|
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
|
Python
1
|
npm install
|
Python
1
2
3
4
5
|
#安装国内镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
# 安装插件(在elasticsearch-head目录下)
cnpm install
|
Python
1
2
3
4
5
6
7
8
9
10
11
|
vi Gruntfile.js
connect: {
server: {
options: {
hostname: "0.0.0.0", #新增的一行
port: 9100,
base: '.',
keepalive: true
}
}
}
|
Python
1
2
3
4
|
# 搜索
http://localhost:9200
# 修改为本机IP
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.1.138:9200";
|
Python
1
2
3
4
5
6
7
|
# 在配置文件的最后加上运行head插件跨域访问rest接口
vim /usr/local/elasticsearch/config/elasticsearch.yml
# 添加如下内容:
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-credentials: true
|
Python
1
|
npm run start &
|
Python
1
2
3
4
5
6
7
8
9
10
11
|
[root@test1 elasticsearch-head]# npm run start
> elasticsearch-head@0.0.0 start /usr/local/elasticsearch-head
> grunt server
>> Local Npm module "grunt-contrib-jasmine" not found. Is it installed?
(node:16304) ExperimentalWarning: The http2 module is an experimental API.
Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100
|

最简单的方法就是使用nohup。先按Ctrl + C,停止当前运行的Elasticsearch,改用下面的命令运行Elasticsearch
Python
1
|
nohup ./bin/elasticsearch &
|
附:es启动脚本
Python
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#!/bin/sh
#chkconfig: 2345 80 05
#description: es
export JAVA_HOME=/usr/local/jdk1.8.0_151
export JAVA_BIN=/usr/local/jdk1.8.0_151/bin
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
case $1 in
start)
su ela<<!
cd /usr/local/elasticsearch
./bin/elasticsearch -d
exit
!
echo "es startup"
;;
stop)
es_pid=`ps aux|grep elasticsearch | grep -v 'grep elasticsearch' | awk '{print $2}'`
kill -9 $es_pid
echo "es stopup"
;;
restart)
es_pid=`ps aux|grep elasticsearch | grep -v 'grep elasticsearch' | awk '{print $2}'`
kill -9 $es_pid
echo "es stopup"
su ela<<!
cd /usr/local/elasticsearch
./bin/elasticsearch -d
!
echo "es startup"
;;
*)
echo "start|stop|restart"
;;
esac
|
elasticsearch-6.0.1安装的更多相关文章
- 在Windows上安装Elasticsearch 5.0
在windows上安装Elasticsearch Elasticsearch可以使用.zip软件包安装在Windows上. elasticsearch-service.bat命令,它将设置Elasti ...
- Elasticsearch 5.0 安装 Search Guard 5 插件 (五)
一.Search Guard 简介 Search Guard 是 Elasticsearch 的安全插件.它为后端系统(如LDAP或Kerberos)提供身份验证和授权,并向Elasticsearc ...
- ElasticSearch 5.0.0 集群安装部署文档
1. 搭建环境 3台物理机 操作系统 centos7 es1 192.168.31.141 4g内存 2核 es2 192.168.31.142 4g内存 2核 es3 ...
- ElasticSearch 5.0及head插件安装
一.elasticsearch安装配置 1.官网下载源码包 https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0 ...
- Elasticsearch学习之ElasticSearch 5.0.0 安装部署常见错误或问题
ElasticSearch 5.0.0 安装部署常见错误或问题 问题一: [--06T16::,][WARN ][o.e.b.JNANatives ] unable to install syscal ...
- elasticsearch 6.0在Ubuntu下的安装
1:直接下载 elasticsearch 6.0 zip文件 https://www.elastic.co/downloads/past-releases 2:解压:进入到解压后的bin目录,执行 ...
- ElasticSearch 5学习(1)——安装Elasticsearch、Kibana和X-Pack
安装准备: 安装Elasticsearch唯一的要求是安装官方新版的Java,包括对应的Jdk. 安装Elasticsearch 首先到官网下载最新版本的Elasticsearch压缩包. 可以使用命 ...
- ElasticSearch 2 (6) - 插件安装Head、Kopf与Bigdesk
ElasticSearch 2 (6) - 插件安装Head.Kopf与Bigdesk 摘要 安装Elasticsearch插件Head.Kopf与Bigdesk 版本 elasticsearch版本 ...
- Elasticsearch 5.0
Elasticsearch 5.0 使用ES的基本都会使用过head,但是版本升级到5.0后,head插件就不好使了.下面就看看如何在5.0中启动Head插件吧! 官方粗略教程 Running wit ...
- (新)elasticsearch6.0版本安装head插件
ES6.0版本安装head插件 1.1 前言 不知道是我电脑问题还是最近的开源软件都比较**,mysql和elasticsearch新版本变动都比较大. elasticsearch6.0貌似已经不支持 ...
随机推荐
- Java程序的设计环境配置
一.下载主要的开发工具 JDK的下载 www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html Ecli ...
- tp5 之 "No input file specified
tp5 之 "No input file specified" 问题 通过"域名/模块/控制器/方法"这样的方式访问的时候,浏览器输出如下: 直接通过" ...
- POI解析读写EXCEL,复制SHEET,兼容EXCEL93-2003,2007
import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import org.apa ...
- c# WInform 自定义导航布局
问题形成原因:软件一般都是左侧树导航或上部菜单导航,做好一个软件后,有的客户可能想用一个页面做导航图像,而各个客户用的功能可能不同,所以导航布局需要自定义. 思路:1.把菜单列出来 2.双击菜单生成一 ...
- [Fw]初探linux中断系统(1)
1. 重要接口 LDD上说,“内核维护了一个中断信号线的注册表,该注册表类似于I/O端口的注册表.模块在使用中断前要先请求一个中断通道(或者中断请求IRQ),然后在使用后释放该通道.” 撇开系统如何遍 ...
- 案例:使用xml存储数据
HTML: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF ...
- 更改mysql最大连接数
方法一: 打开cmd,用"mysql -u root -p;"命令进入mysql, 输入命令:show variables like "max_connections&q ...
- ThinkPhp学习
页面跳转 界面跳转是很常用的操作,所以基于ubuntu16系统,这周学习了ThinkPHP页面跳转和重定向. 页面跳转 系统的Think\Controller类内置了两个页面跳转方法err ...
- setlocale - 设置当前的区域选项
总览 (SYNOPSIS) #include <locale.h> char *setlocale(int category, const char * locale); 描述 (DESC ...
- 2019牛客暑期多校训练营(第七场)E F H I
E Find the median 题意:每次往序列中增加连续的[l,r]的数,每加入一次就询问当前序列的中位数. 解法:此题没有要求在线,那么直接离线+线段树+二分就可以了.求出每个端点之后排序得到 ...