当前位置: 首页 > 编程日记 > 正文

elasticsearch-.yml(中文配置详解)

此elasticsearch-.yml配置文件,是在$ES_HOME/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 see the documentation for further information on configuration options:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html>
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
# 集群名称,默认是elasticsearch
# cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
# 节点名称,默认从elasticsearch-2.4.3/lib/elasticsearch-2.4.3.jar!config/names.txt中随机选择一个名称
# node.name: node-1
#
# Add custom attributes to the node:
#
# node.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
# 可以指定es的数据存储目录,默认存储在es_home/data目录下
# path.data: /path/to/data
#
# Path to log files:
# 可以指定es的日志存储目录,默认存储在es_home/logs目录下
# path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
# 锁定物理内存地址,防止elasticsearch内存被交换出去,也就是避免es使用swap交换分区
# bootstrap.memory_lock: true
#
#
#
# 确保ES_HEAP_SIZE参数设置为系统可用内存的一半左右
# Make sure that the `ES_HEAP_SIZE` environment variable is set to about half the memory
# available on the system and that the owner of the process is allowed to use this limit.
#
# 当系统进行内存交换的时候,es的性能很差
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
#
# 为es设置ip绑定,默认是127.0.0.1,也就是默认只能通过127.0.0.1 或者localhost才能访问
# es1.x版本默认绑定的是0.0.0.0 所以不需要配置,但是es2.x版本默认绑定的是127.0.0.1,需要配置
# Set the bind address to a specific IP (IPv4 or IPv6):
#
# network.host: 192.168.0.1
#
#
# 为es设置自定义端口,默认是9200
# 注意:在同一个服务器中启动多个es节点的话,默认监听的端口号会自动加1:例如:9200,9201,9202...
# Set a custom port for HTTP:
#
# http.port: 9200
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
#
# --------------------------------- Discovery ----------------------------------
#
# 当启动新节点时,通过这个ip列表进行节点发现,组建集群
# 默认节点列表:
# 127.0.0.1,表示ipv4的回环地址。
# [::1],表示ipv6的回环地址
#
# 在es1.x中默认使用的是组播(multicast)协议,默认会自动发现同一网段的es节点组建集群,
# 在es2.x中默认使用的是单播(unicast)协议,想要组建集群的话就需要在这指定要发现的节点信息了。
# 注意:如果是发现其他服务器中的es服务,可以不指定端口[默认9300],如果是发现同一个服务器中的es服务,就需要指定端口了。
# 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"]
#
#
#
#
# 通过配置这个参数来防止集群脑裂现象 (集群总节点数量/2)+1
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
# discovery.zen.minimum_master_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html>
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
# 一个集群中的N个节点启动后,才允许进行数据恢复处理,默认是1
# gateway.recover_after_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html>
#
# ---------------------------------- Various -----------------------------------
# 在一台服务器上禁止启动多个es服务
# Disable starting multiple nodes on a single system:
#
# node.max_local_storage_nodes: 1
#
# 设置是否可以通过正则或者_all删除或者关闭索引库,默认true表示必须需要显式指定索引库名称
# 生产环境建议设置为true,删除索引库的时候必须显式指定,否则可能会误删索引库中的索引库。
# Require explicit names when deleting indices:
#
# action.destructive_requires_name: true

 集群名称,默认是elasticsearch

输入,http://192.168.80.200:9200/

 默认存储在es_home/data目录下

total 60
drwxrwxr-x. 2 hadoop hadoop 4096 Feb 20 22:54 bin
drwxrwxr-x. 3 hadoop hadoop 4096 Feb 21 01:28 config
drwxrwxr-x. 3 hadoop hadoop 4096 Feb 20 22:59 data
drwxrwxr-x. 2 hadoop hadoop 4096 Feb 20 22:54 lib
-rw-rw-r--. 1 hadoop hadoop 11358 Aug 24 00:46 LICENSE.txt
drwxrwxr-x. 2 hadoop hadoop 4096 Feb 21 00:33 logs
drwxrwxr-x. 5 hadoop hadoop 4096 Dec 8 00:41 modules
-rw-rw-r--. 1 hadoop hadoop 150 Aug 24 00:46 NOTICE.txt
drwxrwxr-x. 4 hadoop hadoop 4096 Feb 21 23:13 plugins
-rw-rw-r--. 1 hadoop hadoop 8700 Aug 24 00:46 README.textile
-rw-rw-r--. 1 hadoop hadoop 288 Feb 21 07:07 request
[hadoop@djt002 elasticsearch-2.4.3]$ cd data/
[hadoop@djt002 data]$ pwd
/usr/local/elasticsearch/elasticsearch-2.4.3/data
[hadoop@djt002 data]$ ll
total 4
drwxrwxr-x. 3 hadoop hadoop 4096 Feb 20 23:00 elasticsearch
[hadoop@djt002 data]$ cd elasticsearch/
[hadoop@djt002 elasticsearch]$ ll
total 4
drwxrwxr-x. 3 hadoop hadoop 4096 Feb 20 23:00 nodes
[hadoop@djt002 elasticsearch]$ cd nodes/
[hadoop@djt002 nodes]$ ll
total 4
drwxrwxr-x. 4 hadoop hadoop 4096 Feb 21 22:51 0
[hadoop@djt002 nodes]$ cd 0
[hadoop@djt002 0]$ ll
total 8
drwxrwxr-x. 3 hadoop hadoop 4096 Feb 21 01:33 indices
-rw-rw-r--. 1 hadoop hadoop 0 Feb 20 23:00 node.lock
drwxrwxr-x. 2 hadoop hadoop 4096 Feb 21 22:51 _state
[hadoop@djt002 0]$

索引片段,里面存放着具体的数据

  如,segments_6,是在/usr/local/elasticsearch/elasticsearch-2.4.3/data/elasticsearch/nodes/0/indices/zhouls/0/index

drwxrwxr-x. 3 hadoop hadoop 4096 Feb 21 01:33 indices
-rw-rw-r--. 1 hadoop hadoop 0 Feb 20 23:00 node.lock
drwxrwxr-x. 2 hadoop hadoop 4096 Feb 21 22:51 _state
[hadoop@djt002 0]$ cd indices/
[hadoop@djt002 indices]$ ll
total 4
drwxrwxr-x. 8 hadoop hadoop 4096 Feb 21 00:33 zhouls
[hadoop@djt002 indices]$ cd zhouls/
[hadoop@djt002 zhouls]$ ll
total 24
drwxrwxr-x. 5 hadoop hadoop 4096 Feb 21 00:33 0
drwxrwxr-x. 5 hadoop hadoop 4096 Feb 21 00:33 1
drwxrwxr-x. 5 hadoop hadoop 4096 Feb 21 00:33 2
drwxrwxr-x. 5 hadoop hadoop 4096 Feb 21 00:33 3
drwxrwxr-x. 5 hadoop hadoop 4096 Feb 21 00:33 4
drwxrwxr-x. 2 hadoop hadoop 4096 Feb 21 22:51 _state
[hadoop@djt002 zhouls]$ cd 0
[hadoop@djt002 0]$ ll
total 12
drwxrwxr-x. 2 hadoop hadoop 4096 Feb 21 22:57 index
drwxrwxr-x. 2 hadoop hadoop 4096 Feb 21 22:51 _state
drwxrwxr-x. 2 hadoop hadoop 4096 Feb 21 22:51 translog
[hadoop@djt002 0]$ cd index/
[hadoop@djt002 index]$ pwd
/usr/local/elasticsearch/elasticsearch-2.4.3/data/elasticsearch/nodes/0/indices/zhouls/0/index
[hadoop@djt002 index]$ ll
total 16
-rw-rw-r--. 1 hadoop hadoop 363 Feb 21 03:35 _0.cfe
-rw-rw-r--. 1 hadoop hadoop 2488 Feb 21 03:35 _0.cfs
-rw-rw-r--. 1 hadoop hadoop 371 Feb 21 03:35 _0.si
-rw-rw-r--. 1 hadoop hadoop 224 Feb 21 22:57 segments_6
-rw-rw-r--. 1 hadoop hadoop 0 Feb 21 00:33 write.lock
[hadoop@djt002 index]$

总结

1、es已经为大多数参数设置合理的默认值

2、这个配置文件中列出来了针对生产环境下的一些重要配置

3、注意:这个文件是yaml格式的文件

(1):属性顶格写,不能有空格

(2):缩进一定不能使用tab制表符

(3):属性和值之间的:后面需要有空格

network.host: 192.168.80.200

4、es的1.*版本比2.*版本,这个配置文件多了很多属性,为什么2.*版本没了呢,因为,es很多地方做了默认配置。

更详细,请移步

ES配置文件中文版

相关文章:

SIFT 特征检测及匹配

#<opencv2/opencv.hpp> #include <opencv2/features2d/features2d.hpp> #include <opencv2/xfeatures2d/nonfree.hpp> #include <iostream>//using namespace cv::features2d; using namespace std; using namespace cv; // 计算图像的SIFT特征及匹配 …

详解Java中的复合视图设计模式

使用由多个子视图组成的复合视图。整个模板的每个子视图可以整体动态地包括在内&#xff0c;并且可以独立于内容来管理页面的布局。 Apache Tiles和SiteMesh 框架使用Composite View Design Pattern。 为简单起见&#xff0c;这种模式分为若干部分&#xff0c;如问题&#xff0…

CI流水线配置文件参数详解(一)

文章目录4. 参数详解(一)4.1 script4.2 image 指定使用Docker镜像。如 iamge:name &#xff0c;暂时忽略。4.3 before_script 用于定义在所有作业之前需要执行的命令&#xff0c;比如更新代码、安装依赖、打印调试信息之类的事情。4.4 after_script4.5 stages 定义流水线全局可…

Elasticsearch的前后台运行与停止(rpm包方式)

对应&#xff0c;这es的下载&#xff0c;需要rpm包。 Elasticsearch-2.4.3的下载&#xff08;图文详解&#xff09; 建议用root用户 [rootdjt002 elasticsearch-2.4.3]$ pwd/usr/local/elasticsearch/elasticsearch-2.4.3 [rootdjt002 elasticsearch-2.4.3]$ rpm -ivh elastic…

SURF 特征检测及匹配

#include <opencv2/opencv.hpp> #include <opencv2/xfeatures2d.hpp> #include <opencv2/xfeatures2d/nonfree.hpp> #include <iostream>using namespace cv::xfeatures2d; using namespace std; using namespace cv;// 计算图像的SURF特征及匹配 floa…

Mybatis源码阅读之三

2019独角兽企业重金招聘Python工程师标准>>> 由前面的系列二分析到MapperMethod的execute方法&#xff0c;我们接着分析MapperMethod。如下List-1: List-1 public class MapperMethod {private final SqlCommand command;private final MethodSignature method;publ…

Vim快捷键键位图

https://www.runoob.com/w3cnote/all-vim-cheatsheat.html

简单几步写一个laravel扩展包

为什么80%的码农都做不了架构师&#xff1f;>>> laravel使用composer来管理扩展包&#xff0c;理解composer和laravel的开发模式&#xff0c;可以通过简单的几个步骤&#xff0c;快速写出一个laravel扩展包。 全新的laravel5.4环境安装 composer create-project la…

ORB 特征检测与匹配

#include <opencv2/opencv.hpp> #include <opencv2/xfeatures2d.hpp> #include <opencv2/xfeatures2d/nonfree.hpp> #include <iostream>using namespace cv::xfeatures2d; using namespace std; using namespace cv; // 计算图像的ORB特征及匹配 cv::…

数据结构(队列实现篇)

在数据结构与算法中&#xff0c;队列queue是一种受限的线性储存结构&#xff0c;特殊之处在于它只允许在表的前端front进行删除操作&#xff0c;而在表的后端rear进行插入操作&#xff0c;和栈一样&#xff0c;队列是一种操作受限制的线性表。进行插入操作的端称为队尾&#xf…

Markdown编辑器使用

Markdown编辑器使用欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题&#xff0c;有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚…

HOGDescriptor 描述类

struct CV_EXPORTS HOGDescriptor {// 高斯平滑参数enum { DEFAULT_WIN_SIGMA -1 };// 检测窗口的最大数量enum { DEFAULT_NLEVELS 64 };// 描述符存储格式enum { DESCR_FORMAT_ROW_BY_ROW, DESCR_FORMAT_COL_BY_COL };// 创建了特征描述符和检测器HOGDescriptor(Size win_si…

Linux----进程概念

程序 : 程序指的是一系列有逻辑, 有顺序结构的指令.进程 : 进程从两个角度来说:1 用户角度: 进程从用户角度来说就是运行中的程序2 操作系统的角度: 进程是操作系统对运行中程序的描述信息, 叫做进程描述符(程序控制块)简称PCBPCB : 在Linux下PCB指的是在内核中的task_struct 结…

codecheck

codecheck scan-build: clang-tools集成的静态检查工具, 使用clang static analyzer进行静态检查&#xff0c;使用方便 https://clang-analyzer.llvm.org/scan-build.html https://manpages.ubuntu.com/manpages/bionic/man1/scan-build.1.html CodeChecker: 爱立信推出的静…

ubuntu安装chrome浏览器

PPA方法&#xff0c;免FQ&#xff0c;否则&#xff0c;你得FQ下载chrome&#xff0c;你Firefox VPN配置好了吗&#xff01;&#xff01;&#xff01; wget -q -O - https://raw.githubusercontent.com/longhr/ubuntu1604hub/master/linux_signing_key.pub | sudo apt-key add s…

java中的注解(二)

今天我继续来介绍java中的注解。注解与接口和类不同的是注解是不允许继承的&#xff0c;但是注解中有一个和继承有关的元注解&#xff1a;Inherited。如果我们在定义注解时候加上这个元注解那么我们就可以在子类中监测到该注解的存在。 Target(ElementType.TYPE) Inherited Ret…

【C++】random随机数与【C++11】/rand()和srand()的用法

文章目录随机数1. c 11 random随机数的使用&#xff08;推荐使用&#xff09;1.11.21.31.42.1 C中随机函数rand()和srand()的用法&#xff08;老本版&#xff09;2.2 限制随机数的范围随机数 C 提供了一组函数以生成和使用随机数字。随机数字就是从一组可能的值中进行随机选择…

快速区域积分直方图实现

void cacHOGinCell(Mat& HOGCellMat,Rect roi,std::vector<Mat>& integrals) {// 实现快速积分HOGint x0 roi.x,y0 roi.y;int x1 x0 roi.width&#xff1b;int y1 y0 roi.height;for(int i 0; i < NBINS; i){// 根据矩阵的上下左右坐标计算Mat integra…

Resultset获取行数和列数

为什么80%的码农都做不了架构师&#xff1f;>>> 在Java中&#xff0c;获得ResultSet的总行数的方法有以下几种。 第一种&#xff1a;利用ResultSet的getRow方法来获得ResultSet的总行数 Statement stmt con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,Re…

object.create()

语法&#xff1a; Object.create(proto, [propertiesObject]) //方法创建一个新对象&#xff0c;使用现有的对象来提供新创建的对象的proto。 参数&#xff1a;proto : 必须。表示新建对象的原型对象&#xff0c;即该参数会被赋值到目标对象(即新对象&#xff0c;或说是最后返回…

codecheck_use_record

文章目录Step 1: Integrate CodeChecker into your build systemStep 2: Analyze your codeStep 3: Run the analysisStep 4: View the analysis results in the command lineStep 5: Hint: You can do the 1st and the 2nd step in one round by executing checkstep 6: Expor…

centos6.5 rsync+inotify同步配置笔记

以两台服务器为例&#xff1a; 主服务器&#xff1a; 192.168.1.100 从服务器&#xff1a; 192.168.1.101 1.安装rsync (主服务器与从服务器同时安装) 使用xinetd管理rsync yum install rsync xinetd 设置开机启动 vi /etc/xinetd.d/rsync ... 修改为 disable no ... 启动xin…

HOG 特征计算实现

// 获取HOG直方图 cv::Mat getHog(Point pt,std::vector<Mat> &integrals) {// 判断当前点的位置是否符合条件 if( pt.x - R < 0 ||pt.y - R < 0 ||pt.x R > integrals[0].cols ||pt.y R > integrals[0].rows ){return Mat();}// 直方图Mat hist(Size(…

Spring+SpringMVC+Mybatis整合

一、简单测试工程搭建1、Mybatis所需要的的jar包&#xff08;包含数据库驱动包和相关的日志包&#xff09;、SpringMVC和Spring的jar包2、然后构建一个基本的工程&#xff0c;这里我们使用mapper代理的方式进行Mybatis的编写&#xff0c;关于mapper代理请参考Mybatis简单入门中…

【Tools】Markdown数学符号公式(史上最全公式表)

Markdown数学符号&公式 文章目录Markdown数学符号&公式1. 希腊字母表2. 希腊字母3. 数学符号表4. 数学符号5. 数学符号补充表6. 数学符号补充1. 希腊字母表 符号代码符号代码α\alphaα\alphaA\AlphaA\Alphaβ\betaβ\betaB\BetaB\Betaγ\gammaγ\gammaΓ\GammaΓ\gam…

Editplus下载、安装并最佳配色方案(强烈推荐)

不多说&#xff0c;直接上干货&#xff01; Editplus下载 第一步&#xff1a;进入官网 https://www.editplus.com/ 第二步&#xff1a;下载 https://www.editplus.com/download.html Editplus安装 我这里&#xff0c;直接以一个压缩包来安装&#xff0c;需要的&#xff0c;请…

MySQL数据库开发规范-EC

最近一段时间一边在线上抓取SQL来优化&#xff0c;一边在整理这个开发规范&#xff0c;尽量减少新的问题SQL进入生产库。今天也是对公司的开发做了一次培训&#xff0c;PPT就不放上来了&#xff0c;里面有十来个生产SQL的案例。因为规范大部分还是具有通用性&#xff0c;所以也…

操作系统与内存管理

操作系统内存管理 文章目录操作系统内存管理1. 虚拟地址空间2. 内存地址空间含义及分配3. 虚拟内存诞生的前世与今生&#xff1f;3.1 内存管理的好处3.2 **内存管理实现总体策略**4. 不同进程如何划分内存地址空间&#xff1f;5 内存分配与回收5.1 buffer和cache5.2 malloc背后…

圆形 LBP 特征

template <typename _Tp> staticinline void elbp_(InputArray _src, OutputArray _dst,int radius, int neighbors) {// 得到数据矩阵Mat src _src.getMat();// 输出矩阵_dst.create(src.rows-2*radius, src.cols-2*radius, CV_32SC1);Mat dst _dst.getMat();// 初始化…

40个Java多线程问题总结

&#xff08;转&#xff09; 这篇文章作者写的真是不错 40个问题汇总 1、多线程有什么用&#xff1f; 一个可能在很多人看来很扯淡的一个问题&#xff1a;我会用多线程就好了&#xff0c;还管它有什么用&#xff1f;在我看来&#xff0c;这个回答更扯淡。所谓"知其然知其所…