ElasticSearch部署,以及kibana安装

Stella981
• 阅读 500

1.环境要求:centos 7 ,jdk ,安装elasticsearch之前必须要安装好jdk

2.安装完成后,通过rpm方式安装elasticsearch-5.6.4.rpm

3.rpm -ivh elasticsearch-5.6.4.rpm安装完成后,查看是否为自启动systemctl list-unit-files|grep elasticsearch

查看为disabled 为非自启动

那么如何来设置自启动呢?systemctl enable elasticsearch

ElasticSearch部署,以及kibana安装

启动之前为elasticsearch配置jdk

vim /etc/sysconfig/elasticsearch 中修改JAVA_HOME路径的路径

ElasticSearch部署,以及kibana安装

ElasticSearch部署,以及kibana安装

还没有完,接下来配置核心配置文件和数据存储位置以及日志

核心文件

/etc/elasticsearch/elasticsearch.yml

数据文件路径

/var/lib/elasticsearch/

日志文件路径e

/var/log/elasticsearch/elasticsearch.log

修改配置文件 

vim /etc/elasticsearch/elasticsearch.yml

修改yml配置的注意事项:

每行必须顶格,不能有空格

“:”后面必须有一个空格

集群名称,同一集群名称必须相同

ElasticSearch部署,以及kibana安装

单个节点名称 

ElasticSearch部署,以及kibana安装

网络部分  改为当前的ip地址  ,端口号保持默认9200就行

ElasticSearch部署,以及kibana安装

把bootstrap自检程序关掉

ElasticSearch部署,以及kibana安装

bootstrap.system_call_filter: false

自发现配置:新节点向集群报到的主机名

# ======================== 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-es
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
#
# 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: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
#
# 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: 192.168.19.129
#
# Set a custom port for HTTP:
#
#http.port: 9200
#
# 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: ["liuyuan"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes: 3
#
# 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: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

                                                                                     
  1. 修改linux配置

为什么要修改linux配置?

默认elasticsearch是单机访问模式,就是只能自己访问自己。

但是我们之后一定会设置成允许应用服务器通过网络方式访问。这时,elasticsearch就会因为嫌弃单机版的低端默认配置而报错,甚至无法启动。

所以我们在这里就要把服务器的一些限制打开,能支持更多并发。

问题1:****max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536] elasticsearch

原因:系统允许 Elasticsearch 打开的最大文件数需要修改成65536

解决:vi /etc/security/limits.conf

添加内容:

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 65536

注意:“*” 不要省略掉

问题2:****max number of threads [1024] for user [judy2] likely too low, increase to at least [2048] (CentOS7.x 不用改)

原因:允许最大进程数修该成2048

解决:vi /etc/security/limits.d/90-nproc.conf   

修改如下内容:

* soft nproc 1024

#修改为

 * soft nproc 2048

问题3:****max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144] (CentOS7.x 不用改)

原因:一个进程可以拥有的虚拟内存区域的数量。

解决:可零时提高vm.max_map_count的大小

命令:sysctl -w vm.max_map_count=262144

重启:reboot

curl http://192.168.19.129:9200访问

ElasticSearch部署,以及kibana安装

成功

安装kibana解压即可用

拷贝kibana-5.6.4-linux-x86_64.tar 到/opt下

解压缩

进入kibana主目录的config目录下

vim  kibana.yml

server.host: “你本机ip”

ElasticSearch部署,以及kibana安装

启动

ElasticSearch部署,以及kibana安装

这属于前台启动,不好,关闭后,kibana即退出。用nohup ./kibana & 来替代。

ctrl + c 后

看进程:s -ef ,kibana进程名字不叫kibana,没法查,可以这个命令查最后的

ElasticSearch部署,以及kibana安装

浏览器访问:我的ip为192.168.19.129:5601访问kibana

https://192.168.19.129:5601/

kibana不能自启动,已亲测,重启后并不能访问,进入到姐以后的根目录的bin下执行nohup ./kibana & 就可以了

ElasticSearch部署,以及kibana安装

期间linux很卡cd /etc/elasticsearch

 vim jvm.options 

ElasticSearch部署,以及kibana安装

虚拟机配置了2G内存,沾满了,不过还可以用,是因为swap,交换分区当内存用。

点赞
收藏
评论区
推荐文章
blmius blmius
2年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Jacquelyn38 Jacquelyn38
2年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
Wesley13 Wesley13
2年前
Java获得今日零时零分零秒的时间(Date型)
publicDatezeroTime()throwsParseException{    DatetimenewDate();    SimpleDateFormatsimpnewSimpleDateFormat("yyyyMMdd00:00:00");    SimpleDateFormatsimp2newS
Wesley13 Wesley13
2年前
VirtualBox导入已安装好的操作系统的方法
VirtualBox导入已安装好的操作系统的方法1、修改UUID进入VirtualBox安装目录,运行VBoxManage修改UUID,命令运行如下:D:\\VirtualBoxVBoxManage.exe internalcommands setvdiuuid E:\\VirtualX
Wesley13 Wesley13
2年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
2年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
2年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Wesley13 Wesley13
2年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
2个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这