TimHsuTW
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# 如何在QNAP NAS上安裝influxDB及Grafana(X86) 本教學教您如何在QIoT Suite Lite資料透過Grafana呈現 (本教學暫時僅支援x86系列NAS) ## influxDB container ### 安裝 influxDB container 1. 開啟Container Station後按下Create 2. 輸入`influxdb`後按下搜尋 3. 於influxdb列表中按下**Install**後點擊**Next**及**OK** ![](https://i.imgur.com/lpCGNBd.png) 4. 切換至**Network**設定Port **2003** 及 **8086** 轉發: ![](https://i.imgur.com/DFfvbf2.png) 5. 切換至**Shared Folders**設定Database資料輸出至Container外部保存,參照下圖建立 `/var/lib/influxdb` 路徑的volume ![](https://i.imgur.com/Qq3pD2n.png) 6. 設定完畢後點擊**Create** ### 測試安裝完成的influxDB 1. 安裝完成後,點選左方 **Containers** 查看狀態,點擊建立好的 **influxdb** container ![](https://i.imgur.com/pS4uL4U.png) 2. 點擊**Terminal** ![](https://i.imgur.com/KMLPHOm.png) 3. 輸入`bash`後點擊**OK** ![](https://i.imgur.com/6LgBXfU.png) 3. 輸入`influx`並按下enter 4. 輸入`show databases`並按下enter,出現下方畫面即安裝成功 ![](https://i.imgur.com/UyF96WS.png) ### 建立database 建立一個名為demo的database,輸入 : ``` create database demo ``` ## QIoT Suite Lite ### 安裝 Node-red influxDB Plugin 詳細方式安裝方式可參考[如何在QIoT Suite Lite 中的Rule(Node-red)中安裝新的Plugin(以Webduino及CHT IoT為範例)](https://hackmd.io/dnyFiIedTbqUfrJqrYZRmg) 之**手動安裝Node-red npm 架上Plugin**的部分 : 1. SSH進入NAS 2. 進入`qiot-node-red` Container : ```bash system-docker exec -ti qiot-node-red bash ``` 3. 移動資料夾到`node_modules`目錄 : ```bash cd /usr/local/lib/node_modules/node-red/node_modules/ ``` 3. 安裝Node-red Plugin : ```bash npm install node-red-contrib-influxdb ``` 6. 重新啟動所有的Node-red執行程序 : ```bash supervisorctl restart all ``` ### 設定QIoT Suite Lite Rule 1. 請先參考 QIoT Suite Lite 操作手冊,設定好您的 Thing、Resource、IoT Application 等 2. 進入您的 IoT Application,切換頁面至Rule 3. 將 **influxdb** node拉入編輯區 ![](https://i.imgur.com/QoS0gE9.png) 4. 雙擊 **influxdb** node進入設定,點擊鉛筆 :pencil2: 符號設定伺服器 ![](https://i.imgur.com/zNIbTBU.png) 5. 參照您influxDB設定填入相應的設定(注意:若 influxDB 與 QIoT Suite Lite 處於同台NAS,IP請填入`10.0.5.1`) ![](https://i.imgur.com/U1AHgim.png) 6. 設定 **Measurement**,Measurement 類似 SQL table,請自訂名稱 ![](https://i.imgur.com/ldaaEDU.png) 7. 拖入 **Function** Node 並與 **influxdb** node 連接,雙擊 **Function** Node,參考下方範例程式碼填入: ```javascript msg.payload = { sensorId:msg.payload.sensorId, value:msg.payload.value }; return msg; ``` ![](https://i.imgur.com/ipLURRY.png) 8. 最後拖入 **QBroker** Node,雙擊設定 Thing-Resource 並與 **Function** Node 後按下**Save** 保存 ![](https://i.imgur.com/OVhEHWZ.png) ## Grafana container ### 安裝Grafana container 1. 開啟Container Station後按下Create 2. 輸入`grafana`後按下搜尋 3. 於grafana列表中按下 **Install** 後點擊 **Next** 及 **OK** ![](https://i.imgur.com/FlWQHrv.png) 4. 切換至**Network**設定Port 3000轉發: ![](https://i.imgur.com/MIeEIaC.png) 5. 其他設定可參考Grafana官方文件依據需求進行修改: http://docs.grafana.org/installation/docker/ 6. 設定完畢後點擊**Create** ### 設定Grafana Granfana 的預設的url為 http://[nasIP]:3000 預設登入的帳號密碼為 admin/admin ![](https://i.imgur.com/SYYc2i8.png) #### 建立datasource 1. 如同標示1,輸入你的influxDB所在位置,例如 http://192.168.1.10:8086 如果你是使用Container Station建立influxDB,那這邊的url應該為 http://10.0.3.1:8086 2. 輸入influxDB database名稱,如同標示2(以本範例來說database名稱為demo) ![](https://i.imgur.com/pbC2yA5.png) #### Grafana Dashboard簡易教學 1. 點擊 + 的按鈕,如同標示1 2. 點擊Dashboard,如同標示2處 ![](https://i.imgur.com/vGcwLtE.png) 3. 點擊Table(以Table作為範例) ![](https://i.imgur.com/D6ruBaA.png) 4. 點擊Table後會出現如圖的畫面,於Panel Title 處按下會出現選單 5. 選擇Edit,如標示2 ![](https://i.imgur.com/tM9tU63.png) 6. 選擇data source,本範例的data source為demo 7. 在 **FROM** 中選擇measurement 8. 根據需要設定其他選項 9. 步驟1、2、3完成後即可於畫面中間部份看到結果 ![](https://i.imgur.com/jPxHI3a.png) 備註1:若想直接使用InfluxQL語法,可於標示2處右方三個按鈕中的第一個中進行滑鼠點擊,選擇 **Toogle Edit Mode** ![](https://i.imgur.com/jTskLsl.png) #### 安裝Grafana plugin 方式 以安裝piechart的plugin做為範例,此Plugin安裝參考 : https://grafana.com/plugins/grafana-piechart-panel/installation 1. 進入Container Station,點選左方 **Containers** , 點擊您建立的 **grafana** container 2. 點擊 **Terminal** 3. 輸入`grafana-cli plugins install grafana-piechart-panel`(參考您要安裝Plugin指令)後點擊 **OK** 安裝完畢後,重啟Grafana container即可生效 ###### tags: `Tutorial`

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully