The basic operation of InfluxDB learning InfluxDB

Herein Contents
[Hide]
1 a, InfluxDB operation mode
2 II, InfluxDB database operations
3 III, InfluxDB Table Operator
4 IV data manipulation
5 five, Series operation
6 VI interface operation
herein belong "InfluxDB tutorial series" article series, the a total of 17 part series include the following:
InfluxDB of InfluxDB learning installation and introduction
basic concepts InfluxDB of InfluxDB learning
InfluxDB of InfluxDB learning the basic operation
InfluxDB InfluxDB learning the HTTP API writes
InfluxDB data retention policies InfluxDB learning (retention policies)
InfluxDB InfluxDB learning continuous query (continuous queries)
query operation InfluxDB InfluxDB learning the HTTP API
key concepts InfluxDB InfluxDB learning of
polymerization class function InfluxDB InfluxDB learning common functions (a)
InfluxDB InfluxDB learning common function (b) selecting class function
InfluxDB learning InfluxDB commonly used functions (c) conversion function like
say InfluxDB learning continuous query
Influxdb principle Detailed
solutions after InfluxDB installation web page can not be accessed
InfluxDB data backup and recovery methods, supports local and remote backup
InfluxDB execute the statement management (Query Management)
InfluxDB series of tutorials catalog
series details see: "InfluxDB tutorial series":
InfluxDB is a current popular sequence database, InfluxDB use the Go language, no external dependencies, configuration is very easy to install, suitable for Construction of monitoring system of large-scale distributed systems.
This series is InfluxDB tutorial series.
InfluxDB technical exchange group: 580 487 672
InfluxDB technology exchange forum: http: //bbs.linuxdaxue.com/forum-influxdb-1.html

InfluxDB provides classes SQL syntax, if familiar with SQL, then will be very easy to use.

This article will tell you about the basic operations of InfluxDB, InfluxDB more detailed tutorial Look: InfluxDB series of tutorials directory

InfluxDB technical exchange group: 580 487 672 (click to join)

 

A, InfluxDB operation
InfluxDB provided three operating modes:

1) The client command line

2) HTTP API interfaces

3) for each language API library

Mainly in the command line as an example, to introduce the Basic Operating InfluxDB today, HTTP API interface and a variety of language API library to find out more in a future article.

Two, InfluxDB database operations
like MYSQL, like, InfluxDB provide multi-database support, operation of the database MYSQL also the same.

1) Show Database:

> Show Databases
name: Databases
---------------
name
Telegraf
_internal
LIR
testDB
testMyDb
2) New Database:

> The Test the Create Database
> Databases Show
name: Databases
---------------
name
Telegraf
_internal
LIR
testDB
testMyDb
xk_name
the Test
3) delete the database

> Drop the Test Database
> Databases Show
name: Databases
---------------
name
Telegraf
_internal
LIR
testDB
testMyDb
xk_name
4) the use of a database

> Xk_name use
the Using Database xk_name
three, InfluxDB table operation data
in InfluxDB them, and no table (table) concept replaced MEASUREMENTS same table, the function of the conventional MEASUREMENTS database, so we may also be referred to InfluxDB MEASUREMENTS tables.

1) All the tables

> SHOW MEASUREMENTS
name: Measurements
------------------
name
Weather
2) New Table

InfluxDB no explicit statement of the new table, the table can only be established by way of insert new data. As follows:

insert disk_free, hostname = server01 value = 442221834240i 1435362189575692182
wherein disk_free is the table name, hostname is the index, value = xx value is recorded, the recording can have multiple values, and finally the specified time

After the execution results are as follows

> select * from disk_free
name: disk_free
---------------
time hostname value
1435362189575692182 server01 442221834240
3)删除表

> Disk_free drop Measurement
> Measurements Show
name: Measurements
------------------
name
Weather
four data operation
1) increase the data

Increase in the data using the insert mode, to be noted that the insert InfluxDB, the name and data between the tables (,) separated by commas, separated by spaces and the tag field, or a plurality among a plurality of tag field with a comma ( ,) separated.

> INSERT disk_free, hostname = server01 value = 442221834240i 1,435,362,189,575,692,182
> the SELECT * from disk_free
name: disk_free
---------------
Time hostname value
1,435,362,189,575,692,182 server01 442 221 834 240
In this statement, disk_free is the table name , hostname = server01 is the tag, part of the index, value = xx is a field, this can freely write, arbitrarily defined.

2) query data

SQL query with the same, are not repeated here.

3) modify and delete data

InfluxDB belongs to the timing database failed to provide modifying and deleting data.

But can be accomplished by deleting the data retention policy InfluxDB of (Retention Policies), this will be talked about in a future article.

Five, series operation
series which represents the table data, several lines can be drawn on the chart, the main series permutations calculated by tags.

We can query the series table, as follows:

> Show Series from MEM
Key
MEM, Host = ResourcePool-0246-billing07
MEM, Host = billing07
six interface operation
InfluxDB also provides a management interface and greatly reduce the entry difficulty, after starting the InfluxDB services, direct input <IP>: 8083 can access the interface. Following interface

 

Well, about the operation of a InfluxDB we first introduce so much, the future will be a third-party HTTP API and language API library operations detailed under InfluxDB for everyone, so stay tuned.

More InfluxDB detailed tutorial Look: InfluxDB series of tutorials directory

InfluxDB technical exchange group: 580 487 672 (click to
join) ----------------
Disclaimer: This article is CSDN blogger "Liu -_-- 'original article, follow the CC 4.0 BY- SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/waitig1992/article/details/74527144

Guess you like

Origin www.cnblogs.com/lhxsoft/p/11796344.html