From 7b26658fde5eab0a3048320666e462533d743ba3 Mon Sep 17 00:00:00 2001 From: Fahd Siddiqui Date: Thu, 25 Aug 2016 13:51:53 -0500 Subject: [PATCH] Add convenient start-local.sh, and update documentation (#14) * Add convenient start-local.sh, and update documentation --- QuickStart.md | 17 ++++++++++------- README.md | 6 +++--- yum/dep.xml | 8 ++++++++ yum/start-local.sh | 24 ++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 10 deletions(-) create mode 100755 yum/start-local.sh diff --git a/QuickStart.md b/QuickStart.md index d43544ac3..ade9b76f9 100644 --- a/QuickStart.md +++ b/QuickStart.md @@ -1,19 +1,22 @@ ### Starting EmoDB locally using only EmoDB binaries -To start EmoDB locally, simply download the binaries, and run the following: - -``` -java -jar bin/emodb-web-local-*.jar server conf/config-local.yaml conf/config-ddl-local.yaml conf/cassandra.yaml -z +To start EmoDB locally, simply download the [EmoDB binaries] (https://github.com/bazaarvoice/emodb/releases), and run the following: + ``` +$> ./start-local.sh +``` + The above will start the following services: - In-memory Cassandra - Zookeeper on port 2181 - EmoDB on port 8080/8081 -If you would like to use your own configured cassandra, then skip providing cassandra.yaml and update Emo's config file to point to the correct Cassandra node. - -To skip starting zookeeper, leave out `-z` switch. +If you would like to use your own configured cassandra, then start the local jar directly: +``` +java -jar bin/emodb-web-local-*.jar server conf/config-local.yaml conf/config-ddl-local.yaml conf/cassandra.yaml -z +``` +To skip starting a local zookeeper, leave out `-z` switch. diff --git a/README.md b/README.md index f664e58c7..2832f3b65 100644 --- a/README.md +++ b/README.md @@ -51,11 +51,11 @@ Quick Start #### Using binaries: -1. Download the [EmoDB binaries] (https://github.com/bazaarvoice/emodb/releases) +1. Download the tarball from [EmoDB binaries] (https://github.com/bazaarvoice/emodb/releases) 2. Run the Emodb server locally. This will start zookeeper and cassandra locally. - $ bin/start-local.sh + $ ./start-local.sh ... INFO [2012-05-14 19:12:19,802] org.eclipse.jetty.server.AbstractConnector: Started InstrumentedBlockingChannelConnector@0.0.0.0:8080 INFO [2012-05-14 19:12:19,805] org.eclipse.jetty.server.AbstractConnector: Started SocketConnector@0.0.0.0:8081 @@ -111,7 +111,7 @@ Quick Start $ cd web-local $ ./start-clean.sh -### Examples +### Quick Tutorial The following examples assume you have [jq] (https://stedolan.github.io/jq/) or an equivalent (see Recommended Software below). It is optional-- `jq .` just formats the JSON responses to make them easier to read. diff --git a/yum/dep.xml b/yum/dep.xml index fd4f6f3ce..f89aee42d 100644 --- a/yum/dep.xml +++ b/yum/dep.xml @@ -34,5 +34,13 @@ http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 "> cassandra.yaml + + ${project.basedir} + / + 755 + + start-local.sh + + \ No newline at end of file diff --git a/yum/start-local.sh b/yum/start-local.sh new file mode 100755 index 000000000..b214be228 --- /dev/null +++ b/yum/start-local.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# +# Starts the following servers locally: +# - EmoDB (ports 8080, 8081) +# - Cassandra (port 9160) +# - ZooKeeper (port 2181) +# +# The first time this is run, Cassandra will be initialized with a default +# schema and an empty # data set. Data will be stored in "bin/data". +# On subsequent runs where "bin/data/" already exists, the Cassandra +# schema and data will not be modified. +# +# Once the server is running you can access Emodb using the following commands: +# Note: For local testing, we have enabled anonymous access. In production you should be using API Keys. Read more about it in "API Keys" section. +# +# curl localhost:8081/ping +# curl localhost:8080/sor/1/_table +# +# For production, use the web jar not web-local, and also you shouldn't be providing cassandra.yaml or -z switch since you wouldn't want to start a local cassandra or zookeeper +# java -jar bin/emodb-web.jar server conf/config-local.yaml conf/config-ddl-local.yaml +# + +java -jar bin/emodb-web-local-*.jar server conf/config-local.yaml conf/config-ddl-local.yaml conf/cassandra.yaml -z