Skip to content

Instantly share code, notes, and snippets.

@januszm
Last active March 19, 2021 09:33
Show Gist options
  • Save januszm/1e219ef00a141d3092964da1d193e59a to your computer and use it in GitHub Desktop.
Save januszm/1e219ef00a141d3092964da1d193e59a to your computer and use it in GitHub Desktop.
Elasticsearch on Amazon Linux
# as root or with sudo
swapoff -a
sysctl -w vm.swappiness=1
sysctl -w fs.file-max=262144
sysctl -w vm.max_map_count=262144
yum install https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
yum install mysql-devel redis-devel
amazon-linux-extras install redis4.0
yum install docker
chkconfig docker on
docker network create elastic
docker pull elasticsearch:7.11.1
docker run --rm --detach --env "node.name=es1" \
--env "cluster.name=docker-elasticsearch" \
--env "cluster.initial_master_nodes=es1" \
--env "discovery.seed_hosts=es1" \
--env "cluster.routing.allocation.disk.threshold_enabled=false" \
--env "bootstrap.memory_lock=true" \
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
--env "xpack.security.enabled=false" \
--env "xpack.license.self_generated.type=basic" \
--env "http.port=9200" \
--ulimit "nofile=65536:65536" \
--ulimit memlock=-1:-1 \
--publish 9200:9200 \
--network=elastic \
--name=elasticsearch \
docker.elastic.co/elasticsearch/elasticsearch:7.11.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment