elasticsearch6.5.x-centos6

elasticsearch 和 关系型数据库中的类比

es ====== RDBMS index ----- database type ------ table document ---- row field ----- field

elasticsearch 集群概念介绍

  1. Node: 单个装有elasticsearch服务并且提供故障转移和扩展的服务器

  2. cluster: 一个集群就是由一个或多个node组织在一起,共同工作,共同分享整个数据具有负载功能的服务器群。

  3. Document :一个文档是一个可以被索引的基础信息单元

  4. Index : 索引就是一个拥有几分相似特征的文档的集合

  5. Type : 一个索引中,你可以定义一种或多种类型

  6. Field : Field是elasticsearch的最小单位,相当于数据的某一列。

  7. shards: elasticsearch将索引分成若干份,每个部分就是一个shards。

  8. Replicas :Replicas 是索引一份或者多分拷贝。

RESTfull API

  1.  GET         用来获取资源      
     POST         用来新建资源,也可以用于更新资源
     PUT         用于更新资源
     DELETE       用于删除资源

curl 命令的简单使用

  1.  # 访问一个网页
     curl www.baidu.com
     
     # 将响应的内容保存到指定文件中
     curl -o test.html www.baidu.com
     
     # 显示响应头的信息
     curl -i www.baidu.com
     
     # 显示HTTP的通信过程
     curl -v www.baidu.com
     
     # 执行 PUT/POST/GET/DELETE 操作
     curl -X GET/POST/PUT/DELETE url
     

elasticsearch 6 on centos6 安装部署

  1. 安装java8

  2. 直接解压执行

  1.  # 启动
     bin/elasticsearch
     
     # 后台启动
     bin/elasticsearch -d
     
     # 测试是否安装成功, 有数据返回表示安装成功
     curl localhost:9200
     
  1. 配置elasticsearch的远程访问

  1.  /opt/modules/elasticsearch-6.5.0/config
     vim elasticsearch.yml
     # 修改主机地址,配置任何ip都可以访问
     network.host: 0.0.0.0
     
     # tcp port for transport client
     transport.tcp.port: 9300
     
     # http port for restful interface
     http.port: 9200
     
     
     # centos6不支持SecComp,启动时会检测失败,导致不能启动所以要添加
     bootstrap.memory_lock: false
     bootstrap.system_call_filter: false
     
     # 配置elasticsearch跨域访问
     http.cors.enabled: true
     http.cors.allow-origin: "*"
     
     # * 注意在yml文件中写配置的时候 :后面必须有空格,否则无法正确读取配置,导致启动失败
  1. 配置Linux

  1.  vim /etc/sysctl.conf
     在后面追加
     # elasticsearch config
     vm.max_map_count=655360
     
     
     修改完后需要立即生效一下,执行下面的命令
     /sbin/sysctl -p
     
     
     vim /etc/security/limits.d/test-limits.conf
     添加
       * soft nofile 65536
       * hard nofile 131072
       * soft nproc 4096
       * hard nproc 4096
     
     
     vim /etc/security/limits.conf
     # 在最后面追加下面内容
     *** hard nofile 65536
     *** soft nofile 65536
     *** soft nproc 4096
     *** soft nproc 4096
     
     # *** 是启动ES的用户
     
     
     ## 最后在浏览器中验证
     master9200
     192.168.181.200:9200
     

elasticsearch 配置中文IK分词器

  1.  # 1. 使用es命令自动安装
     bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.5.1/elasticsearch-analysis-ik-6.5.1.zip
     
     -> Downloading https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.5.1/elasticsearch-analysis-ik-6.5.1.zip
     [=================================================] 100%  
     -> Installed analysis-ik
     
     2. 自己下载,地址:https://github.com/medcl/elasticsearch-analysis-ik/releases
     然后在将下载的zip包安装到elasticsearch-home/plugins/ik/目录下,是自己创建的存放分词器插件的文件夹
     [es6user@master ik]$ pwd
     /opt/modules/elasticsearch-6.5.1/plugins/ik
     [es6user@master ik]$ unzip elasticsearch-analysis-ik-6.5.1.zip
     
     

安装中出现的问题

  1.  # 不能直接使用root用户登录,可以通过添加配置解决,但是不推荐这么做,建议创建一个单独的用户来操作
     bin/elasticsearch -Des.insecure.allow.root=true
     或者修改elasticsearch脚本,添加:
     ES_JAVA_OPTS=*.-Des.insecure.allow.root=true*
     
     # 建议创建一个单独的用户来操作
     groupadd esgroup
     useradd esuser -g esgroup -p espassword
     cd /opt/modules
     chown -R esuser:esgroup elasticsearch-6.4
     su esuser
     

ERROR

Elasticsearch6.4修改配置文件./bin/elasticsearch.yml的network.host:0.0.0.0,启动报:max number of threads [2048] for user [es] is too low, increase to at least [4096]

  1.  解决办法:
     新建(为方便删除)
                 /etc/security/limits.d/test-limits.conf
     
     添加
                 * soft nofile 65536
                 * hard nofile 131072
                 * soft nproc 4096
                 * hard nproc 4096
     
     

Exception in thread "main" java.nio.file.AccessDeniedException: /root/home/searchengine/elasticsearch-6.2.4/config/jvm.options

  1.  # 这个错误是因为没有执行权限
     chown -R abc:abc elasticsearch-6.4

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

  1.  elasticsearch安装时遇到的错误
     
     问题翻译过来就是:elasticsearch用户拥有的可创建文件描述的权限太低,至少需要65536
     
     解决办法:
     
     #切换到root用户修改
     vim /etc/security/limits.conf
     
     # 在最后面追加下面内容
     *** hard nofile 65536
     *** soft nofile 65536
     *** soft nproc 4096
     *** soft nproc 4096
     
     *** 是启动ES的用户
     

ERROR: java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed

启动中出现的异常: 原因:  因为Centos6不支持SecComp,而ES默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动解决:修改elasticsearch.yml 添加一下内容 :

  1.  bootstrap.memory_lock: false
     bootstrap.system_call_filter: false

elasticsearch6.5.x-centos6的更多相关文章

  1. Filebeat+ELK部署文档

    在日常运维工作中,对于系统和业务日志的处理尤为重要.今天,在这里分享一下自己部署的Filebeat+ELK开源实时日志分析平台的记录过程,有不对的地方还望指出. 简单介绍: 日志主要包括系统日志.应用 ...

  2. elasticsearch6.6.2在Centos6.9的安装

    JDK8 做个记录,以防以后忘记能够查看. 1.elastic是java编写的,先搭建运行环境,6.6.2版本必须要jdk8以上版本才可运行,先官网下载jdk,上传服务器 https://www.or ...

  3. CentOS6.5安装ElasticSearch6.2.3

    CentOS6.5安装ElasticSearch6.2.3 1.Elastic 需要 Java 8 环境.(安装步骤:http://www.cnblogs.com/hunttown/p/5450463 ...

  4. centos6安装elasticsearch6.0

    环境准备 1台centos6操作系统主机,关闭selinux及iptables官方下载elasticsearch6.0软件包:https://artifacts.elastic.co/...官方下载j ...

  5. Linux环境CentOS6.9安装配置Elasticsearch6.2.2最全详细教程

    Linux环境CentOS6.9安装配置Elasticsearch6.2.2最全详细教程 前言 第一步:下载Elasticsearch6.2.2 第二步:创建应用程序目录 第四步:创建Elastics ...

  6. 【ELK】之Centos6.9_x64安装elasticsearch6.2.1

    1.下载elasticsearch6.2.1 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.1 ...

  7. centos6.10搭建ELK之elasticsearch6.5.4

    1.环境准备 1.1.安装java环境版本不要低于java8 # java -version java version "1.8.0_191" Java(TM) SE Runtim ...

  8. ElasticSearch-6.3.2 linux 安装

    在linux 系统安装ElasticSearch-6.3.2最新版本,也适合6.x 系列版本做参考 前提先在linux 安装好jdk1.8 创建用户 从5.0开始,ElasticSearch 安全级别 ...

  9. elasticsearch6.6及其插件安装记录(较详细)

    借鉴网上资料并实施验证结果 elasticsearch6.6安装 安装包下载路径 https://www.elastic.co/downloads/elasticsearch 本文使用安装包 elas ...

  10. Elasticsearch6.x和Kibana6.x的安装

    Elasticsearch6.x的安装(centos6.x下) Elasticsearch6.x目前需要至少jdk8的支持,关于如何安装jdk不在讲述.Oracle的推荐安装文档可以在Oracle的网 ...

随机推荐

  1. tp5 删除图片以及文件

    控制器调用 /** * [delimg 删除单张图片] * @return [type] [description] */ public function delimg(){ if (request( ...

  2. bootstrap-datetimepicker的两种版本

    1.引入js/css <link rel="stylesheet" th:href="@{/plugin/bootstrap-datetimepicker/boot ...

  3. ServiceStage-华为微服务开发与管理平台

    前言 在上一篇文章一年前,我来到国企搞IT 中,和小伙伴分享了我在国企这一年当中的所见,所闻,所想,很高兴能够获得很多同道中人的共鸣.过去一年,我的很大一部分工作都投入到公司技术平台的建设中.Jira ...

  4. 两年经验拿到蚂蚁金服,字节offer,附上金九银十BAT面试核心知识点整理

    前言 我自己是本科毕业后在老东家干了两年多,老东家算是一家"小公司"(毕竟这年头没有 BAT 或 TMD 的 title 都不好意思报出身),毕业这两年多我也没有在大厂待过,因此找 ...

  5. Word文档数据被误删了怎么办,还能恢复吗

    很多时候由于时间紧张或者是思路不想被打断,我们在编辑Word时不能及时的手动保存,一旦遇到电脑意外断电的情况可能就会导致编辑好的Word文档内容丢失.或者是文档编辑好了之后,Word提示是否保存时,误 ...

  6. appium元素定位工具

      appium元素定位工具介绍 使用uiautomatorviewer定位工具 使用Appium Inspector定位工具 使用uiautomatorviewer定位工具 谷歌在Android S ...

  7. IDEA创建web工程(超简单)

    Idea创建Web工程 以新建模块为例. 新建Maven项目 勾选[Create from artchetype] 选择[org.apache.maven.archetypes:maven-arche ...

  8. 第3.6节 Python字符串基础知识

    一. 引言 前面第二章已经接单介绍了字符串,本来计划讲完列表解析和字典解析再来精讲字符串的内容,但发现要讲列表解析和字典解析需要介绍迭代器和生成器,这个概念比较复杂,老猿还需要复习和验证一下才能完全掌 ...

  9. Python使用import导入模块时执行了模块的文件但报ModuleNotFoundError错误的愚蠢问题

    老猿在学习import导入自定义模块时,搜索路径中sys.path中已经添加对应路径,发现会报ModuleNotFoundError,但对应的模块代码被执行了,代码myfib.py如下: def fi ...

  10. 第12.7节 Python标准库内置模块小结

    本章老猿走马观花般的介绍了一下前面没有介绍的内置模块,内容很多,介绍的很泛,介绍的目的只是让大家知道有哪些内置模块.大致的功能有哪些,以后要使用时大家可以再去详细研究.之所以采用这种方式,一是老猿时间 ...