content/chronograf/v1/administration/creating-connections.md
Connections to InfluxDB and Kapacitor can be configured through the Chronograf user interface (UI) or with JSON configuration files:
{{% note %}}
Note: Connection details are stored in Chronograf’s internal database chronograf-v1.db.
You may administer the internal database when restoring a Chronograf database
or when migrating a Chronograf configuration from BoltDB to etcd.
{{% /note %}}
To create an InfluxDB connection in the Chronograf UI:
Open Chronograf and click Configuration (wrench icon) in the navigation menu.
Click Add Connection.
Provide the necessary connection credentials.
{{< tabs-wrapper >}} {{% tabs %}} InfluxDB 1.x InfluxDB Cloud or OSS 2.x InfluxDB 3 {{% /tabs %}} {{% tab-content %}}
Connection URL: hostname or IP address and port of the InfluxDB 1.x instance
Connection Name: Unique name for this connection.
Username: InfluxDB 1.x username (Required only if authorization is enabled in InfluxDB)
Password: InfluxDB password (Required only if authorization is enabled in InfluxDB)
Telegraf Database Name: the database Chronograf uses to populate parts of the application, including the Host List page (default is telegraf)
Default Retention Policy: default retention policy
(if left blank, defaults to autogen)
Default connection: use this connection as the default connection for data exploration, dashboards, and administrative actions {{% /tab-content %}} {{% tab-content %}}
Enable the {{< req "InfluxDB v2 Auth" >}} option
Connection URL: InfluxDB Cloud region URL or InfluxDB OSS 2.x URL
http://localhost:8086
Connection Name: Unique name for this connection.
Organization: InfluxDB organization
Token: InfluxDB authentication token
Telegraf Database Name: InfluxDB bucket
Chronograf uses to populate parts of the application, including the Host List page (default is telegraf)
Default Retention Policy: default retention policy (leave blank)
Default connection: use this connection as the default connection for data exploration and dashboards
{{% note %}} For more information about connecting Chronograf to an InfluxDB Cloud or OSS 2.x instance, see:
--influxdb-v3-support-enabled flag or set the INFLUXDB_V3_SUPPORT_ENABLED=true environment variable:chronograf --influxdb-v3-support-enabled
Once enabled, select your InfluxDB 3 product from the Server Type dropdown:
telegraf)influxctl configurationinfluxctl configuration{{% note %}} For detailed product-specific instructions, see:
The following dashboards are available:
Manually create .src files to store InfluxDB connection details.
.src files are simple JSON files that contain key-value paired connection details.
The location of .src files is defined by the --resources-path
command line option, which is, by default, the same as the --canned-path.
A .src file contains the details for a single InfluxDB connection.
{{% note %}}
Only InfluxDB 1.x connections are configurable in a .src file.
Configure InfluxDB 2.x, Cloud, and InfluxDB 3 connections with CLI flags
or in the Chronograf UI.
{{% /note %}}
Create a new file named example.src (the filename is arbitrary) and place it at Chronograf's resource-path.
All .src files should contain the following:
{{< keep-url >}}
{
"id": "10000",
"name": "My InfluxDB",
"username": "test",
"password": "test",
"url": "http://localhost:8086",
"type": "influx",
"insecureSkipVerify": false,
"default": true,
"telegraf": "telegraf",
"organization": "example_org"
}
idA unique, stringified non-negative integer. Using a 4 or 5 digit number is recommended to avoid interfering with existing datasource IDs.
nameAny string you want to use as the display name of the source.
usernameUsername used to access the InfluxDB server or cluster. Only required if authorization is enabled on the InfluxDB instance to which you're connecting.
passwordPassword used to access the InfluxDB server or cluster. Only required if authorization is enabled on the InfluxDB instance to which you're connecting.
urlURL of the InfluxDB server or cluster.
typeDefines the type or distribution of InfluxDB to which you are connecting. Below are the following options:
| InfluxDB Distribution | type Value |
|---|---|
| InfluxDB OSS | influx |
| InfluxDB Enterprise | influx-enterprise |
insecureSkipVerifySkips the SSL certificate verification process.
Set to true if you are using a self-signed SSL certificate on your InfluxDB server or cluster.
defaultSet to true if you want the connection to be the default data connection used upon first login.
telegrafThe name of the Telegraf database on your InfluxDB server or cluster.
organizationThe ID of the organization you want the data source to be associated with.
.src files support the use of environment variables to populate InfluxDB connection details.
Environment variables can be loaded using the "{{ .VARIABLE_KEY }}" syntax:
{
"id": "10000",
"name": "My InfluxDB",
"username": "{{ .INFLUXDB_USER }}",
"password": "{{ .INFLUXDB_PASS }}",
"url": "{{ .INFLUXDB_URL }}",
"type": "influx",
"insecureSkipVerify": false,
"default": true,
"telegraf": "telegraf",
"organization": "example_org"
}
Kapacitor is the data processing component of the TICK stack. To use Kapacitor in Chronograf, create Kapacitor connections and configure alert endpoints. To create a Kapacitor connection using the Chronograf UI:
Open Chronograf and click Configuration (wrench icon) in the navigation menu.
Next to an existing InfluxDB connection, click Add Kapacitor Connection if there are no existing Kapacitor connections or select Add Kapacitor Connection in the Kapacitor Connection dropdown list.
In the Connection Details section, enter values for the following fields:
http://localhost:9092.Click Continue. If the connection is valid, the message "Kapacitor Created! Configuring endpoints is optional." appears. To configure alert endpoints, see Configuring alert endpoints.
Manually create .kap files to store Kapacitor connection details.
.kap files are simple JSON files that contain key-value paired connection details.
The location of .kap files is defined by the --resources-path command line option, which is, by default, the same as the --canned-path.
A .kap files contains the details for a single InfluxDB connection.
Create a new file named example.kap (the filename is arbitrary) and place it at Chronograf's resource-path.
All .kap files should contain the following:
{
"id": "10000",
"srcID": "10000",
"name": "My Kapacitor",
"url": "http://localhost:9092",
"active": true,
"organization": "example_org"
}
idA unique, stringified non-negative integer. Using a 4 or 5 digit number is recommended to avoid interfering with existing datasource IDs.
srcIDThe unique, stringified non-negative integer id of the InfluxDB server or cluster with which the Kapacitor service is associated.
nameAny string you want to use as the display name of the Kapacitor connection.
urlURL of the Kapacitor server.
activeIf true, specifies that this is the Kapacitor connection that should be used when displaying Kapacitor-related information in Chronograf.
organizationThe ID of the organization you want the Kapacitor connection to be associated with.
.kap files support the use of environment variables to populate Kapacitor connection details.
Environment variables can be loaded using the "{{ .VARIABLE_KEY }}" syntax:
{
"id": "10000",
"srcID": "10000",
"name": "My Kapacitor",
"url": "{{ .KAPACITOR_URL }}",
"active": true,
"organization": "example_org"
}