Server to generate IDs - by btnguyen2k.
Project home: https://github.com/btnguyen2k/id-server.
See LICENSE.txt for details. Copyright (c) 2015 btnguyen2k.
Third party libraries are distributed under their own license(s).
Latest release: 0.1.0
.
See RELEASE-NOTES.md.
Note: Java 7+ is required!
- Download binary package from project release site.
- Unzip the binary package and copy it to your favourite location, e.g.
/usr/local/id-server
.
- Download application's source, either cloning github project or download the source package from project release site.
- Build Play! Framework:
play dist
. - The built binary package is available at
target/universal/id-server-<version>.zip
. You may copy it to your favourite location, e.g./usr/local/id-server
.
Start server with default options:
/usr/local/id-server/conf/server-production.sh start
Start server with 1024M memory limit, REST API in port 18080, Thrift API on port 19090
/usr/local/id-server/conf/server-production.sh start -m 1024 -p 18080 -t 19090
Set thrift port to 0 (-t 0
) to disable Thrift APIs.
Upon successful startup, id-server listens for REST requests on port 8080
and Thrift requests on port 9090
(both port numbers are configurable).
Stop server:
/usr/local/id-server/conf/server-production.sh stop
See file conf/spring/beans.xml
.
Generates next ID for a namespace, using default engine:
GET /nextId/<namespace>
GET /nextId/users
GET /nextId/topics
Generates next ID for a namespace, using specified engine:
GET /nextId/<namespace>/<engine>
Supported engines:
default
: default engine, configured inconf/spring/beans.xml
jdbc
: utilize a database system to generate IDs.redis
: utilize Redis to generate IDs.zookeeper
: utilize ZooKeeper to generate IDs.snowflake
: generate IDs using Snowflake algorithm.
See file idserver.thrift.