1)下载

Elasticsearch 6.3.1 地址:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.1.tar.gz

2)拷贝

拷贝到服务器上,解压:tar -xvzf elasticsearch-6.3.1.tar.gz 。解压后路径:/home/elasticsearch-6.3.1

3)创建用户

创建用户,创建esdata目录,并赋予权限

[root@bogon home]# adduser esuser
[root@bogon home]# cd /home
[root@bogon home]# mkdir -p esdata/data
[root@bogon home]# mkdir -p esdata/log
[root@bogon home]# chown -R esuser elasticsearch-6.3.
[root@bogon home]# chown -R esuser esdata

4)配置es

[root@bogon esdata]# cat /home/elasticsearch-6.3./config/elasticsearch.yml
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-
#
# Add custom attributes to the node:
#
node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /home/esdata/data
#
# Path to log files:
#
path.logs: /home/esdata/log
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
http.port:
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / + ):
#
#discovery.zen.minimum_master_nodes:
#
# For more information, consult the zen discovery module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
gateway.recover_after_nodes:
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
action.destructive_requires_name: true

5)配置系统

[root@bogon bin]#  vim /etc/security/limits.conf(在文件最后添加)
esuser hard nofile
esuser soft nofile
esuser soft memlock unlimited
esuser hard memlock unlimited

以上配置解决问题:

max file descriptors [] for elasticsearch process is too low, increase to at least []
memory locking requested for elasticsearch process but memory is not locked
[root@bogon bin]# sysctl -w vm.max_map_count=
vm.max_map_count =
[root@bogon bin]# more /proc/sys/vm/max_map_count

以上配置解决问题:

max virtual memory areas vm.max_map_count [] is too low, increase to at least []
[root@bogon logs]# visudo
。。。。。。。。
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
esuser ALL=(ALL) ALL
。。。。。。。。

以上配置解决某些情况下无法读写的问题

6)启动

[root@bogon ~]# cd /home/elasticsearch-6.3./bin/
[root@bogon bin]# su esuser
[esuser@bogon bin]$ ./elasticsearch
[--17T10::,][INFO ][o.e.n.Node ] [node-] initializing ...
[--17T10::,][INFO ][o.e.e.NodeEnvironment ] [node-] using [] data paths, mounts [[/ (rootfs)]], net usable_space [.1gb], net total_space [.6gb], types [rootfs]
[--17T10::,][INFO ][o.e.e.NodeEnvironment ] [node-] heap size [.3mb], compressed ordinary object pointers [true]
[--17T10::,][INFO ][o.e.n.Node ] [node-] node name [node-], node ID [cb69e4JjSBKeHJ9y-q-hNA]
[--17T10::,][INFO ][o.e.n.Node ] [node-] version[6.3.], pid[], build[default/tar/eb782d0/--29T21::.107521Z], OS[Linux/3.10.-514.6..el7.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) -Bit Server VM/1.8.0_92/25.92-b14]
[--17T10::,][INFO ][o.e.n.Node ] [node-] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch.F1Jh0AOB, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=, -XX:GCLogFileSize=64m, -Des.path.home=/home/elasticsearch-6.3., -Des.path.conf=/home/elasticsearch-6.3./config, -Des.distribution.flavor=default, -Des.distribution.type=tar]
[--17T10::,][INFO ][o.e.p.PluginsService ] [node-] loaded module [aggs-matrix-stats]
[--17T10::,][INFO ][o.e.p.PluginsService ] [node-] loaded module [analysis-common]
[--17T10::,][INFO ][o.e.p.PluginsService ] [node-] loaded module [ingest-common]
。。。。。。

7)验证

浏览器访问:http://192.168.20.115:9200/  (192.168.20.115是es服务器的IP,另外请确保9200端口能够被外部访问),返回:

{
"name" : "node-1",
"cluster_name" : "my-application",
"cluster_uuid" : "_na_",
"version" : {
"number" : "6.3.1",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "eb782d0",
"build_date" : "2018-06-29T21:59:26.107521Z",
"build_snapshot" : false,
"lucene_version" : "7.3.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}

当然最方便的安装方法还是下载docker镜像,官方安装手册:https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html  步骤:

1)下载镜像:docker pull docker.elastic.co/elasticsearch/elasticsearch:6.3.1

2)运行容器:docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.3.1

ElasticSearch Head安装

官方的模拟工具是控制台的curl,不是很直观,可以在chrome浏览器中安装head插件来作为请求的工具:head插件的地址:https://chrome.google.com/webstore/detail/elasticsearch-head/ffmkiejjmecolpfloofpjologoblkegm/

Centos7下安装配置elasticsearch 6.3.1的更多相关文章

  1. Centos7下安装配置Redsocks

    Redsocks是一个开源的网络程序,代码依赖开源的libevent网络库.Redsocks允许你将所有TCP连接重定向到SOCKS或HTTPS代理,比如Shadowsocks(Centos7下安装配 ...

  2. Centos7 下安装配置tomcat7

    首先下载压缩包 wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-7/v7.0.78/bin/apache-tomcat-7. ...

  3. centos7下安装配置prometheus

    prometheus官网:https://prometheus.io/download/ 搭建环境参考:https://blog.csdn.net/baidu_36943075/article/det ...

  4. centos7下安装配置jenkins+git+maven+jdk

    环境 centos7 jdk1.8 maven3 git 在安装jenkins之前,先安装jdk1.8.maven.git 一. 安装jdk1.8 第一步:下载 jdk-8u131-linux-x64 ...

  5. CentOS7下安装配置vncserver

    之前试了xmanager,不过好像和在centos6有很大不同,居然没成功,然后找到了vncserver,试了下,成了 参考:http://blog.csdn.net/jiangliqing1234/ ...

  6. Linux centos7下安装配置redis及Redis desktop Manager工具连接注意事项

    基本工具:VMware12.CentOS-7-x86_64-Everything-1611.iso.redis-desktop-manager-0.8.0.3841 废话不多说,首先,关于什么是Red ...

  7. centos7下安装配置redis3.0.4

    安装redis 1.进入redis官网(redis.io)下载redis稳定版安装包,目前稳定版本为3.0.4 2.在linux  /usr文件夹下新建redis文件夹,拷贝安装包redis-3.0. ...

  8. CentOS7下安装配置Nginx

    一:安装依赖项 1.pcre:2.openssl:3.zlib:4.gcc:可直接通过yum安装 二:创建nginx账户(可以配置nginx.conf的user为此账户) useradd nginx ...

  9. centos7下安装配置redis

    1.1. Redis下载安装(linux) 1.1.1. 下载: 下载地址:https://redis.io/download 选择合适的版本下载,如下图: 1.1.2. 安装: (1)把下载好的re ...

随机推荐

  1. 常见问题:bootstrap datepicker日期插件汉化

    引入简体中文js(bootstrap-datepicker.zh-CN.js),并在datepicker属性配置language为‘zh-CN’即可,示例如下: $(".form_datet ...

  2. CSS3_扇形导航_transitionend 事件

    扇形导航 圆形按钮,切换一系列图片导航的显示与隐藏. 如果涉及过渡动画,定位的 top 和 left 必须写 Math.sin(弧度) 一圈弧度 = 2π,一圈角度 = 360 弧度 = (deg*2 ...

  3. jQuery (02) 重点知识点总结

    jQuery 如果用户未登录,当加入购物车,会将商品相关信息存入 cookie 或者 session,这两个都是可以标识用户信息的东西 是一个 JavaScript 库,封装了常用的开发功能,和一些需 ...

  4. Jumpserver之安装在CentOS主机步骤

    环境 系统CentOS7.5 IP:172.16.90.248 关闭防火墙设置selinux systemctl stop firewalld setenforce 0 sed -i "s/ ...

  5. 学习ActiveMQ(四):spring与ActiveMQ整合

    在上一篇中已经怎么使用activemq的api来实现消息的发送接收了,但是在实际的开发过程中,我们很少使用activemq直接上去使用,因为我们每次都要创建连接工厂,创建连接,创建session... ...

  6. 通过Ajax方式上传文件(input file),使用FormData进行Ajax请求

    <script type="text/jscript"> $(function () { $("#btn_uploadimg").click(fun ...

  7. python之dict

    一.字典的定义 在python中,字典数据类型使用{}来定义,在大括号中,存储的是键值对,即key:value的形式,并且key不能有重复值,如果有重复,后面的值会覆盖前面的:值可以重复 # 字典的定 ...

  8. IIS宿主WCF服务*.svc Mime类型映射

    经常会遇到由于.net安装组件缺失,导致发布wcf服务后,访问wcf报.svc请求类型不支持 简单方法就是添加删除程序,修改.net组件安装选项,勾选http激活即可: 或者手工添加映射处理程序 1. ...

  9. datetime 计算时间差

    计算时间差: .date()       # 格式化 .timedelta()         # 时间差 import datetime # 今天 today = datetime.datetime ...

  10. JAVA学习笔记 (okHttp3的用法)

    最近的项目中有个接口是返回文件流数据,根据我们这边一个验签的插件,我发现里面有okHttpClient提供了Call.Factory,所以就学习了下okHttp3的用法. 1.概述 okhttp是一个 ...