Skip to content

Commit

Permalink
Run elasticsearch in development mode for test builds
Browse files Browse the repository at this point in the history
When elasticsearch is bound to localhost it runs in development mode. This mode makes a few startup checks of elasticsearch
less strict (they become warnings), allowing it to boot anyway.

On circleci its servers the value for  is too low and elasticsearch wont start. So we make sure we
are running in dev mode so we can at least run our tests

elastic/elasticsearch#4978 (comment)
  • Loading branch information
dieterve committed Jan 20, 2017
1 parent 5e958e6 commit a3f2ede
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion circle.yml
@@ -1,7 +1,9 @@
machine:
php:
version: 7.0.4
java:
version: openjdk8

dependencies:
pre:
- sh ./install-elasticsearch.sh
- sh ./install-elasticsearch.sh testing
5 changes: 4 additions & 1 deletion install-elasticsearch.sh
Expand Up @@ -20,7 +20,10 @@ rm elasticsearch-$ELASTICSEARCH_VERSION.deb
sudo sed -i "s/#index.number_of_shards: 1/index.number_of_shards: 1/" /etc/elasticsearch/elasticsearch.yml
sudo sed -i "s/#index.number_of_replicas: 0/index.number_of_replicas: 0/" /etc/elasticsearch/elasticsearch.yml
sudo sed -i "s/#bootstrap.mlockall: true/bootstrap.mlockall: true/" /etc/elasticsearch/elasticsearch.yml
sudo sed -i "s/#network.host: 192.168.0.1/network.host: 0.0.0.0/" /etc/elasticsearch/elasticsearch.yml
if [ "$1" != "testing" ] ; then
echo ">>> Binding elasticsearch to all network hosts"
sudo sed -i "s/#network.host: 192.168.0.1/network.host: 0.0.0.0/" /etc/elasticsearch/elasticsearch.yml
fi
sudo service elasticsearch restart

# Configure to start up Elasticsearch automatically
Expand Down

0 comments on commit a3f2ede

Please sign in to comment.