Using the Postman tool, the request is

http://192.168.99.58:4242/api/put?details
Copy the code

The RAW type that passes the body content puts the test data in

[
    {
        "metric": "sys.cpu.nice",
        "timestamp": 1346846402,
        "value": 18,
        "tags": {
           "host": "web01",
           "dc": "lga"
        }
    }
]
Copy the code

Error message: “error”: “Unknown metric”

Tsd.core. auto_create_metrics needs to be changed from false to true. In this case, the metric is automatically created when data is uploaded. Otherwise, an Unknown Metric error is displayed. It can also be set to false, but usestsdb mkmetric proc.loadavg.1mTo manually add metrics.

Edit the conf file. This is where I installed it

Vi/opt/opentsdb - 2.3.1 / build/opentsdb. ConfCopy the code

Find tsD.core. auto_create_metrics set to true

The view process kills the TSDB process

ps -ef|grep opentsdb
Copy the code

Restart in this directory, restart the command

nohup sh tsdb tsd &
Copy the code

Test the write again, success

View the page input identifier

Automatic retrieval