Use python to operate InfluxDB and python to operate influxdb
Environment: CentOS6.5 _ x64InfluxDB version: 1.1.0Python: 2.6Preparations
Start the server
Run the following command:
service influxdb start
Example:
[root@localhost ~]# service
This article explains how to use python to operate the InfluxDB method environment: CentOS6.5 _ x64
InfluxDB version: 1.1.0
Python: 2.6
Preparations
Start the server
Run the following command:
service influxdb start
Example:
[root@localhost ~]# service
Environment: centos6.5_x64Influxdb version: 1.1.0Python version: 2.6Preparatory work
Start the server
Execute the following command: service influxdb startExamples are as follows:[Email protected] ~~]#
Installing Influxdb-python
GitHub Address: Https://github.com/influxdata/influxdb-pythonI
" :{}}, "size": 100} ## set What field to filter the returned field values to. ' _scroll_id ', ' hits.hits._source.resource_id ', ' Hits.hits._source.timestamp ', ' Hits.hits._source.counter_volume ', ' [emailprotected] ',]## Specify search_type= "Scan" mode and return _scroll_id to Es.scroll for data usage response= es.scroll (scroll_id=scroll_id,scroll= "10m", Filter_path=return_fields,) #调试 #if notresponse.get (' hits '):# printresponse#sys.exit (1) #else: hits=response[' hits ' [' Hi
Tags: python influxdbPython3 uses the requests module to send an interface request to the INFLUXDB HTTP API to write data, as follows:1. Create a database[python] view plain copy
Import Requests
posturl= ' http://192.168.220.128:8086/query '
data = {' q ': ' Create DATABASE mydb '}
Response = Requests.post (PostURL, Data=data)
[
":"list_series_result",
"columns":[
"time",
"name"
],
"points":[
[
0,
"192.168.2.183/cpu-0/cpu-idle"
],
...
]
}
]
Install Grafana
Download grafana and decompress it on the web server. This saves the trouble of configuring Nginx/Apache, and directly uses the simplest Web Server python-m SimpleHTTPServer DRIVER:
$ wget http://grafanarel.s3.amazonaws.com/grafana-1.9.1.tar.gz
$ tar xzvf grafana-1.9.1.tar.gz
$ cd grafana-1.9.1.tar.gz
$
Tags: php write pos uses the error BSP button to specify manual The HTTP API also has two operations: Write and query, this article first introduces you to the Influxdb HTTP API write operation mode.In the previous article on INFLUXDB study: The basic operation of INFLUXDB learning Influxdb, we mentioned that there are
Recently used in the InfluxDB, here to record the learning process, but also hope to help other students to learn.This paper mainly introduces the functional characteristics of INFLUXDB and the installation process of INFLUXDB. For more Influxdb detailed tutorials See: INFLUXDB
InfluxDB: InfluxDB http api Query
In the last article on InfluxDB: InfluxDB's InfluxDB http api write operation, we introduced the process of using InfluxDB's http api to write data, this article introduces how to use InfluxDB's http api to query data. For more details about Influx
Tags: auth influxdb running his icon doc should group by ACKGrafana comes with a feature-rich data source plug-in influxdb. Supports rich query Editor, annotations, and templating (template) queries. Adding data sources (Adding the source)
Click the top Grafana icon to open the side menu.
In the Dashboards side menu under links, you should find a link called data sources.
Click on the but
Influxdb and traditional database in the concept of a lot of different, this article will give you some basic concepts in the INFLUXDB, more influxdb detailed tutorial see: INFLUXDB Series of Learning Tutorials DirectoryINFLUXDB Technology Group: 580487672 (click to join)Comparison with nouns in traditional database
method is as follows)$ sudo supervisorctl$ shutdown$ sudo service supervisor start5. Finally, throw a python program to the server, timed to detect more than 90% of the alarm.I use the slack alarm, the use of the PY library:Https://pypi.python.org/pypi/psutilHttps://pypi.python.org/pypi/pyslack-realSimilarly, the PY program is also put into the Supervisord.(This alarm program, directly change the code of Cadvisor with Go implementation is also a very
It is necessary to understand the TPS and QPS of the database as an operational DBA, and what is TPS, the QPS, and the simple understanding is:QPS: Number of queries per second, which is the number of DML operations per second on the databaseTPS: Transaction per second, which is the number of DDL operations per second on the databaseBy understanding them, you can master the basic operational status of an instanceHow to visualize them is an artifact of DBA, this chapter mainly introduces the impl
InfluxDB is an open source distributed timing, event, and metrics database.Written in the Go language without external dependencies. Its design goal is to achieve distributed and horizontal scaling expansion.It has three main features:1. Time series (timeseries): You can use time-related functions (such as Max, Min, sum, etc.)2. Metrics (Metric): You can calculate large amounts of data in real time3. Eevents (Event): It supports arbitrary event dataCh
GRAFANA+TELEGRAF+INFLUXDB, using the client-side storage->web Interface display mode of operation, using UTP transmission data, and support custom charts, with good extensibility,grafana page presentation is more beautiful, more importantly influxdb provides python api, provides the Python API ,
INFLUXDB can process tens of thousands of data per second, saving all of this data in a large amount of storage space, and sometimes we may not need to store all of the historical data, so INFLUXDB introduced a data retention policy (Retention policies), Used to allow us to customize the data retention time. For more Influxdb detailed tutorials See:
1) count () functionReturns the number of non-null values in an (field) field.Grammar:SELECT COUNT (Example:>select COUNT (water_level) from H2o_feetname:h2o_feet--------------time count1970-01-01t00:0 0:00z 15258Description Water_level This field has a total of 15,258 data in the H2o_feet table.Note: The function in Influxdb will default to epoch 0 (1970-01-01t00:00:00z) as time if no time is specified.You can add a time condition to the where, as fo
best to design your query conditions first. Of course, any data you insert will automatically be added to the time column and counted as a nanosecond timestamp.
The above is the basic concept of influx and the basic use of records, the following is the use of interface development. The tornado example is a RESTful query interface.Influx itself supports restful HTTP Api,python with direct encapsulation of interfaces that can be invoked, directly
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.