Create a bucket

Bucket limits

A single InfluxDB 2.2 OSS instance supports approximately 20 buckets actively being written to or queried across all organizations depending on the use case. Any more than that can adversely affect performance.

There are two places you can create a bucket in the UI.

  1. In the navigation menu on the left, select Data (Load Data) > Buckets.

    Load Data

  2. Click Create Bucket in the upper right.

  3. Enter a Name for the bucket.

    • Never to retain data forever.
    • Older than to choose a specific retention period.
  4. Click Create to create the bucket.

Create a bucket in the Data Explorer

  1. In the navigation menu on the left, select *Explore (Data Explorer).

    Data Explorer

  2. Enter a Name for the bucket.

  3. Select when to Delete Data:

    • Never to retain data forever.
    • Older than to choose a specific retention period.
  4. Click Create to create the bucket.

Use the to create a new bucket. A bucket requires the following:

  • organization name or ID

  • retention period (duration to keep data) in one of the following units:

    • nanoseconds (ns)
    • microseconds (us or µs)
    • milliseconds (ms)
    • seconds (s)
    • minutes (m)
    • hours (h)
    • days (d)
    • weeks (w)

    The minimum retention period is one hour.

Use the InfluxDB API to create a bucket.

Bucket limits

A single InfluxDB 2.2 OSS instance supports approximately 20 buckets actively being written to or queried across all organizations depending on the use case. Any more than that can adversely affect performance.

Create a bucket in InfluxDB using an HTTP request to the InfluxDB API endpoint. Use the POST request method and include the following in your request:

Example

  1. INFLUX_ORG_ID=YOUR_ORG_ID
  2. curl --request POST \
  3. "http://localhost:8086/api/v2/buckets" \
  4. --header "Content-type: application/json" \
  5. --data '{
  6. "orgID": "'"${INFLUX_ORG_ID}"'",
  7. "name": "iot-center",
  8. "retentionRules": [
  9. {
  10. "type": "expire",
  11. "everySeconds": 86400,
  12. "shardGroupDurationSeconds": 0
  13. }

For information about InfluxDB API options and response codes, see InfluxDB API Buckets documentation.