Tutorial
Use HBase In Different Namespace
Operation Steps
Please refer the steps below to connect the external HBase to your namespace:
- Log in Kubernetes UI.
- Select the namespace you want to connect to the HBase.
-
Clicks on CREATE, and UPLOAD the YAML file. The content of YAML file must includes the configuration information of zookeeper, hbase-master, and hbase-regionserver of the HBase.
Here is an example of zookeeper configuration:
apiVersion: v1 kind: Service metadata: # name is the zookeeper service name in the external HBase environment. Make sure the names in the namespace are not same as the service name. name: zookeeper spec: ports: # The port for communication between the services. - port: 2181 targetPort: 2181 type: ExternalName # The format of externalName: 'zookeeperServiceName.theNamespaceofHBase.svc.cluster.local'. externalName: zookeeper.hbase-107.svc.cluster.local
-
Register HBase. Please refer to GIS Cloud Suite Documentation Storage Resources > HBase > Register HBase.
Notes:
When registering HBase, the format of server address is ‘zookeeperServerName:Port’, eg, zookeeper:2181.
Complete Example
apiVersion: v1
kind: Service
metadata:
name: zookeeper
spec:
ports:
- port: 2181
targetPort: 2181
type: ExternalName
externalName: zookeeper.hbase-107.svc.cluster.local
---
apiVersion: v1
kind: Service
metadata:
name: hbase-master
spec:
ports:
- port: 16000
targetPort: 16000
type: ExternalName
externalName: hbase-master.hbase-107.svc.cluster.local
---
apiVersion: v1
kind: Service
metadata:
name: hbase-regionserver
spec:
ports:
- port: 16020
targetPort: 16020
type: ExternalName
externalName: hbase-regionserver.hbase-107.svc.cluster.local