Install Elasticsearch with Docker

« Install Elasticsearch with Windows MSI Installer Configuring Elasticsearch »
Install Elasticsearch with Dockeredit
Elasticsearch is also available as Docker images. The images use centos:7 as the base image.

A list of all published Docker images and tags is available at www.docker.elastic.co. The source files are in Github.

These images are free to use under the Elastic license. They contain open source and free commercial features and access to paid commercial features. Start a 30-day trial to try out all of the paid commercial features. See the Subscriptions page for information about Elastic license levels.

Pulling the imageedit
Obtaining Elasticsearch for Docker is as simple as issuing a docker pull command against the Elastic Docker registry.

docker pull docker.elastic.co/elasticsearch/elasticsearch:6.7.2
Alternatively, you can download other Docker images that contain only features available under the Apache 2.0 license. To download the images, go to www.docker.elastic.co.

Running Elasticsearch from the command lineedit
Development modeedit
Elasticsearch can be quickly started for development or testing use with the following command:

docker run -p 9200:9200 -p 9300:9300 -e “discovery.type=single-node” docker.elastic.co/elasticsearch/elasticsearch:6.7.2
Production modeedit
Important
The vm.max_map_count kernel setting needs to be set to at least 262144 for production use. Depending on your platform:

Linux

The vm.max_map_count setting should be set permanently in /etc/sysctl.conf:

$ grep vm.max_map_count /etc/sysctl.conf
vm.max_map_count=262144
To apply the setting on a live system type: sysctl -w vm.max_map_count=262144

macOS with Docker for Mac

The vm.max_map_count setting must be set within the xhyve virtual machine:

$ screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
Just press enter and configure the sysctl setting as you would for Linux:

sysctl -w vm.max_map_count=262144
Windows and macOS with Docker Toolbox

The vm.max_map_count setting must be set via docker-machine:

docker-machine ssh
sudo sysctl -w vm.max_map_count=262144
The following example brings up a cluster comprising two Elasticsearch nodes. To bring up the cluster, use the docker-compose.yml and just type:

docker-compose up
Note
docker-compose is not pre-installed with Docker on Linux. Instructions for installing it can be found on the Docker Compose webpage.

The node elasticsearch listens on localhost:9200 while elasticsearch2 talks to elasticsearch over a Docker network.

This example also uses Docker named volumes,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值