美文网首页
ElsaticSearch安装

ElsaticSearch安装

作者: 年少时难免轻狂Ho | 来源:发表于2018-11-27 11:34 被阅读0次
与传统数据库之间的关系
Mysql ElasticSearch
数据库 索引(Index)
类型(Type)
文档(Document)
字段(Fields)

一、ElasticSearch安装

在官网下载elasticsearch安装包

elasticsearch官网下载地址

解压

将下载好的tar.gz解压导非root用户下

启动

./bin/elasticsearch

注意,可能出现的问题

1、max virtual memory areas vm.maxmapcount [65530] is too low
解决办法
执行以下命令
sudo sysctl -w vm.max_map_count=262144
1、max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
解决办法

切换到root用户修改

vim /etc/security/limits.conf
在最后面追加下面内容
*** hard nofile 65536
*** soft nofile 65536
***  是启动ES的用户

查看运行状态

如果一切正常,Elastic 就会在默认的9200端口运行。这时,打开另一个命令行窗口,请求该端口,会得到说明信息。

Last login: Tue Nov 27 15:45:43 2018 from 10.4.16.221
[ocetl@yxd ~]$  curl localhost:9200
{
  "name" : "Co8jWPC",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "LVSr1P32SNG9ySN11vYrPQ",
  "version" : {
    "number" : "6.5.1",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "8c58350",
    "build_date" : "2018-11-16T02:22:42.182257Z",
    "build_snapshot" : false,
    "lucene_version" : "7.5.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}
[ocetl@yxd ~]$ 

按下 Ctrl + C,Elastic 就会停止运行。

上面代码中,请求9200端口,Elastic 返回一个 JSON 对象,包含当前节点、集群、版本等信息。
默认情况下,Elastic 只允许本机访问,如果需要远程访问,可以修改 Elastic 安装目录的config/elasticsearch.yml文件,去掉network.host的注释,将它的值改成0.0.0.0,然后重新启动 Elastic。

# ---------------------------------- 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: 9200
#
# For more information, consult the network module documentation.

注意:上面代码中,设成0.0.0.0让任何人都可以访问。线上服务不要这样设置,要设成具体的 IP。
将networkhost的值修改之后我们可以在浏览器中访问elasticsearch了


二、基本说明

Node与Claster

Elastic本质上是一种分布式数据库,允许多台服务器系统工作,每台服务器上也可以运行多个Elastic实例。
单个Elsatic成为一个节点(Node),一组具有相同cluster.name的节点成为集群(Claster)。

相关文章

  • ElsaticSearch安装

    与传统数据库之间的关系 一、ElasticSearch安装 在官网下载elasticsearch安装包 elast...

  • ElsaticSearch Curl

    Basic Concepts Cluster 集群 Node 节点 Index 索引(全部小写) Type 索引类...

  • Elasticsearch 简介和实战

    最近项目要用到全文搜索,需要有中文、拼音检索以及混合搜索以及数据聚合功能,使用到了 Elsaticsearch 关...

  • docker elsaticsearch cluster con

    elasticsearch 5.0需要指定绑定ip,不指定的情况下默认会绑定到127.0.0.1上,导致集群节点不...

  • es(elsaticsearch6)入门

    1.需要准备的资料链接2.es安装与集群配置3.head插件安装4.es基本用法5.es高级用法6.springb...

  • ubuntu ppa PHP

    安装mysql 安装php 安装nginx 安装Chrome 安装dock 安装node 安装wine 官方源列表梯子

  • 从零开始在 Ubuntu  下部署 Django + uwsgi

    整体安装流程 安装 ubuntu ,安装 pip, 安装 uwsgi, 安装 django安装 nginx整个请求...

  • step one

    安装chrome 安装terminator 安装nodejs 安装apache2 安装php7 安装mysql 重...

  • centos安装lnmp,redis

    安装nginx 安装nginx源 安装nginx 启动nginx 安装MySQL5.7.* 安装mysql源 安装...

  • liunx实操(centOS 6.8)

    初始化 配置JDK 安装tomcat 安装maven 安装vsftpd 安装Nginx 安装mysql 安装git...

网友评论

      本文标题:ElsaticSearch安装

      本文链接:https://www.haomeiwen.com/subject/vjxgqqtx.html