Recent work needs to learn next grafana, according to the process of creating the next several dashboard summary records created.
The use of grafana make visual display, rds data source and timing are using postgresql database influxdb.
First, build a deployment
docker environment to build deployment, docker-compose documents about the content of the following:
version: '3' networks: mypj: driver: bridge services: grafana: image: grafana:6.3.5 container_name: grafana hostname: grafana restart: always volumes: - /home/project/grafana.ini:/etc/grafana/grafana.ini - /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime - /etc/timezone:/etc/timezone - /srv/docker/data/grafana:/var/lib/grafana environment: GF_SECURITY_ADMIN_PASSWORD: admin ports: - "3000:3000" networks: - mypj postgres: container_name: postgres image: postgres:9.4.5.1 restart: always environment: - POSTGRES_PASSWORD=password - POSTGRES_USER=adimin - POSTGRES_DB=adimin ports: - "5432:5432" volumes: - /srv/docker/data/postgres:/var/lib/postgresql/data networks: - mypj influxdb: image: influxdb:latest container_name: influxdb restart: always ports: - "8083:8083" # web管理工具端口 - "8086:8086" # HTTP API端口 - "8090:8090" volumes: - /srv/docker/data/influxdb:/var/lib/influxdb networks: - mypj
Description:
1. Log http: // your_ip: 3000 default user name and password admin / admin conduct can change the password to access the login prompt grafana
2. postgresql database using navicat connection, database, user name and password are in the docker-compose
3. influxdb database using InfluxDBStudio connection, the default user name and password root / password
4. Create a self-test data
Second, create a user using grafana
Note: Different versions grafana, location interface displays may have different settings
The first way:
Create a user, follow these steps:
The second way:
Invite users, follow these steps:
grafana user roles into three categories, create a multi-user can visually see the different user roles correspond to different permissions:
- admin: edit to add data source / organization / groups, may be configured plugins
- editor: create and modify dashboards / alarm rules, you can not create and edit data source
- viewer: can view any dashboard, you can set up temporarily edit the dashboard by viwer_can_editor but you can not save your changes, you can not create and edit data source
Third, add a data source using grafana
Influxdb add data sources and postgresql, refer to the following steps:
Fourth, the use of Explore query the database grafana
Fifth, create a dashboard using grafana
1. Create a new dashboard
2. Add a query or select a visualization of FIG.
3. Write query
4. choose a single value table Singlestat
5. Select dashboard using Guage
6. Use Table
Note: $ __ timeFilter will use the time to condition the upper right corner of the filter
Six, using the same panel Variables of different data variables to achieve switching
1. Create a variable upper right corner of the newly created dashboard settings icon, General to change the name of the dashboard, add tags, select Variables here
2. After the update has been added to the variable visible, show measurements; find out is that all measurement equivalent to a table in mysql, sql statement will replace the show query, switched data according to the table
3. The use of variable values when replacing query to be switched, here is an example of switching Device according to corresponding data, the upper left corner to switch
Description:
4. Use the right line graph legend disposed ranks
5. Set Title
Seven, the use of markdown
Eight, the use of plugins
1. Here a clock plug, first need to install the next step with reference grafana official website
# Into the visible grafana- container grafana bin directory under cli Docker Exec - grafana bash cd bin grafana the -cli plugins install grafana-Clock-Panel
2. Add the plugin in grafana, visible Clock This plug-in installation is successful
3. dashbooard panel added
problem:
How to set the size of the panel title, the word now, it seems all too small.