Updated on 2022-02-22 GMT+08:00

Modifying the Default Configuration Data

By default, OpenTSDB connects to the local TSD process of the node where the Spark executor resides. In MRS, use the default configuration.

Table 1 OpenTSDB data source configuration

Parameter

Description

Example Value

spark.sql.datasource.opentsdb.host

Indicates the IP address of the connected TSD process.

Null (default value)

xx.xx.xx.xx indicates the IP address. Separate multiple IP addresses with commas (,).

spark.sql.datasource.opentsdb.port

Indicates the port number of the TSD process.

4242 (default value)

spark.sql.datasource.opentsdb.randomSeed

Indicates whether to use the random seed when the spark.sql.datasource.opentsdb.host is set to multiple addresses. If this parameter is set to false, all executors on the same node are connected to the same host. In this way, spark.blacklist.enabled=true can be used to implement task fault tolerance.

false (default value)

Example

Run the set statement in spark-sql and spark-beeline, and then run other SQL statements.

set spark.sql.datasource.opentsdb.host = 192.168.2.143,192.168.2.158;
SELECT * FROM opentsdb_table ;