Skip to content

Commit

Permalink
Add elasticsearch Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
seapy committed Aug 4, 2014
1 parent 55844df commit bf4edea
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 0 deletions.
15 changes: 15 additions & 0 deletions elasticsearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM dockerfile/elasticsearch
MAINTAINER ChangHoon Jeong <iamseapy@gmail.com>

ENV ES_HEAP_SIZE 1g

ADD logging.yml /data/conf/logging.yml
ADD elasticsearch.yml /data/conf/elasticsearch.yml

RUN ["/elasticsearch/bin/plugin", "--install", "-Des.config=/data/conf/elasticsearch.yml", "royrusso/elasticsearch-HQ"]
RUN ["/elasticsearch/bin/plugin", "--install", "-Des.config=/data/conf/elasticsearch.yml", "lukas-vlcek/bigdesk"]
RUN ["/elasticsearch/bin/plugin", "--install", "-Des.config=/data/conf/elasticsearch.yml", "lmenezes/elasticsearch-kopf"]
RUN ["/elasticsearch/bin/plugin", "--install", "-Des.config=/data/conf/elasticsearch.yml", "mobz/elasticsearch-head"]
RUN ["/elasticsearch/bin/plugin", "--install", "-Des.config=/data/conf/elasticsearch.yml", "karmi/elasticsearch-paramedic"]

ENTRYPOINT ["/elasticsearch/bin/elasticsearch", "--path.conf=/data/conf"]
49 changes: 49 additions & 0 deletions elasticsearch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# What's differ `dockerfile/elasticsearch`

* pre install useful plugin
* HQ
* bigdesk
* kopf
* head
* paramedic


# Usage

```shell
# x.x.x.x server
$ docker run -d -p 9200:9200 -p 9300:9300 \
-v /data/elasticsearch:/data/mnt \
seapy/elasticsearch \
--node.name=$(hostname) \
--network.publish_host=$(hostname -i) \
--discovery.zen.ping.multicast.enabled=false \
--discovery.zen.ping.unicast.hosts=x.x.x.x:9300,y.y.y.y:9300
```

```shell
# y.y.y.y server
$ docker run -d -p 9200:9200 -p 9300:9300 \
-v /data/elasticsearch:/data/mnt \
seapy/elasticsearch \
--node.name=$(hostname) \
--network.publish_host=$(hostname -i) \
--discovery.zen.ping.multicast.enabled=false \
--discovery.zen.ping.unicast.hosts=x.x.x.x:9300,y.y.y.y:9300
```


# Override conf

you can overrinde config option like `cluster.name: my_cluster`

```shell
docker run -d ... seapy/elasticsearch --cluster.name: my_cluster
```


# Info

`--network.publish_host` options is key point. when you missed this, unicast cluster can't work.

[Running an ElasticSearch Cluster on CoreOS](http://mattupstate.com/coreos/devops/2014/06/26/running-an-elasticsearch-cluster-on-coreos.html)
12 changes: 12 additions & 0 deletions elasticsearch/elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cluster.name: elastic_docker

# path
path.conf: /data/conf
path.data: /data/mnt/data
path.logs: /data/mnt/log
path.plugins: /elasticsearch/plugins
path.work: /data/mnt/work

# index option
index.number_of_shards: 5
index.number_of_replicas: 1
56 changes: 56 additions & 0 deletions elasticsearch/logging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# you can override this using by setting a system property, for example -Des.logger.level=DEBUG
es.logger.level: INFO
rootLogger: ${es.logger.level}, console, file
logger:
# log action execution errors for easier debugging
action: DEBUG
# reduce the logging for aws, too much is logged under the default INFO
com.amazonaws: WARN

# gateway
#gateway: DEBUG
#index.gateway: DEBUG

# peer shard recovery
#indices.recovery: DEBUG

# discovery
#discovery: TRACE

index.search.slowlog: TRACE, index_search_slow_log_file
index.indexing.slowlog: TRACE, index_indexing_slow_log_file

additivity:
index.search.slowlog: false
index.indexing.slowlog: false

appender:
console:
type: console
layout:
type: consolePattern
conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"

file:
type: dailyRollingFile
file: ${path.logs}/${cluster.name}.log
datePattern: "'.'yyyy-MM-dd"
layout:
type: pattern
conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"

index_search_slow_log_file:
type: dailyRollingFile
file: ${path.logs}/${cluster.name}_index_search_slowlog.log
datePattern: "'.'yyyy-MM-dd"
layout:
type: pattern
conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"

index_indexing_slow_log_file:
type: dailyRollingFile
file: ${path.logs}/${cluster.name}_index_indexing_slowlog.log
datePattern: "'.'yyyy-MM-dd"
layout:
type: pattern
conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"

0 comments on commit bf4edea

Please sign in to comment.