set Elasticsearch 2.x in Ansible
- java8
- curl
- elasticsearch2.x
- Ansible(checked 1.9.1)
- CentOS 6.5 later
$ git clone https://github.com/uzresk/ansible-elasticsearch2.git
[server]
192.168.1.20
elasticsearch_configs:
dl_url: https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/rpm/elasticsearch/2.1.1/elasticsearch-2.1.1.rpm
rpm_path: /usr/local/src/elasticsearch-2.1.0.rpm
cluster_name: test-cluster
node_name: ${HOSTNAME}
network_host: '_eth1:ipv4_'
http_port: 9200
path_data: /var/lib/elasticsearch/
path_logs: /var/log/elasticsearch/
path_repo: /var/log/elasticsearch/backup/
bootstrap_mlockall: "true"
init_params:
- { regexp: 'export ES_HEAP_SIZE', line: 'export ES_HEAP_SIZE=512m' }
- { regexp: 'export ES_JAVA_OPTS', line: 'export ES_JAVA_OPTS="-Djava.rmi.server.hostname=192.168.1.41 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=7085 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"' }
discovery_unicast_host: ["192.168.1.41:9300", "192.168.1.42:9300"]
minimum_master_nodes: 1
# proxy_host: proxyhost
# proxy_port: 8080
plugins:
- { name: 'analysis-kuromoji', location: 'analysis-kuromoji' }
- { name: 'head', location: 'mobz/elasticsearch-head' }
$ ansible-playbook -i hosts site.yml
MIT