Scaling GCP Cloud BigTable

There are times when we have to provision automatic scaling of our NoSQL database due to parameters like the following:

  • The cluster's CPU load
  • The number of nodes in the cluster
  • The distribution of server request latencies for a table

To do this programmatically, we can use either Java or Python sample tools. We will see how to do it using Java sample tool. To use them, use the following procedures:

Java:

  • This tool is built on Apache Maven. If it is not installed on your shell, download it from https://maven.apache.org/download.cgi and extract it.
  • Run mnv -v in a new shell instance to confirm its installation.
  • Now, to build the sample tool, run:
mvn clean compile mvn exec:java -Dexec.mainClass="com.example.bigtable.scaler.MetricScaler" -Dexec.args="<project-id> <bigtable-instance-id>"

The sample tool mentioned above adds or removes nodes when CPU load goes above or below a specified threshold. The project-id and bigtable-instance-id tags make sure that it is our very instance which will autoscale.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset