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.
In the navigation menu on the left, select Data (Load Data) > Buckets.
Load Data
Click Create Bucket in the upper right.
Enter a Name for the bucket.
-
- Never to retain data forever.
- Older than to choose a specific retention period.
- Click Create to create the bucket.
Create a bucket in the Data Explorer
In the navigation menu on the left, select *Explore (Data Explorer).
Data Explorer
Enter a Name for the bucket.
Select when to Delete Data:
- Never to retain data forever.
- Older than to choose a specific retention period.
- 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.
- nanoseconds (
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
INFLUX_ORG_ID=YOUR_ORG_ID
curl --request POST \
"http://localhost:8086/api/v2/buckets" \
--header "Content-type: application/json" \
--data '{
"orgID": "'"${INFLUX_ORG_ID}"'",
"name": "iot-center",
"retentionRules": [
{
"type": "expire",
"everySeconds": 86400,
"shardGroupDurationSeconds": 0
}
For information about InfluxDB API options and response codes, see InfluxDB API Buckets documentation.