ElasticSearch初学

 ElasticSearch 默认端口 

ElasticSearch是一个搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口。Elasticsearch是用Java开发的,并作为Apache许可条款下的开放源码发布,是当前流行的企业级搜索引擎。设计用于云计算中,能够达到实时搜索,稳定,可靠,快速,安装使用方便。

1.存储

ElasticSearch 是以json文档格式进行数据存储

先建立一个 索引(index名称的索引,相当于mysql中的数据库),在索引下建立一个类型(type名称的类型,相当于mysql中的表),在类型(表)中加入文档(document),文档中有字段(field),描述字段,字段属性使用(mapping)。

2.访问

     a.ElasticSearch可以使用 RestFull 风格进行 get post  put delete 来进行操作

     b.ElasticSearch还可以使用Crul命令    (示例 访问一个网页,crul www.baidu.com,显示头信息 crul  -i www.baidu.com,显示一次HTTP请求的通信过程   -v,执行GET,POST,PUT,DELETE操作 crul -x get/post/delete/put url

3.安装

    a.需要JDK环境。

    b.官网下载:https://www.elastic.co/downloads/elasticsearch  下载后解压缩

4.启动 

    a.在bin目录下 执行 ./elasticsearch

 (1) 启动后一下错误    

     不能使用 root用户启动

  决定方法       a. 在bin/elasticsearech 加入   ES_JAVA-OPTS="-Des.insecure.allow.root=ture" 

                       b.启动时加上     -Des.insecure.allow.root=ture 

(2)启动错误        

    为了安全考虑报错

     解决方法  a. 建一个用户   用做启动 elasticsearech

                groupadd esgroup   创建用户得先创建组   

                 useradd esuser -g esgroup -p xiansen 

                更改  elasticsearch 文件及内部文件的所属用户及组别 在elasticsearch-6.2.4上一目录执行  chown -R esuser.esgroup elasticsearch-6.2.4  切换 用户  su esuser

有可能出现以下安装问题

      

猜你喜欢

转载自blog.csdn.net/weixin_40813139/article/details/84062148