{"id":15127631,"url":"https://github.com/dajobe/hbase-docker","last_synced_at":"2025-04-05T10:09:53.760Z","repository":{"id":10214707,"uuid":"12311102","full_name":"dajobe/hbase-docker","owner":"dajobe","description":"HBase running in Docker","archived":false,"fork":false,"pushed_at":"2022-09-27T01:35:07.000Z","size":37,"stargazers_count":330,"open_issues_count":21,"forks_count":188,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-29T09:12:17.585Z","etag":null,"topics":["docker-container","hbase"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/dajobe/hbase/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"octocat/Spoon-Knife","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dajobe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-23T00:32:28.000Z","updated_at":"2024-11-22T20:51:27.000Z","dependencies_parsed_at":"2023-01-11T20:14:18.310Z","dependency_job_id":null,"html_url":"https://github.com/dajobe/hbase-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dajobe%2Fhbase-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dajobe%2Fhbase-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dajobe%2Fhbase-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dajobe%2Fhbase-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dajobe","download_url":"https://codeload.github.com/dajobe/hbase-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318745,"owners_count":20919484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-container","hbase"],"created_at":"2024-09-26T02:05:08.932Z","updated_at":"2025-04-05T10:09:53.738Z","avatar_url":"https://github.com/dajobe.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"HBase in Docker\n===============\n\nThis configuration builds a docker container to run HBase (with\nembedded Zookeeper) running on the files inside the container.\n\nNOTE\n----\n\nThe approach here requires editing the local server's `/etc/hosts`\nfile to add an entry for the container hostname.  This is because\nHBase uses hostnames to pass connection data back out of the\ncontainer (from it's internal Zookeeper).\n\nHopefully this can be improved with Docker's newer networking\nbut this hasn't been fixed yet.\n\n\nBuild Image\n-----------\n\n    $ docker build -t dajobe/hbase .\n\n\nPull image\n----------\n\nIf you want to pull the image already built then use this\n\n    $ docker pull dajobe/hbase\n\nMore details at https://hub.docker.com/r/dajobe/hbase/\n\n\nRun HBase\n---------\n\nI recommend using the start-hbase.sh script which will start the\ncontainer and inspect it to determine all the local API ports and Web\nUIs plus will offer to edit /etc/hosts to add an alias for the\ncontainer IP, if not already present.\n\n\t$ ./start-hbase.sh\n\tstart-hbase.sh: Starting HBase container\n\tstart-hbase.sh: Container has ID b2db2fb3c3a67e20e2addd5e4d2ffc9a51abaafc3f9b36f464af7739e82f6446\n\tstart-hbase.sh: /etc/hosts already contains hbase-docker hostname and IP\n\tstart-hbase.sh: Connect to HBase at localhost on these ports\n\t  REST API             127.0.0.1:32874\n\t  Rest Web UI          http://127.0.0.1:32873/\n\t  Thrift API           127.0.0.1:32872\n\t  Thrift Web UI        http://127.0.0.1:32871/\n\t  HBase ZK             127.0.0.1:32875\n\t  HBase Master Web UI  http://127.0.0.1:32870/\n\n\tstart-hbase.sh: OR Connect to HBase on container hbase-docker\n\t  REST API             hbase-docker:8080\n\t  Rest Web UI          http://hbase-docker:8085/\n\t  Thrift API           hbase-docker:9090\n\t  Thrift Web UI        http://hbase-docker:9095/\n\t  HBase ZK             hbase-docker:2181\n\t  HBase Master Web UI  http://hbase-docker:16010/\n\n\tstart-hbase.sh: For docker status:\n\tstart-hbase.sh: $ id=b2db2fb3c3a67e20e2addd5e4d2ffc9a51abaafc3f9b36f464af7739e82f6446\n\tstart-hbase.sh: $ docker inspect $id\n\nThe localhost ports on the Host machine listed above 32870-32874 will\nvary for every container and are ephemeral ports.\n\nAlternatively, to run HBase by hand:\n\n    $ mkdir data\n    $ id=$(docker run --name=hbase-docker -h hbase-docker -d -v $PWD/data:/data dajobe/hbase)\n\nand you will have to `docker inspect $id` to find all the ports.\n\nIf you want to run multiple hbase dockers on the same host, you can\ngive them different hostnames with the '-h' / '--hostname' argument.\nYou may have to give them different ports though.  Not tested.\n\nIf you want to customize the hostname used, set the\n`HBASE_DOCKER_HOSTNAME` envariable on the docker command line\n\n\nFind Hbase status\n-----------------\n\nMaster status if docker container DNS name is 'hbase-docker'\n\n    http://hbase-docker:16010/master-status\n\nThe region servers status pages are linked from the above page.\n\nThrift UI\n\n    http://hbase-docker:9095/thrift.jsp\n\nREST server UI\n\n    http://hbase-docker:8085/rest.jsp\n\n(Embedded) Zookeeper status\n\n    http://hbase-docker:16010/zk.jsp\n\n\nSee HBase Logs\n--------------\n\nIf you want to see the latest logs live use:\n\n    $ docker attach $id\n\nThen ^C to detach.\n\nTo see all the logs since the HBase server started, use:\n\n    $ docker logs $id\n\nand ^C to detach again.\n\nTo see the individual log files without using `docker`, look into\nthe data volume dir eg $PWD/data/logs if invoked as above.\n\n\nTest HBase is working via python over Thrift\n--------------------------------------------\n\nHere I am connecting to a the container's thrift API port (such as\ncreated by the start-hbase.sh script).  The port 32872 is the Thrift\nAPI port exported to the host because [Happybase][1] [2] uses Thrift\nto talk to HBase.\n\n\t$ python3\n\tPython 3.8.5 (default, Jul 21 2020, 10:48:26)\n\t[Clang 11.0.3 (clang-1103.0.32.62)] on darwin\n\tType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\t\u003e\u003e\u003e import happybase\n\t\u003e\u003e\u003e connection = happybase.Connection('127.0.0.1', 32872)\n\t\u003e\u003e\u003e connection.create_table('table-name', { 'family': dict() } )\n\t\u003e\u003e\u003e connection.tables()\n\t[b'table-name']\n\t\u003e\u003e\u003e table = connection.table('table-name')\n\t\u003e\u003e\u003e table.put('row-key', {'family:qual1': 'value1', 'family:qual2': 'value2'})\n\t\u003e\u003e\u003e for k, data in table.scan():\n\t...   print(k, data)\n\t...\n\tb'row-key' {b'family:qual1': b'value1', b'family:qual2': b'value2'}\n\t\u003e\u003e\u003e\n\n(Simple install for happybase: `sudo pip install happybase` although I\nuse `pip install --user happybase` to get it just for me)\n\n\nTest HBase is working from Java\n-------------------------------\n\n    $ docker run --rm -it --link $id:hbase-docker dajobe/hbase hbase shell\n\tHBase Shell\n\tUse \"help\" to get list of supported commands.\n\tUse \"exit\" to quit this interactive shell.\n\tFor Reference, please visit: http://hbase.apache.org/2.0/book.html#shell\n\tVersion 2.1.2, r1dfc418f77801fbfb59a125756891b9100c1fc6d, Sun Dec 30 21:45:09 PST 2018\n\tTook 0.0472 seconds\n\thbase(main):001:0\u003e status\n\t1 active master, 0 backup masters, 1 servers, 0 dead, 2.0000 average load\n\tTook 0.7255 seconds\n\thbase(main):002:0\u003e list\n\tTABLE\n\ttable-name\n\t1 row(s)\n\tTook 0.0509 seconds\n\t=\u003e [\"table-name\"]\n    hbase(main):003:0\u003e\n\nShowing the `table-name` table made in the happybase example above.\n\nAlternatively if you have the Hbase distribution available on the\nhost you can use `bin/hbase shell` if the hbase configuration has\nbeen set up to connect to host `hbase-docker` zookeeper port 2181 to\nget the servers via configuration property `hbase.zookeeper.quorum`\n\n\n\nProxy HBase UIs locally\n-----------------------\n\nIf you are running docker on a remote machine, it is handy to see\nthese server-private urls in a local browser so here is a\n~/.ssh/config fragment to do that\n\n    Host my-docker-server\n    Hostname 1.2.3.4\n        LocalForward 127.0.0.1:16010 127.0.0.1:16010\n        LocalForward 127.0.0.1:9095 127.0.0.1:9095\n        LocalForward 127.0.0.1:8085 127.0.0.1:8085\n\nWhen you `ssh my-docker-server` ssh connects to the docker server and\nforwards request on your local machine on ports 16010 / 16030 to the\nremote ports that are attached to the hbase container.\n\nThe bottom line, you can use these URLs to see what's going on:\n\n  * http://localhost:16010/master-status for the Master Server\n  * http://localhost:9095/thrift.jsp for the thrift UI\n  * http://localhost:8085/rest.jsp for the REST server UI\n  * http://localhost:16010/zk.jsp for the embedded Zookeeper\n\nto see what's going on in the container and since both your local\nmachine and the container are using localhost (aka 127.0.0.1), even\nthe links work!\n\n\n\n\n\nNotes\n-----\n\n[1] http://happybase.readthedocs.org/en/latest/\n\n[2] https://github.com/wbolster/happybase\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdajobe%2Fhbase-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdajobe%2Fhbase-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdajobe%2Fhbase-docker/lists"}