`
sillycat
  • 浏览: 2542374 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

ElasticSearch(3)Version Upgrade and Cluster

 
阅读更多
ElasticSearch(3)Version Upgrade and Cluster

Haha, the first version I start with Elastic Search is 1.4.0.

Last time, I install the softwares are version 6.2.4. Right now, it is 7.0.1. Haha. Let’s try the latest on my systems.

First of All, on MAC
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.0.1-darwin-x86_64.tar.gz

Unzip the file and install in the default directory
> sudo ln -s /Users/hluo/tool/elasticsearch-7.0.1 /opt/elasticsearch-7.0.1
> sudo ln -s /opt/elasticsearch-7.0.1 /opt/elasticsearch

It is already in my path
export PATH=/opt/elasticsearch/bin:$PATH

This command is coming from he old version, it does not be needed here now.
> bin/elasticsearch-plugin install x-pack
ERROR: this distribution of Elasticsearch contains X-Pack by default

Start Elasticsearch with this command
> bin/elasticsearch

After start, visit the Web Page
http://localhost:9200/

Download and Install kibana
https://artifacts.elastic.co/downloads/kibana/kibana-7.0.1-darwin-x86_64.tar.gz

> sudo ln -s /Users/hluo/tool/kibana-7.0.1 /opt/kibana-7.0.1
> sudo ln -s /opt/kibana-7.0.1 /opt/kibana

Kibana is added to my path as well
export PATH=/opt/kibana/bin:$PATH

Edit and Check the configuration
> vi config/kibana.yml
elasticsearch.hosts: ["http://localhost:9200"]

Start the Kibana
> bin/kibana

Visit the WebPage
http://localhost:5601/app/kibana

Elastic Search and Kibana on Ubuntu
Find the Elastic Search download here
https://www.elastic.co/downloads/elasticsearch

> wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.0.1-linux-x86_64.tar.gz

Find the Kibana download from here
https://www.elastic.co/downloads/kibana

> wget https://artifacts.elastic.co/downloads/kibana/kibana-7.0.1-linux-x86_64.tar.gz

Unzip these 2 files and place in the working directory
> sudo ln -s /home/carl/tool/elasticsearch-7.0.1 /opt/elasticsearch-7.0.1
> sudo ln -s /home/carl/tool/kibana-7.0.1 /opt/kibana-7.0.1

> sudo ln -s /opt/elasticsearch-7.0.1 /opt/elasticsearch
> sudo ln -s /opt/kibana-7.0.1 /opt/kibana

When I change the binding IP for Elastic Search, I get error when I start the instance.

> cat config/elasticsearch.yml
network.host: 192.168.56.101
http.port: 9200

bound or publishing to a non-loopback address, enforcing bootstrap checks

Add these to the configuration works
transport.host: localhost
transport.tcp.port: 9300
http.port: 9200
network.host: 0.0.0.0

Kibana Network Configuration
The configuration file is as follow
> cat config/kibana.yml
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://localhost:9200"]

After that, we can visit these pages:
http://ubuntu-master:9200/
http://ubuntu-master:5601

Here is one Compose Configuration to Run elasticsearch1, elasticsearch2, elasticsearch3 and kibana

docker-compose.yml
version: '3.7'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.0.1
    container_name: elasticsearch1
    environment:
      - node.name=elasticsearch1
      - cluster.name=docker-cluster
      - cluster.initial_master_nodes=elasticsearch1
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512M -Xmx512M"
      - http.cors.enabled=true
      - http.cors.allow-origin=*
      - network.host=_eth0_
    ulimits:
      nproc: 65535
      memlock:
        soft: -1
        hard: -1
    cap_add:
      - ALL
    # privileged: true
    deploy:
      replicas: 1
      update_config:
        parallelism: 1
        delay: 10s
      resources:
        limits:
          cpus: '1'
          memory: 512M
        reservations:
          cpus: '1'
          memory: 512M
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 10s
    volumes:
      # - "./data/logs:/var/log"
      # - "./data/loc_esdata1:/usr/share/elasticsearch/data"
      - type: volume
        source: logs
        target: /var/log
      - type: volume
        source: loc_esdata1
        target: /usr/share/elasticsearch/data
    networks:
      - elastic
      - ingress
    ports:
      - 9200:9200
      - 9300:9300

  elasticsearch2:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.0.1
    container_name: elasticsearch2
    environment:
      - node.name=elasticsearch2
      - cluster.name=docker-cluster
      - cluster.initial_master_nodes=elasticsearch1
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512M -Xmx512M"
      - "discovery.zen.ping.unicast.hosts=elasticsearch1"
      - http.cors.enabled=true
      - http.cors.allow-origin=*
      - network.host=_eth0_
    ulimits:
      nproc: 65535
      memlock:
        soft: -1
        hard: -1
    cap_add:
      - ALL
    # privileged: true
    deploy:
      replicas: 1
      update_config:
        parallelism: 1
        delay: 10s
      resources:
        limits:
          cpus: '1'
          memory: 512M
        reservations:
          cpus: '1'
          memory: 512M
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 10s
    volumes:
      # - "./data/logs:/var/log"
      # - "./data/loc_esdata2:/usr/share/elasticsearch/data"     
      - type: volume
        source: logs
        target: /var/log
      - type: volume
        source: loc_esdata2
        target: /usr/share/elasticsearch/data
    networks:
      - elastic
      - ingress
    ports:
      - 9201:9200

  elasticsearch3:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.0.1
    container_name: elasticsearch3
    environment:
      - node.name=elasticsearch3
      - cluster.name=docker-cluster
      - cluster.initial_master_nodes=elasticsearch1
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512M -Xmx512M"
      - "discovery.zen.ping.unicast.hosts=elasticsearch1"
      - http.cors.enabled=true
      - http.cors.allow-origin=*
      - network.host=_eth0_
    ulimits:
      nproc: 65535
      memlock:
        soft: -1
        hard: -1
    cap_add:
      - ALL
    # privileged: true
    deploy:
      replicas: 1
      update_config:
        parallelism: 1
        delay: 10s
      resources:
        limits:
          cpus: '1'
          memory: 512M
        reservations:
          cpus: '1'
          memory: 512M
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 10s
    volumes:
      # - "./data/logs:/var/log"
      # - "./data/loc_esdata3:/usr/share/elasticsearch/data"     
      - type: volume
        source: logs
        target: /var/log
      - type: volume
        source: loc_esdata3
        target: /usr/share/elasticsearch/data
    networks:
      - elastic
      - ingress
    ports:
      - 9202:9200

  kibana:
    image: docker.elastic.co/kibana/kibana:7.0.1
    container_name: kibana
    environment:
      SERVER_NAME: localhost
      ELASTICSEARCH_URL: http://elasticsearch1:9200/
    ports:
      - 5601:5601
    volumes:
      - type: volume
        source: logs
        target: /var/log
    ulimits:
      nproc: 65535
      memlock:
        soft: -1
        hard: -1
    cap_add:
      - ALL
    deploy:
      replicas: 1
      update_config:
        parallelism: 1
        delay: 10s
      resources:
        limits:
          cpus: '1'
          memory: 512M
        reservations:
          cpus: '1'
          memory: 512M
      restart_policy:
        condition: on-failure
        delay: 30s
        max_attempts: 3
        window: 120s
    networks:
      - elastic
      - ingress
     
  headPlugin:
    image: 'mobz/elasticsearch-head:5'
    container_name: head
    ports:
      - '9100:9100'
    networks:
      - elastic

volumes:
  loc_esdata1:
  loc_esdata2:
  loc_esdata3:
  logs:

networks:
  elastic:
  ingress:

Then we can build and run
> docker-compose up -d

Start the service
> docker-compose start


Some other command
# up
docker-compose up -d

# down
docker-compose down

# down and remove volume
docker-compose down -v

# stop
docker-compose stop

# pause
docker-compose pause

# start
docker-compose start

# remove
docker-compose rm

Then we can visit
http://localhost:5601/app/kibana#/home?_g=()

Cluster Info
http://localhost:9100/

Elastic search node
http://localhost:9201/

Near Realtime(NRT) - Elasticsearch is a near-realtime search platform. There is a slight latency (normally one second) from the time you index a document until the time it becomes searchable.

Cluster - multiple nodes with a cluster name.
Node - its name is an UUID. ( a random Universally Unique IDentifier )  A note can be configured to join a specific Cluster by the cluster name.
            If you start the first node, it will by default form a new single-node cluster named elasticsearch.
Index - An index is a collection of documents. An index is identified by a name( that must be all lowercase)
Document - A document is a basic unit of information that can be indexed.
Shards & Replicas - Elasticsearch provides the ability to subdivide your index into multiple pieces called shards. Replica provides high availability in case a shard/node fails. The number of shards and replicas can be defined per index at the time the index is created. You can change the number of shards for an existing index using the _shrink and _split APIs.

The latest Version I get from the Document, but I think we can only download the 7.0.1 Version.
> curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.0-linux-x86_64.tar.gz

I should use this document
https://www.elastic.co/guide/en/elasticsearch/reference/7.0/getting-started-install.html

Start the First Node
> bin/elasticsearch -Ecluster.name=sillycatcluster -Enode.name=elastic1

Here is the information after started
http://ubuntu-master:9200/

{
  "name": "elastic1",
  "cluster_name": "sillycatcluster",
  "cluster_uuid": "szdcUtvTQaK4Taz63-nKGQ",
  "version": {
    "number": "7.0.1",
    "build_flavor": "default",
    "build_type": "tar",
    "build_hash": "e4efcb5",
    "build_date": "2019-04-29T12:56:03.145736Z",
    "build_snapshot": false,
    "lucene_version": "8.0.0",
    "minimum_wire_compatibility_version": "6.7.0",
    "minimum_index_compatibility_version": "6.0.0-beta1"
  },
  "tagline": "You Know, for Search"
}




References:
https://www.elastic.co/downloads/elasticsearch
https://www.elastic.co/downloads/kibana
https://stackoverflow.com/questions/34661210/how-to-bind-kibana-to-multiple-host-names-ips
https://www.elastic.co/guide/en/elasticsearch/reference/7.x/index.html
https://www.elastic.co/guide/en/elasticsearch/reference/7.0/getting-started-install.html
分享到:
评论

相关推荐

    Elasticsearch7.17.3全家桶

    elasticsearch-7.17.3-windows-x86_64.zip(windows-64位的es-7.17.3版本) elasticsearch-analysis-ik-7.17.3.zip(ik分词器) elasticsearch-head-5.0.0.zip(管理和监控Elasticsearch集群的插件,web界面)

    elasticsearch-7.17.3

    Elasticsearch 7.17.3 是一个高度可扩展的开源全文搜索引擎,以其强大的分布式、实时搜索和分析能力而闻名。它基于Lucene构建,但提供了更高级别的API和服务,使得管理和操作大规模数据变得更加简单。这个版本的...

    elasticsearch-analysis-ik-7.16.3.zip

    在现代大数据分析和搜索引擎领域,Elasticsearch(ES)因其高效、灵活的全文检索能力而备受青睐。然而,对于中文这样的多字节语言,如何准确地进行分词是关键。这时,我们就需要引入专门的中文分词器。本文将详细...

    spring-data-elasticsearch

    3. QueryDSL支持:Spring Data Elasticsearch支持使用QueryDSL来进行强类型的查询定义。QueryDSL是一种Java语言的类型安全的查询构建框架,它可以用来生成静态类型的查询。通过QueryDSL,开发者可以更清晰地构建查询...

    windows版本ES7.17.3中文分词器elasticsearch-analysis-ik-7.17.3 .zip

    用于elasticsearch7.17.3这个版本的ik中文分词器,考虑到官网有时网络不稳定下载不下来,这里特意上传,方便大家使用; 目录结构如下: config -- 文件夹 plugin-security.policy plugin-descriptor.properties ...

    最新版linux elasticsearch-7.9.3-linux-x86_64.tar.gz

    首先,`elasticsearch-7.9.3-linux-x86_64.tar.gz`是一个压缩文件,包含了Elasticsearch 7.9.3版本的所有必要组件。在Linux环境下,我们可以使用`tar`命令来解压这个文件: ```bash tar -zxvf elasticsearch-7.9.3-...

    Learning Elasticsearch 【含代码】

    You will install and set up Elasticsearch and its related plugins, and handle documents using the Distributed Document Store. You will see how to query, search, and index your data, and perform ...

    Elastic Search搭建使用教程.pdf(内含ElasticSearch教程权威指南)

    Cluster是由多个Node组成的,每个Cluster都有一个唯一的集群名称,默认为"elasticsearch"。Index是Elasticsearch中管理数据的顶层单位,相当于数据库中的表,数据以JSON格式存储在Document中。Document是Index中的单...

    elasticsearch7.17.10-最新支持Java1.8版本

    3. 启动:执行解压目录下的`bin/elasticsearch`脚本启动服务。 4. 验证:访问`http://localhost:9200`检查Elasticsearch是否正常运行。 **应用示例:** Elasticsearch广泛应用于日志分析、网站搜索、实时监控、...

    springMVC整合elasticsearch,基于maven

    在IT行业中,SpringMVC和Elasticsearch是两个非常重要的技术组件。SpringMVC作为Spring框架的一部分,主要用于构建Web应用程序的模型-视图-控制器(MVC)架构,而Elasticsearch则是一种分布式、RESTful风格的搜索和...

    (狂神)ElasticSearch快速入门笔记,ElasticSearch基本操作以及爬虫(Java-ES仿京东实战)

    (狂神)ElasticSearch快速入门笔记,ElasticSearch基本操作以及爬虫(Java-ES仿京东实战),包含了小狂神讲的东西,特别适合新手学习,笔记保存下来可以多看看。好记性不如烂笔头哦~,ElasticSearch,简称es,es是一个...

    ElasticSearch官方测试数据

    Elasticsearch(ES)是一种流行的开源全文搜索引擎,它基于Lucene库构建,被广泛用于大数据分析、日志聚合、实时搜索和索引等场景。官方提供的测试数据集是检验Elasticsearch功能、性能和稳定性的关键资源,可以帮助...

    7.17.1系列Elasticsearch的elasticsearch-analysis-ik分词器

    适用于7.17.1系列,例如Elasticsearch的7.17.12版本。 elasticsearch-analysis-ik 是一个常用的中文分词器,在 Elasticsearch 中广泛应用于中文文本的分析和搜索。下面是 elasticsearch-analysis-ik 分词器的几个...

    Monitoring ElasticSearch

    Explore your cluster with ElasticSearch-head and BigDesk Access the underlying data of the ElasticSearch monitoring plugins using the ElasticSearch API Analyze your cluster's performance with Marvel ...

    ES客户端+谷歌浏览器插件+Multi-Elasticsearch-Head

    多弹性搜索头,对著名的 Elasticsearch Head 的改进 1.保存和存储几个Elasticsearch端点 2.索引选项卡中的更多列 3. 任何请求现在都可以像 /_cat/indices 一样处理 JSON 返回 4. 更简约的外观(更小的字体等...) ...

    elasticsearch elasticsearch-6.2.2 elasticsearch-6.2.2.zip 下载

    根据提供的文件信息,我们可以推断出本篇文章将围绕Elasticsearch 6.2.2版本进行详细介绍,包括其下载方式、主要功能特性以及在实际应用中的常见用途。 ### Elasticsearch简介 Elasticsearch是一款基于Lucene的...

    ES查询客户端,elasticsearch可视化工具 elasticsearch查询客户端

    Elasticsearch(简称ES)是一款强大的开源搜索引擎,广泛应用于数据检索、分析和管理。作为分布式、RESTful风格的搜索和数据分析引擎,Elasticsearch能够提供实时、高可用性以及可扩展的搜索功能。在进行日常的数据...

    Windows版本(8.11)ElasticSearch、elasticsearch-head、kibana、IK分词

    3. **启动Elasticsearch**: 运行`bin/elasticsearch.bat`启动服务。注意,Elasticsearch默认使用9200端口,如果该端口已被占用,需要修改配置文件`config/elasticsearch.yml`。 **Kibana 8.11.3** Kibana是Elastic...

    elasticSearch-8.14.1-windows

    - **单节点配置**:在`elasticsearch.yml`中,可以设置`cluster.name`以定义集群名称,保持所有节点的集群名称一致,它们就会自动加入同一集群。 - **内存设置**:根据你的系统资源调整`jvm.options`中的堆大小。...

Global site tag (gtag.js) - Google Analytics