Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
ZTB_LAB2020
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Robert Piotrowski
ZTB_LAB2020
Commits
c485c7db
Commit
c485c7db
authored
4 years ago
by
Robert Piotrowski
Browse files
Options
Downloads
Patches
Plain Diff
Dosotosowano do influxbd_v2.0
parent
10ce33c2
Branches
influx_v2
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lab02/README.md
+25
-8
25 additions, 8 deletions
lab02/README.md
lab02/telegraf.conf
+6
-38
6 additions, 38 deletions
lab02/telegraf.conf
with
31 additions
and
46 deletions
lab02/README.md
+
25
−
8
View file @
c485c7db
...
...
@@ -77,15 +77,32 @@ docker restart telegraf

-
Utworzenie
```
bash
docker pull influxdb
docker stop influxdb
docker
rm
influxdb
docker create
-p
8086:8086
-v
influxdb:/var/lib/influxdb
--name
influxdb influxdb
docker run
--rm
\
-e
INFLUXDB_DB
=
sensors
-e
INFLUXDB_ADMIN_ENABLED
=
true
\
-e
INFLUXDB_ADMIN_USER
=
admin
-e
INFLUXDB_ADMIN_PASSWORD
=
ztb123
\
-e
INFLUXDB_USER
=
telegraf
-e
INFLUXDB_USER_PASSWORD
=
telegraf
\
-v
influxdb:/var/lib/influxdb
\
influxdb /init-influxdb.sh
docker volume
rm
influxdb
docker run
-d
-p
8086:8086
\
-v
influxdb:/var/lib/influxdb2
\
-e
DOCKER_INFLUXDB_INIT_MODE
=
setup
\
-e
DOCKER_INFLUXDB_INIT_USERNAME
=
telegraf
\
-e
DOCKER_INFLUXDB_INIT_PASSWORD
=
telegraf
\
-e
DOCKER_INFLUXDB_INIT_ORG
=
gut
\
-e
DOCKER_INFLUXDB_INIT_BUCKET
=
sensors
\
-e
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN
=
-Ukwi22XhqPYvXJQibqyOZhT4CDwwg5P3q874lAXTHG7BfOPnomUAFOf66mSTf6r5iaozF2d0SZ6AblTpNK8ZQ
==
\
--name
influxdb influxdb
sleep
60
docker
exec
-it
influxdb influx v1 dbrp create
\
--db
sensors
--rp
example-rp
\
--bucket-id
`
docker
exec
-it
influxdb influx bucket list
-o
gut
-t
-Ukwi22XhqPYvXJQibqyOZhT4CDwwg5P3q874lAXTHG7BfOPnomUAFOf66mSTf6r5iaozF2d0SZ6AblTpNK8ZQ
==
|
grep
sensors |
sed
-e
's/\s.*$//'
`
\
--default
--org
gut
docker
exec
-it
influxdb influx v1 auth create
\
--username
telegraf
--password
telegraf
\
--write-bucket
\
`
docker
exec
-it
influxdb influx bucket list
-o
gut
-t
-Ukwi22XhqPYvXJQibqyOZhT4CDwwg5P3q874lAXTHG7BfOPnomUAFOf66mSTf6r5iaozF2d0SZ6AblTpNK8ZQ
==
|
grep
sensors |
sed
-e
's/\s.*$//'
`
\
--org
gut
```
-
Start kontenera
...
...
@@ -133,4 +150,4 @@ docker ps
-
Skonfiguruj połączenie z bazą influx
-
Utwórz nowy dashboard wyświetlający temp.
-
Skonfiguruj Telegraf w taki sposób, aby pobierał dane pomiarowych MQTT z innych DevNuc - zmodyfikuj (1pkt.)
-
Skonfiguruj Telegraf w taki sposób, aby pobierał dane pomiarowych MQTT z innych DevNuc - zmodyfikuj
plik
[
telegraf.conf
](
telegraf.conf
)
(
1pkt.
)
This diff is collapsed.
Click to expand it.
lab02/telegraf.conf
+
6
−
38
View file @
c485c7db
...
...
@@ -102,45 +102,13 @@
# Configuration for sending metrics to InfluxDB
[[
outputs
.
influxdb
]]
## The full HTTP or UDP URL for your InfluxDB instance.
##
## Multiple URLs can be specified for a single cluster, only ONE of the
## urls will be written to each interval.
# urls = ["unix:///var/run/influxdb.sock"]
# urls = ["udp://127.0.0.1:8089"]
[[
outputs
.
influxdb_v2
]]
urls
= [
"http://172.17.0.1:8086"
]
## The target database for metrics; will be created as needed.
## For UDP url endpoint database needs to be configured on server side.
database
=
"sensors"
## The value of this tag will be used to determine the database. If this
## tag is not set the 'database' option is used as the default.
# database_tag = ""
## If true, the database tag will not be added to the metric.
# exclude_database_tag = false
## If true, no CREATE DATABASE queries will be sent. Set to true when using
## Telegraf with a user without permissions to create databases or when the
## database already exists.
skip_database_creation
=
true
## Name of existing retention policy to write to. Empty string writes to
## the default retention policy. Only takes effect when using HTTP.
# retention_policy = ""
## Write consistency (clusters only), can be: "any", "one", "quorum", "all".
## Only takes effect when using HTTP.
# write_consistency = "any"
## Timeout for HTTP messages.
# timeout = "5s"
## HTTP Basic Auth
username
=
"telegraf"
password
=
"telegraf"
organization
=
"gut"
## Destination bucket to write into.
bucket
=
"sensors"
token
=
"-Ukwi22XhqPYvXJQibqyOZhT4CDwwg5P3q874lAXTHG7BfOPnomUAFOf66mSTf6r5iaozF2d0SZ6AblTpNK8ZQ=="
###############################################################################
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment