-
Erlang/OTP 17.x
-
Unix-like operating system that can run Erlang/OTP 17.x
-
GNU/Linux — Ubuntu, Debian, Fedora, CentOS, CoreOS, etc.
-
Mac OS X
-
BSD — FreeBSD
-
illumos — SmartOS, OmniOS
-
make run starts the application with embedded single-node Hibari DB server.
$ make run Erlang/OTP 17 [erts-6.3] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.3 (abort with ^G) ([email protected])1>
$ tail -f hibari/log/console.log 2015-03-13 21:25:47.846 [info] <0.7.0> Application lager started on node '[email protected]' 2015-03-13 21:25:47.849 [info] <0.7.0> Application cluster_info started on node '[email protected]' 2015-03-13 21:25:47.855 [info] <0.7.0> Application gmt_util started on node '[email protected]' 2015-03-13 21:25:47.864 [info] <0.92.0>@partition_detector_server:init:207 Partition detector: active status on node '[email protected]' 2015-03-13 21:25:47.874 [info] <0.7.0> Application partition_detector started on node '[email protected]' 2015-03-13 21:25:47.889 [info] <0.103.0>@congestion_watcher_server:do_mark:239 mark: 20150313212547 [{0,0},{0,0},{0,0}] 2015-03-13 21:25:47.889 [info] <0.7.0> Application congestion_watcher started on node '[email protected]' 2015-03-13 21:25:48.064 [info] <0.115.0>@gmt_hlog_common:schedule_next_daily_scavenger:1496 Scheduling next scavenger 20052 seconds from now. 2015-03-13 21:25:48.071 [info] <0.7.0> Application gdss_brick started on node '[email protected]' 2015-03-13 21:25:48.079 [info] <0.7.0> Application gdss_client started on node '[email protected]' 2015-03-13 21:25:48.080 [info] <0.132.0>@brick_admin:start:305 normal start, Args = [] 2015-03-13 21:25:48.121 [info] <0.7.0> Application gdss_admin started on node '[email protected]' 2015-03-13 21:25:48.124 [info] <0.7.0> Application embedded_hibari started on node '[email protected]'
There is a very simple demo function called eh_client_demo:demo/1. Try it from Erlang shell.
([email protected])1> eh_client_demo:demo(). Bootstrapping Hibari... ok ok Wait for 30 seconds. Creating table 'demo'... ok ok Wait for 30 seconds. brick_simple:add(demo, <<"/100/1/A">>, <<"AAA">>) -> {ok,1426252510468011} brick_simple:get_many(demo, <<"/100/1">>, 100) -> {ok,{[{<<"/100/1/A">>,1426252510468011,<<"AAA">>}],false}} brick_simple:do(demo, [txn, {set,<<"/100/1/A">>,0,<<"AAA">>,0,[]}, {set,<<"/100/1/B">>,0,<<"AAA">>,0,[]}]) -> [{ok,1426252510469528},{ok,1426252510469532}] brick_simple:get_many(demo, <<"/100/1">>, 100) -> {ok,{[{<<"/100/1/A">>,1426252510469528,<<"AAA">>}, {<<"/100/1/B">>,1426252510469532,<<"AAA">>}], false}} ok ([email protected])2>
To access Hibari admin server’s web-based management console, open http://localhost:23080/ with a web browser.
Check out the following files:
-
rebar.config for dependency
-
eh_app.erl's +manual_start/0
-
eh_admin_client.erl for bootstrap process
All Hibari data files will be created inside ./hibari/ directory (except ./Schema.local). You can change the data file location by sys.config.
-
Replace error(1) in eh_admin_client with better errors
-
(DONE) Create tables from the application
-
(IN-PROGRESS) Demonstrate CRUD operations
-
Run checkpoint operation
-
Add multi-node configuration
-
Demonstrate node down and recovery
-
…
embedded-hibari-sample is open-sourced under the Apache 2.0 license. See the LICENSE file for details.