forked from voldemort/voldemort
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding sample configs for Voldemort Coordinator
- Loading branch information
1 parent
f6e7b9c
commit 8db2a31
Showing
5 changed files
with
114 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Copyright 2008-2013 LinkedIn, Inc | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
# Start up a Voldemort REST Coordinator speaking to a Voldemort Cluster. | ||
# Example : | ||
# 1. Bring up a Voldemort single node cluster | ||
# $ bin/voldemort-server.sh config/single_node_cluster | ||
# 2. Bring up a Voldemort Coordinator | ||
# $ bin/voldemort-coordinator.sh config/coordinator_sample_config/config.properties | ||
# 3. Do operations | ||
# See config/coordinator_sample_config/curl_samples.txt | ||
if [ $# -gt 1 ]; | ||
then | ||
echo 'USAGE: bin/voldemort-coordinator.sh <coordinator-config-file>' | ||
exit 1 | ||
fi | ||
|
||
base_dir=$(dirname $0)/.. | ||
|
||
for file in $base_dir/dist/*.jar; | ||
do | ||
CLASSPATH=$CLASSPATH:$file | ||
done | ||
|
||
for file in $base_dir/lib/*.jar; | ||
do | ||
CLASSPATH=$CLASSPATH:$file | ||
done | ||
|
||
for file in $base_dir/contrib/*/lib/*.jar; | ||
do | ||
CLASSPATH=$CLASSPATH:$file | ||
done | ||
|
||
CLASSPATH=$CLASSPATH:$base_dir/dist/resources | ||
|
||
if [ -z "$VOLD_OPTS" ]; then | ||
VOLD_OPTS="-Xmx1G -server -Dcom.sun.management.jmxremote" | ||
fi | ||
|
||
java -Dlog4j.configuration=src/java/log4j.properties $VOLD_OPTS -cp $CLASSPATH voldemort.coordinator.CoordinatorService $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bootstrap_urls=tcp://localhost:6666 | ||
fat_clients_config_file_path=config/coordinator_sample_config/fatclients_config.avro | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Once you have a coordinator up and running against a Voldemort cluster, here is how you perform the basic operations using Curl: | ||
|
||
********************** Voldemort PUT ***************************************** | ||
# a2V5MQ== is "key1" in base64 | ||
$ curl -X POST http://localhost:8080/test/a2V5MQ== --data "value1" | ||
|
||
# a2V5Mg== is "key2" in base64 | ||
$ curl -X POST http://localhost:8080/test/a2V5Mg== --data "value2" | ||
|
||
# a2V5Mw== is "key3" in base64 | ||
$ curl -X POST http://localhost:8080/test/a2V5Mw== --data "value3" | ||
|
||
*********************** Voldemort GET **************************************** | ||
# retrieve key1 | ||
$ curl http://localhost:8080/test/a2V5MQ== | ||
value1 | ||
|
||
*********************** Voldemort GET_ALL ************************************ | ||
# retrive all keys | ||
$ curl http://localhost:8080/test/a2V5MQ==,a2V5Mg==,a2V5Mw== | ||
------=_Part_0_1624485351.1370561996547 | ||
Content-Location: /test/a2V5Mw== | ||
ETag: {"timestamp":1370561962575,"versions":[{"version":1,"nodeId":0}]} | ||
Content-Length: 6 | ||
|
||
value3 | ||
------=_Part_0_1624485351.1370561996547 | ||
Content-Location: /test/a2V5Mg== | ||
ETag: {"timestamp":1370561938302,"versions":[{"version":1,"nodeId":0}]} | ||
Content-Length: 6 | ||
|
||
value2 | ||
------=_Part_0_1624485351.1370561996547 | ||
Content-Location: /test/a2V5MQ== | ||
ETag: {"timestamp":1370561912292,"versions":[{"version":1,"nodeId":0}]} | ||
Content-Length: 6 | ||
|
||
value1 | ||
------=_Part_0_1624485351.1370561996547-- | ||
|
||
************************ Voldemort DELETE ************************************ | ||
# delete key1 | ||
$ curl -X DELETE http://localhost:8080/test/a2V5MQ== | ||
$ curl http://localhost:8080/test/a2V5MQ== | ||
Failure: 404 Not Found. Requested Key does not exist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ | ||
{ | ||
"store_name": "test", | ||
"connection_timeout_ms": "500", | ||
"socket_timeout_ms": "1500" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters