Using the Cloud Bigtable Emulator

The Cloud SDK provides a local, in-memory emulator for Cloud Bigtable, which you can use to test your application. Because the emulator stores data only in memory, it will not persist data across runs. It is intended to help you use Cloud Bigtable for local development and testing, not for production deployments.

You can use the emulator with all Cloud Bigtable client libraries except for the PHP client library.

The emulator does not provide administrative APIs to create or manage instances and clusters. After the emulator starts up, you can connect to it using any project and instance name to create tables and read or write data.

Installing the emulator

To install the Cloud Bigtable emulator:

  1. Install the Cloud SDK.

  2. Update your gcloud command-line tool installation to get the latest features:

    gcloud components update beta
  3. Run the following command to start the emulator:

    gcloud beta emulators bigtable start

    If the emulator is not installed already, you will be prompted to download and install the binary for the emulator.

  4. Type Control-C to stop the emulator.

Using the emulator

To use the Cloud Bigtable emulator:

  1. Run the following command to start the Cloud Bigtable emulator:

    gcloud beta emulators bigtable start

    The emulator prints the host and port number where it is running.

    By default, the emulator chooses localhost:8086. To bind the emulator to a specific host and port, use the optional --host-port flag, replacing [HOST] and [PORT]:

    gcloud beta emulators bigtable start --host-port=[HOST]:[PORT]
  2. In the environment for your application, set the BIGTABLE_EMULATOR_HOST environment variable to the host and port where the Cloud Bigtable emulator is running (for example,

    If you are running the emulator on the same machine as your application, you can use the following command to set this environment variable automatically:

    $(gcloud beta emulators bigtable env-init)

    Setting this environment variable causes the application to run in the emulator, with no further action required. The client automatically uses the variable if it is set, instead of connecting to the Cloud Bigtable service.

  3. When you are finished using the emulator, type Control-C to stop the emulator, then unset BIGTABLE_EMULATOR_HOST with the following command:



The following table shows the filters that are currently supported.

Supported Supported, with limitations Not supported

Issues related to the Cloud Bigtable emulator are tracked in the google-cloud-go GitHub repository, where you can file bug reports and feature requests or comment on existing issues.

क्या यह पेज उपयोगी था? हमारे काम के बारे में अपनी राय दें:

निम्न के बारे में फ़ीडबैक भेजें...