Skip to content

Tutorial

buildlackey edited this page Oct 14, 2017 · 46 revisions

Benchmarking Elasticsearch using a Built-from-source Ndbench .war, Deployed to Tomcat

This tutorial assumes you are running Linux and have Docker installed (steps for Mac development environments will be similar, but probably not identical.)

Important Note: This tutorial illustrates the use of ndbench via a client plugin that is not yet open sourced, but soon will be.

  1. Clone the repository and build the .war file as follows:
 clone git@github.com:Netflix/ndbench.git
 cd ndbench
 ./gradlew   clean build    # this will build the .war
 cp ./ndbench-web/build/libs/*.war /tmp/ndbench.war    #  copy .war to easy to remember spot

  1. Start tomcat in Docker (with a host-resident directory mounted, to ease copying of the .war)
mkdir /tmp/deploy_dir
docker run -d -p 8080:8080 -v /tmp/deploy_dir:/usr/local/tomcat/webapps/ tomcat:latest
tomcatContainerId=`docker ps -a | grep tomcat | sed -e's/tomcat.*//'`     
docker logs -f $tomcatContainerId      # tail the logs so you can see the progress of deployment
  1. In another terminal from where you are tailing the tomcat logs, do the following
cp /tmp/ndbench.war /tmp/deploy_dir
  1. The output of the tailed tomcat logs should contain some lines like this:
    Deploying web application archive [/usr/local/tomcat/webapps/ROOT.war]
       ...<more lines>...
    Installing NdBenchClientPlugin: com.netflix.ndbench.plugin.es.EsRestPlugin with Annotation: ES_REST
       ...<more lines>...
    Deployment of web application archive [/usr/local/tomcat/webapps/ROOT.war] has finished...
  1. Verify the .war deployed successfully
 curl localhost:8080/REST/ndbench/driver/getserverstatus
  • You should see output like this:
{"ClientDrivers":["CassJavaDriverPlugin","DynoExtFunc","DynoGetSetPipeline",
   "DynoJedis","GeodeCloudPlugin","ES_REST","LocalDynomiteProxyPlugin","InMemoryTest".... more ...
  1. Start Elasticsearch in Docker, listening on good 'ol port 9200
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:5.6.3
  1. Initialize client and start writing
curl http://localhost:8080/REST/ndbench/driver/init/ES_REST
  • You should see this output:
{"isSuccess":true,"message":"NdBench client initiated!"}

Clone this wiki locally