`
sillycat
  • 浏览: 2487257 次
  • 性别: 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
分享到:
评论

相关推荐

    Packt.Monitoring.ElasticSearch.1784397806.pdf

    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 ...

    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 ...

    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 ...

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

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

    elasticsearch elasticsearch-6.2.2 elasticsearch-6.2.2.zip 下载

    elasticsearch elasticsearch-6.2.2 elasticsearch-6.2.2.zip 下载

    ElasticSearch 5.0 Cookbook

    Elasticsearch is one of the most powerful solution, written with the cloud and distributed computing in mind. Its main author, Shay Banon, famous for having developed Compass ...

    Elasticsearch for Hadoop

    In this book, you'll learn to use Elasticsearch, Kibana and Elasticsearch-Hadoop effectively to analyze and understand your HDFS and streaming data. You begin with an in-depth understanding of the ...

    Elasticsearch The Definitive Guide

    This practical guide not only shows you how to search, analyze, and explore data with Elasticsearch, but also helps you deal with the complexities of human language, geolocation, and relationships. ...

    java语言kafka数据批量导入到Elasticsearch实例

    消费kafka数据,然后批量导入到Elasticsearch,本例子使用的kafka版本0.10,es版本是6.4,使用bulk方式批量导入到es中,也可以一条一条的导入,不过比较慢。 <groupId>org.elasticsearch <artifactId>elastic...

    Elasticsearch.Essentials.1784391018.pdf

    Harness the power of ElasticSearch to build and manage scalable search and analytics solutions with this fast-paced guide About This Book New to ElasticSearch? Here's what you need―a highly ...

    Mastering ElasticSearch 5.0 - Third Edition

    You will get an understanding of how you can scale your ElasticSearch cluster to contextualize it and improve its performance. We'll also show you how you can create your own analysis plugin in ...

    Elasticsearch.A.Complete.Guide.epub

    Improve your user search experience with Elasticsearch and develop your own Elasticsearch plugins Design your index, configure it, and distribute it — you'll also learn how it works Who This Book Is ...

    elasticsearch-7.17.3

    elasticsearch-7.17.3-linux-x86_64.tar.gz elasticsearch-7.17.3-x86_64.rpm gradle-7.4.2-all.zip

    elasticsearch学习demo

    <elasticsearch.version>5.6.0</elasticsearch.version> <spring-version>5.0.0.RC3</spring-version> <fastjson-version>1.2.7</fastjson-version> <junit-version>4.12</junit-version> <slf4j-version>1.7.5...

    最新版本springboot集成elasticsearch

    一、概述 一般来说我们开发Elasticsearch会选择...2、elasticsearch-head (方便查看ES中的索引及数据) 3、Kibana(方便开发通过rest api 调试ES,有代码提示) 4、中文分词elasticsearch-analysis-ik (ik) 1、下载ela

    elasticsearch-sizing-and-capacity-planning.pdf

    ElasticSearch official guide for sizing and capacity planning

    spring-data-elasticsearch

    spring-data-elasticsearch api文档

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

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

    elasticsearch-8.2.3 windows 版本

    elasticsearch-8.2.3 windows 版本。 Elasticsearch是一个基于Lucene的搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口。Elasticsearch是用Java语言开发的,并作为Apache许可条款下的...

    Elasticsearch总结.doc

    Elasticsearch 简介 简单描述Elasticsearch Elasticsearch的特性 分布式、全文检索、近实时搜索和分析、高可用、模式自由、restful 讲述Elasticsearch的架构和Elasticsearch 的核心 概念 二、索引数据 单词 文档...

Global site tag (gtag.js) - Google Analytics