作者 主題: 2018 9月份 SA@Taipei Nextcloud 簡單分享 + 入門普羅米修斯  (閱讀 18004 次)

0 會員 與 1 訪客 正在閱讀本文。

dearjack

  • SA 苦力組
  • 懷疑的國中生
  • **
  • 文章數: 77
    • 檢視個人資料
議程簡介 :

==== Nextcloud 簡單分享 by sakana   1.5 Hour ====
        感謝上次 Gary 分享 nextcloud and openSUSE in RPi3 workshop 101 ( https://opensuse-tw.kktix.cc/events/opensuse-nextcloud  ),  NextClould 是一個自由開源軟體,功能就是像是 Dropbox, 但是他是自由 ( free ) 和開放原始碼 ( open-source ) 的。NextCloud 讓大家都可以安裝和設置一個私人的伺服器,在 安全/自由/快樂 的狀態下使用它。由於 Dropbox 的 linux client 將於 2018/11/7 只支援 EXT4 非加密檔案系統, 其他系統都不支援, 所以 sakana 跨出使用 nextcloud or owncloud 取代 Dropbox 的第一步, 並加以執行, 也找到了沉睡在角落的 Raspberry Pi 3 的最後歸宿 :)

這次的 Nextcloud 簡單分享預計會聊到
* Nextcloud 超快速介紹
* Nextcloud 架設 in docker way and simple way
---- 透過 docker 的方式簡單快速架設 nextcloud
---- 這個部份會進行實做, 歡迎大家帶 Notebook 來一起實做
* Nextcloud client install 與 分享
---- Mac / Mobile ( Android or iOS ) client
* Nextcloud in Raspberry Pi with openSUSE Leap 15
* 實際 HomeLab  經驗分享


==== 入門普羅米修斯 by Haway 1.5 Hour ====
        我們利用短短的 1.5 小時來入門普羅米修斯, 目前最有名的監控軟體, 本課程屬於入門等級, 適合完全不知道普羅米修斯的人, 與想使用卻尚未入門的人, 我們將輕鬆帶領您完成幾個基本步驟, 你會了解運作的方式與基本的操控, 師父領進門, 修行看個人.


* 入門、概念
* 基本安裝
* 設定、資料、監控
* 數值計算、警報設定


講師: sakana  ( Max? ) + Haway

講師簡介:

sakana:
Study-Area 酷學園 小雜工  / GNOME.Asia Committee Member / openSUSE Member
喜歡社群自由無私的分享、熱愛自由軟體及 Linux 所帶來的方便性。
https://sakanamax.github.io/

HaWay:
Study-Area 酷學員 苦力組 / DNS / Git / GitLab 愛好者。


時間:
2018年9月15日 (星期六)
下午13:30~16:30
時間規劃: 3 hr


地點:
Gandi.net 
內湖洲子街 196 號 6 樓



費用: 免費(最貴)

活動報名網址:
https://opensuse-tw.kktix.cc/events/2018915


主辦單位:

     Study area 酷! 學園
     openSUSE Taiwan
« 上次編輯: 2018-09-11 11:42 由 sakana »

sakana

  • 酷!學園 學長們
  • 俺是博士!
  • *****
  • 文章數: 2590
  • 性別: 男
    • 檢視個人資料
    • sakananote
加上報名網址

活動報名網址:
https://opensuse-tw.kktix.cc/events/2018915

專心投入研究才是王道!!
http://sakananote2.blogspot.com

TWASA

  • 活潑的大學生
  • ***
  • 文章數: 269
  • 性別: 男
    • 檢視個人資料
幫忙補充關於 Prometheus

有人問到 scrape_interval 的設定如下最上面的是global設定,然後每個scrape_configs job也可以設定
藍色的是全域,綠色的就是只針對這個 job

global:
  scrape_interval:     15s # By default, scrape targets every 15 seconds.

  # Attach these labels to any time series or alerts when communicating with
  # external systems (federation, remote storage, Alertmanager).
  external_labels:
    monitor: 'codelab-monitor'

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # Override the global default and scrape targets from this job every 5 seconds.
    scrape_interval: 5s

    static_configs:
      - targets: ['localhost:9090']

另外在 Production 環境用 Docker 起 Prometheus 與 Grafana 因為他們都有資料要儲存,所以都要用到 Volume
Prometheus 官方預設的 Docker Image後端資料是存在 /prometheus,因為他參數是 --storage.tsdb.path=/prometheus
因為需要經常改設定檔不想每次用 docker exec 進去容器,所以也會把 Prometheus 的 YAML 也都用成 Volume
這樣可以在外面改 prometheus.yml 設定,然後要讓 Prometheus 重新載入設定可以送 HUP Signal

代碼: [選擇]
docker exec <CONTAINER_ID_OR_NAME> kill -HUP 1

另一個讓Prometheus 重新讀去設定檔的做法是可以向prometheus發送 HTTP POST,不過因為官方 Docker Image 預設沒有加參數 --web.enable-lifecycle
所以要自己 Build Image 加上該參數才能這樣用

代碼: [選擇]
curl -XPOST http://<Prometheus_IP_OR_FQDN>/-/reload


今天HaWay教的是基本用的是static_configs
對於監控數量多的公司要使用支援的服務發現機制來做 dynamically discovered 監控
目前支援的服務發現機制有 DNS, kubernetes, GCE, ec2, Azure, consul, openstack .....還蠻多的可以參考

https://prometheus.io/docs/prometheus/latest/configuration/configuration/


另外 Exporter 除了用限制 IP以外,因為我們公司的架構有 API gateway 所以比如 RD開發的程式有 Exporter功能
Prometheus 也支援類似的設定如下,要給 API key 才可以 Scrape 的到資料

代碼: [選擇]
  - job_name: 'my-prod-app'
    scrape_interval: 30s
    metrics_path: /app/v1/_metrics
    params:
      apikey: ['<KEY>']
    scheme: https
    static_configs:
         - targets: ['api.example.com']

Prometheus 資料儲存,如果不給參數的話預設是15天,參數是 --storage.tsdb.retention,參考官方文件如下
https://prometheus.io/docs/prometheus/latest/storage/

另外提到的 Prometheus 做 HA 跟資料集中的三方架構的設計可以參考這裡,只不過我也還沒實作沒辦法介紹就是
https://github.com/improbable-eng/thanos/blob/master/docs/design.md

Grafana的話支援多種儲存,存放路徑在 /var/lib/grafana
其實主要是存一些設定資料 json 檔跟plugin,資料部分預設好像是SQLite ,其實量不大也可以把資料存到資料庫比如Postgresql
Grafana 的話就有帳號密碼的驗證機制了,也支援Oauth等,直接用環境變數帶入來設定很方便可以參考官方文件
http://docs.grafana.org/installation/docker/
« 上次編輯: 2018-09-15 19:36 由 TWASA »