Giter Club home page Giter Club logo

josecdom94-es-aci-dev's Introduction

Elastic Search In Azure Container Instances

Currently is not easy to use Elastic Search in Azure Container instance, this is a docker image prepared for that, but only for testing purposes, you should consider other alternatives for production environments.

Download the Image

The image can be downloaded directly from docker hub.

Use with terraform

Here is an example of how you can use this image with terraform:

resource "azurerm_container_group" "elasticSearchServer" {
  name                = "aci-elastic-dev-001"
  #Change to the correct location here:
  location            = azurerm_resource_group.rgServices.location
  #Change the resource group here:
  resource_group_name = azurerm_resource_group.rgServices.name
  ip_address_type     = "public"
  dns_name_label      = "qvaCar-elastic-dev"
  os_type             = "Linux"

  container {
    name   = "elastic-server"
    image  = "josecdom94/es-aci-dev:7.9.2"
    cpu    = "0.5"
    memory = "1.0"
    environment_variables = {     
      ES_JAVA_OPTS     = "-Xms512m -Xmx512m"
    }

    ports {
      port     = "9200"
      protocol = "TCP"
    }
  }
}

Run With Docker

Although it doesn’t make much sense to use docker locally since is not much different from the original elastic search, you can still use docker locally:

docker run -dt --name elastic-search -p 9200:9200 josecdom94/es-aci-dev:7.9.2

After a while you can check that the status of the cluster is green by typing this URL in the browser http://localhost:9200/_cluster/health and get something similar to this:

{
    "cluster_name": "docker-cluster",
    "status": "green",
    "timed_out": false,
    "number_of_nodes": 1,
    "number_of_data_nodes": 1,
    "active_primary_shards": 0,
    "active_shards": 0,
    "relocating_shards": 0,
    "initializing_shards": 0,
    "unassigned_shards": 0,
    "delayed_unassigned_shards": 0,
    "number_of_pending_tasks": 0,
    "number_of_in_flight_fetch": 0,
    "task_max_waiting_in_queue_millis": 0,
    "active_shards_percent_as_number": 100.0
}

How does it works

The magic is just setting an environment variable discovery.type=single-node before starting the cluster, but bear in mind that this is a single node cluster and is not recommended for production environments. You can check the docker file for more details.

Build Status

Build And Publish

josecdom94-es-aci-dev's People

Contributors

dominioncfg avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.