1 # Test a minimal hbase cluster
3 import ../make-test-python.nix (
11 name = "hadoop-hbase";
16 "fs.defaultFS" = "hdfs://namenode:8020";
22 zookeeperQuorum = "zookeeper";
28 services.zookeeper.enable = true;
29 networking.firewall.allowedTCPPorts = [ 2181 ];
36 namenode = defOpts // {
46 virtualisation.diskSize = 8192;
48 hdfs.datanode = defOpts;
59 inherit zookeeperQuorum;
72 inherit zookeeperQuorum;
73 regionServer = defOpts;
83 inherit zookeeperQuorum;
94 inherit zookeeperQuorum;
104 # wait for HDFS cluster
105 namenode.wait_for_unit("hdfs-namenode")
106 namenode.wait_for_unit("network.target")
107 namenode.wait_for_open_port(8020)
108 namenode.wait_for_open_port(9870)
109 datanode.wait_for_unit("hdfs-datanode")
110 datanode.wait_for_unit("network.target")
111 datanode.wait_for_open_port(9864)
112 datanode.wait_for_open_port(9866)
113 datanode.wait_for_open_port(9867)
116 zookeeper.wait_for_unit("zookeeper")
117 zookeeper.wait_for_open_port(2181)
119 # wait for HBase to start up
120 master.wait_for_unit("hbase-master")
121 regionserver.wait_for_unit("hbase-regionserver")
123 assert "1 active master, 0 backup masters, 1 servers" in master.succeed("echo status | HADOOP_USER_NAME=hbase hbase shell -n")
124 regionserver.wait_until_succeeds("echo \"create 't1','f1'\" | HADOOP_USER_NAME=hbase hbase shell -n")
125 assert "NAME => 'f1'" in regionserver.succeed("echo \"describe 't1'\" | HADOOP_USER_NAME=hbase hbase shell -n")
127 rest.wait_for_open_port(8080)
128 assert "${hbase.version}" in regionserver.succeed("curl http://rest:8080/version/cluster")
130 thrift.wait_for_open_port(9090)
133 meta.maintainers = with maintainers; [ illustris ];