-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
649 additions
and
749 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
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 |
---|---|---|
@@ -1,70 +1,78 @@ | ||
# rocksdb-server | ||
A tiny HTTP-based server for RocksDB | ||
# RocksDB Server | ||
|
||
This is a lightweight RocksDB Server based on jetty. | ||
|
||
## Features | ||
|
||
* Use RocksDB as key-value storage engine | ||
* HTTP-base API interface | ||
* Authorization | ||
* Support basic operations: get, put, remove, drop_database | ||
* Batch get/put/remove (not atomic) | ||
* Multiple concurrent databases; | ||
* Simple API interface and client libraries; | ||
* Basic Authentication; | ||
* Batch `put`, `get` and `remove` operations. | ||
|
||
## Prerequisites | ||
You need to have Java 8+ installed. Currently supported platform includes Mac OS X and Linux. | ||
|
||
## How to use | ||
You need to have a Java 8 or above runtime installed. | ||
|
||
## Get started | ||
|
||
1. Download and unzip the latest binary release from [here](https://github.com/iamyulong/rocksdb-server/releases); | ||
2. Update the configuration file at `./conf/server.json`; | ||
3. Start up the server: `./bin/startup.sh`. | ||
|
||
Once boot up, you can check if it's working via http://localhost:8516. | ||
|
||
## Install as system service (Ubuntu) | ||
|
||
1. Copy the following config to `/etc/init.d/rocksdb-server`, after replacing `SERVER_ROOT` with a real path: | ||
|
||
```bash | ||
#!/bin/bash | ||
|
||
### BEGIN INIT INFO | ||
# Provides: rocksdb-server | ||
# Required-Start: $network | ||
# Required-Stop: $network | ||
# Default-Start: 2 3 4 5 | ||
# Default-Stop: 0 1 6 | ||
# Short-Description: start/stop rocksdb-server | ||
### END INIT INFO | ||
|
||
SERVER_ROOT=/path/to/rocksdb/server | ||
|
||
case $1 in | ||
start) | ||
/bin/bash $SERVER_ROOT/bin/startup.sh | ||
;; | ||
stop) | ||
/bin/bash $SERVER_ROOT/bin/shutdown.sh | ||
;; | ||
restart) | ||
/bin/bash $SERVER_ROOT/bin/restart.sh | ||
;; | ||
esac | ||
exit 0 | ||
``` | ||
|
||
2. Update the permissions and enable service: | ||
|
||
```bash | ||
chmod 755 /etc/init.d/rocksdb-server | ||
update-rc.d rocksdb-server defaults | ||
``` | ||
|
||
3. Now, you can start/stop/restart your server via the following commands: | ||
|
||
```bash | ||
service rocksdb-server start | ||
service rocksdb-server stop | ||
service rocksdb-server restart | ||
``` | ||
|
||
1. Download the latest release from <https://github.com/iamyulong/rocksdb-server/releases>. | ||
2. Unarchive and modify the configuration file at `conf/server.json`. | ||
3. Start the server via terminal: `./bin/startup.sh`. | ||
4. You can verify if it is working by visiting: <http://localhost:8516> | ||
|
||
## Build from source | ||
|
||
```bash | ||
git clone https://github.com/iamyulong/rocksdb-server | ||
cd rocksdb-server | ||
mvn package | ||
``` | ||
|
||
## Install as system service (Linux) | ||
|
||
Edit SERVER_ROOT in the following script and copy to `/etc/init.d/rocksdb-server`. | ||
```bash | ||
#!/bin/bash | ||
|
||
### BEGIN INIT INFO | ||
# Provides: rocksdb-server | ||
# Required-Start: $network | ||
# Required-Stop: $network | ||
# Default-Start: 2 3 4 5 | ||
# Default-Stop: 0 1 6 | ||
# Short-Description: start/stop rocksdb-server | ||
### END INIT INFO | ||
|
||
SERVER_ROOT=/path/to/rocksdb/server | ||
|
||
case $1 in | ||
start) | ||
/bin/bash $SERVER_ROOT/bin/startup.sh | ||
;; | ||
stop) | ||
/bin/bash $SERVER_ROOT/bin/shutdown.sh | ||
;; | ||
restart) | ||
/bin/bash $SERVER_ROOT/bin/restart.sh | ||
;; | ||
esac | ||
exit 0 | ||
``` | ||
Change its permissions and add the correct symlinks automatically. | ||
```bash | ||
chmod 755 /etc/init.d/rocksdb-server | ||
update-rc.d rocksdb-server defaults | ||
``` | ||
From now on, you can start/stop/restart your server via the following commands: | ||
```bash | ||
service rocksdb-server start | ||
service rocksdb-server stop | ||
service rocksdb-server restart | ||
``` | ||
mvn clean install | ||
``` |
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 |
---|---|---|
@@ -1,12 +1,18 @@ | ||
{ | ||
"listen": "127.0.0.1", | ||
"port": 8516, | ||
|
||
"auth": { | ||
"enabled": true, | ||
"username": "username", | ||
"password": "password" | ||
}, | ||
|
||
"data_dir": "data" | ||
"node": { | ||
"host": "127.0.0.1", | ||
"port": 8516 | ||
}, | ||
"auth": { | ||
"enabled": false, | ||
"username": "admin", | ||
"password": "admin" | ||
}, | ||
"db": { | ||
"maxOpenFiles": 256, | ||
"blockSize": 4096, | ||
"rowCache": 33554432, | ||
"writeBufferSize": 4194304 | ||
}, | ||
"dataDir": "data" | ||
} |
Oops, something went wrong.