【云原生 Prometheus篇】Prometheus架構詳解與核心組件的應用實例(Exporters、Grafana...)

Prometheus Part1

  • 一、常用的監控系統
    • 1.1 簡介
    • 1.2 Prometheus和zabbix的區別
  • 二、Prometheus
    • 2.1 簡介
    • 2.2 Prometheus的主要組件
      • 1)`Prometheus server`
      • 2)`Exporters`
      • 3)`Alertmanager`
      • 4)`Pushgateway`
      • 5)`Grafana`
    • 2.3 Prometheus的工作流程
    • 2.4 Prometheus數據采集配置
  • 三、二進制部署Prometheus
    • 3.1 初始化操作
    • 3.2 下載Prometheus源碼包并解壓
    • 3.3 Prometheus添加到系統服務中
    • 3.4 訪問測試
  • 四、Exporters部署實例
    • 4.1 實例一:部署 Node Exporter 監控系統級指標
      • Step1 準備源代碼包
      • Step2 將node-expoter添加到系統服務中
      • Step3 加入到 Prometheus 監控中
      • 補充:常用的各指標
    • 4.2 實例二:通過mysql exporter監控 MySQL
      • Step1 部署mysql exporter
      • Step2 修改Mysql的配置
      • Step3 啟動mysqld_exporter服務
      • Step4 添加Mysql到Prometheus監控中
      • Step5 查看Prometheus web界面
    • 4.3 實例三:監控Nginx
      • Step1 安裝nginx
      • Step2 修改nginx的配置文件,啟動nginx
      • Step3 解壓 nginx-exporter并啟動
      • Step4 將nginx加入到Prometheus監控中
      • Step5 訪問Prometheus web頁面
  • 五、部署 Grafana平臺進行展示
    • 5.1 下載和安裝
    • 5.2 配置數據源
    • 5.3 導入grafana監控面板

一、常用的監控系統

1.1 簡介

在這里插入圖片描述

老牌傳統的:Zabbix 、Nagios、Cacti …

云時代的:Prometheus、夜鶯 … …

1.2 Prometheus和zabbix的區別

Zabbix:更適用于傳統業務架構的物理機、虛擬機環境的監控,對容器的支持比較差;數據存儲主要采用的是關系型數據庫,會隨著監控節點數量的增加,關系型數據庫的壓力也會變大,監控數據的讀寫也會變的很慢;對大規模集群監控的性能比Prometheus要弱一些,可適用于單集群不超過2000節點的場景。

Prometheus:還能支持云環境、Kubernetes容器集群的監控,是目前容器監控最好的解決方案;數據存儲采用的是時序數據庫,大大的節省了存儲空間,并且提升了查詢效率;單集群支持的節點規模更大,通常超過2000臺節點、業務服務數量大于1000個的時候建議直接上Prometheus。

二、Prometheus

Prometheus 官網地址:https://prometheus.io

Prometheus github 地址:https://github.com/prometheus

2.1 簡介

Prometheus 是一個開源的監控系統 + 時間序列數據庫數據模型是 指標度量名稱{鍵值對標簽} 的時間序列數據格式。

2.2 Prometheus的主要組件

在這里插入圖片描述

1)Prometheus server

Prometheus服務的核心組件

通過http pull拉取的方式采集監控指標數據(時間序列數據);

作為時序數據庫持久化存儲監控指標數據;

根據告警規則生成告警通知推送給alertmanager;

內建service discovery動態服務發現功能(支持文件、consul、K8S等自動發現方式)

2)Exporters

指標暴露器,用于對原生不支持prometheus直接采集監控指標數據的系統或應用,收集監控指標數據并轉換格式給prometheus server拉取采集。

常用的exporters描述
Node-Exporter用于收集服務器節點的物理指標狀態數據,如平均負載、CPU、內存、磁盤、網絡等資源信息的指標數據,需要部署到所有運算節點。
mysqld-exporter/nginx-exporter用于監控特定服務,比如mysql/nginx
Kube-State-Metrics用于為 Prometheus 采集 K8S 資源數據
cAdvisor用來監控容器內部使用資源的信息,比如 CPU、內存、網絡I/O、磁盤I/O
blackbox-exporter監控業務容器存活性

3)Alertmanager

接收prometheus server發來的告警通知,負責對告警通知去重、分組,并路由給接收人(電子郵件、釘釘、企業微信等方式)

4)Pushgateway

作為中轉站,接收一些短期任務或只會push推送數據的任務發來的監控指標數據,用于臨時存儲監控指標數據并統一給prometheus server拉取采集

5)Grafana

外置的監控數據展示平臺,接入prometheus數據源,通過promQL查詢,并以圖形化形式展示

2.3 Prometheus的工作流程

在這里插入圖片描述

1)prometheus server通過http pull拉取的方式從監控目標target(exporter或pushgateway暴露的http接口)拉取監控指標數據;

2)prometheus server將采集到的監控指標數據通過時序數據庫持久化存儲在本地磁盤或外置存儲中;

3)prometheus server將采集到的監控指標數據與本地配置的告警規則進行計算比對,如果觸發告警則會生成告警通知推送給alertmanager;

4)alertmanager接收到prometheus server發來的告警通知后,對告警通知去重、分組,再通過電子郵件/釘釘/企業微信等方式發送給接收人;

5)prometheus支持原生的web UI或grafana接入prometheus數據源,通過promQL查詢,并以圖形化形式展示。

prometheus支持使用influxdb等作為外置時序數據庫,實現長期存儲歷史數據。

prometheus可基于thanos實現prometheus集群的高可用(主要方式是在K8S上部署,通過邊車模式與prometheus部署在同一個Pod里共享監控數據)

2.4 Prometheus數據采集配置

#這是一個模板
scrape_configs:
- job_name: XXX              #自定義監控任務的名稱metrics_path: "/metrics"   #指定獲取監控指標數據的URL路徑,一般都是 /metricsscheme: "http"             #指定拉取監控指標數據的協議,http(默認值)|httpsstatic_configs:            #定義靜態配置的監控目標- targets:                   #指定監控目標的IP和exporter的端口- <IP1>:<exporter的端口>- <IP2>:<exporter的端口>labels:                    #自定義監控目標的標簽<標簽key>: <標簽value>

三、二進制部署Prometheus

3.1 初始化操作

systemctl stop firewalld
setenforce 0

3.2 下載Prometheus源碼包并解壓

上傳 prometheus-2.45.0.linux-amd64.tar.gz 到 /opt 目錄中,并解壓

#建立工作目錄
mkdir -p /opt/prometheus#上傳源碼包
cd /opt/prometheus
tar xf prometheus-2.45.0.linux-amd64.tar.gz#方便補全
mv prometheus-2.45.0.linux-amd64 /usr/local/prometheus

在這里插入圖片描述

Prometheus配置清單文件詳解

cat /usr/local/prometheus/prometheus.yml | grep -v "^#"global:					#用于prometheus的全局配置,比如采集間隔,抓取超時時間等scrape_interval: 15s			#采集目標主機監控數據的時間間隔,默認為1mevaluation_interval: 15s 		#觸發告警生成alert的時間間隔,默認是1m# scrape_timeout is set to the global default (10s).scrape_timeout: 10s			#數據采集超時時間,默認10salerting:				#用于alertmanager實例的配置,支持靜態配置和動態服務發現的機制alertmanagers:- static_configs:- targets:# - alertmanager:9093rule_files:				#用于加載告警規則相關的文件路徑的配置,可以使用文件名通配機制# - "first_rules.yml"# - "second_rules.yml"scrape_configs:			#用于采集時序數據源的配置# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.- job_name: "prometheus"		#每個被監控實例的集合用job_name命名,支持靜態配置(static_configs)和動態服務發現的機制(*_sd_configs)# metrics_path defaults to '/metrics'metrics_path: '/metrics'    #指標數據采集路徑,默認為 /metrics# scheme defaults to 'http'.static_configs:				#靜態目標配置,固定從某個target拉取數據- targets: ["localhost:9090"]

3.3 Prometheus添加到系統服務中

#配置系統啟動文件
cat > /usr/lib/systemd/system/prometheus.service <<'EOF'
[Unit]
Description=Prometheus Server
Documentation=https://prometheus.io
After=network.target[Service]
Type=simple
ExecStart=/usr/local/prometheus/prometheus \
--config.file=/usr/local/prometheus/prometheus.yml \
--storage.tsdb.path=/usr/local/prometheus/data/ \
--storage.tsdb.retention=15d \
--web.enable-lifecycleExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure[Install]
WantedBy=multi-user.target
EOF

啟動

#啟動 Prometheust
systemctl enable prometheus --nownetstat -natp | grep :9090

在這里插入圖片描述

3.4 訪問測試

瀏覽器訪問:http://192.168.2.108:9090 ,訪問到 Prometheus 的 Web UI 界面。
在這里插入圖片描述

點擊頁面的 Status -> Targets;

如看到 Target 狀態都為 UP,說明 Prometheus 能正常采集到數據。
在這里插入圖片描述
在這里插入圖片描述

瀏覽器訪問:http://192.168.2.108:9090/metrics ,可以看到 Prometheus 采集的指標數據。

其中 Help 字段用于解釋當前指標的含義Type 字段用于說明數據的類型

在這里插入圖片描述

四、Exporters部署實例

4.1 實例一:部署 Node Exporter 監控系統級指標

Step1 準備源代碼包

上傳 node_exporter-1.3.1.linux-amd64.tar.gz 到 /opt 目錄中,并解壓。

tar xf node_exporter-1.3.1.linux-amd64.tar.gzmv node_exporter-1.3.1.linux-amd64/node_exporter /usr/local/bin

Step2 將node-expoter添加到系統服務中

配置啟動文件

cat > /usr/lib/systemd/system/node_exporter.service <<'EOF'
[Unit]
Description=node_exporter
Documentation=https://prometheus.io/
After=network.target[Service]
Type=simple
ExecStart=/usr/local/bin/node_exporter \
--collector.ntp \
--collector.mountstats \
--collector.systemd \
--collector.tcpstatExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure[Install]
WantedBy=multi-user.target
EOF

啟動

systemctl enable node_exporter --nownetstat -natp | grep :9100

在這里插入圖片描述

瀏覽器訪問:http://192.168.2.108:9100/metrics ,可以看到 Node Exporter 采集到的指標數據。
在這里插入圖片描述

Step3 加入到 Prometheus 監控中

修改Prometheus配置文件

vim /usr/local/prometheus/prometheus.yml
#在尾部增加如下內容- job_name: nodesmetrics_path: "/metrics"static_configs:- targets:- 192.168.2.108:9100- 192.168.2.100:9100- 192.168.2.102:9100labels:service: kubernetes

在這里插入圖片描述

重新載入配置

#方法一
systemctl reload prometheus#方法二
curl -X POST http://192.168.2.108:9090/-/reload 

測試

瀏覽器查看 Prometheus 頁面的 Status -> Targets
在這里插入圖片描述

補充:常用的各指標

●node_cpu_seconds_total
●node_memory_MemTotal_bytes
●node_filesystem_size_bytes{mount_point=PATH}
●node_system_unit_state{name=}
●node_vmstat_pswpin:系統每秒從磁盤讀到內存的字節數
●node_vmstat_pswpout:系統每秒鐘從內存寫到磁盤的字節數

更多指標介紹:https://github.com/prometheus/node_exporter

4.2 實例二:通過mysql exporter監控 MySQL

注:切換到Mysql服務器部署

Step1 部署mysql exporter

解壓mysql exporter源碼包

tar xf mysqld_exporter-0.14.0.linux-amd64.tar.gzmv mysqld_exporter-0.14.0.linux-amd64/mysqld_exporter /usr/local/bin/

配置啟動文件

cat > /usr/lib/systemd/system/mysqld_exporter.service <<'EOF'
[Unit]
Description=mysqld_exporter
Documentation=https://prometheus.io/
After=network.target[Service]
Type=simple
ExecStart=/usr/local/bin/mysqld_exporter --config.my-cnf=/etc/my.cnfExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure[Install]
WantedBy=multi-user.target
EOF

Step2 修改Mysql的配置

修改Mysql的配置文件

vim /etc/my.cnf
[client]
......
host=localhost
user=exporter
password=abc123

在這里插入圖片描述

授權 exporter 用戶

#登錄收據庫
mysql -uroot -p123123#授權
GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'exporter'@'localhost' IDENTIFIED BY 'abc123';#刷新
flush privillages

在這里插入圖片描述

重啟mysqld服務

systemctl restart mysqld

在這里插入圖片描述

Step3 啟動mysqld_exporter服務

systemctl enable mysqld_exporter --nownetstat -natp | grep :9104

在這里插入圖片描述

Step4 添加Mysql到Prometheus監控中

切換到Prometheus 服務器上操作。

修改 prometheus 配置文件,加入到 prometheus 監控中

vim /usr/local/prometheus/prometheus.yml
#在尾部增加如下內容- job_name: mysqldmetrics_path: "/metrics"static_configs:- targets:- 192.168.2.106:9104labels:service: mysqld

在這里插入圖片描述

重新載入配置

systemctl reload prometheus

Step5 查看Prometheus web界面

瀏覽器查看 Prometheus 頁面的 Status -> Targets
在這里插入圖片描述

4.3 實例三:監控Nginx

nginx-exporter下載地址:https://github.com/hnlq715/nginx-vts-exporter/releases/download/v0.10.3/nginx-vts-exporter-0.10.3.linux-amd64.tar.gz

nginx 下載地址:http://nginx.org/download/

nginx 插件下載地址:https://github.com/vozlt/nginx-module-vts/tags

Step1 安裝nginx

下載并解壓nginx插件包

cd /opttar xf nginx-module-vts-0.1.18.tar.gz
mv nginx-module-vts-0.1.18 /usr/local/nginx-module-vts

安裝nignx

#安裝依賴
yum -y install pcre-devel zlib-devel openssl-devel gcc gcc-c++ make
#管理用戶
useradd -M -s /sbin/nologin nginx#解壓代碼包
cd /opt
tar xf nginx-1.24.0.tar.gz#編譯安裝
cd nginx-1.24.0/
./configure --prefix=/usr/local/nginx \
--user=nginx \
--group=nginx \
--with-http_stub_status_module \
--with-http_ssl_module \
--add-module=/usr/local/nginx-module-vtsmake & make install

Step2 修改nginx的配置文件,啟動nginx

修改nginx配置文件

vim /usr/local/nginx/conf/nginx.conf
http {vhost_traffic_status_zone;					#添加vhost_traffic_status_filter_by_host on;		#添加,開啟此功能,在 Nginx 配置有多個 server_name 的情況下,會根據不同的 server_name 進行流量的統計,否則默認會把流量全部計算到第一個 server_name 上......server {......}server {vhost_traffic_status off;		#在不想統計流量的 server 區域,可禁用 vhost_traffic_statuslisten 8080;allow 127.0.0.1;allow 192.168.2.108;			#設置為 prometheus 的 ip 地址location /nginx-status {stub_status on;access_log off;}location /status {vhost_traffic_status_display;vhost_traffic_status_display_format html;}}
}#假如 nginx 沒有規范配置 server_name 或者無需進行監控的 server 上,那么建議在此 vhost 上禁用統計監控功能。否則會出現 127.0.0.1、hostname 等的域名監控信息。

在這里插入圖片描述

在這里插入圖片描述

ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/nginx -t

外鏈圖片轉存失敗,源站可能有防盜鏈機制,建議將圖片保存下來直接上傳

將nginx添加到系統服務中

cat > /lib/systemd/system/nginx.service <<'EOF'
[Unit]
Description=nginx
After=network.target[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true[Install]
WantedBy=multi-user.target
EOF

啟動

systemctl enable nginx --now

在這里插入圖片描述

瀏覽器訪問:http://192.168.2.107:8080/status ,可以看到 Nginx Vhost Traffic Status 的頁面信息
在這里插入圖片描述

Step3 解壓 nginx-exporter并啟動

源碼包

cd /opt/
tar -zxvf nginx-vts-exporter-0.10.3.linux-amd64.tar.gzmv nginx-vts-exporter-0.10.3.linux-amd64/nginx-vts-exporter /usr/local/bin/

添加到系統服務

cat > /usr/lib/systemd/system/nginx-exporter.service <<'EOF'
[Unit]
Description=nginx-exporter
Documentation=https://prometheus.io/
After=network.target[Service]
Type=simple
ExecStart=/usr/local/bin/nginx-vts-exporter -nginx.scrape_uri=http://localhost:8080/status/format/jsonExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure[Install]
WantedBy=multi-user.target
EOF

啟動nginx-exporter服務

systemctl enable nginx-exporter --nownetstat -natp | grep :9913

在這里插入圖片描述

Step4 將nginx加入到Prometheus監控中

切換到 Prometheus 服務器。

修改 prometheus 配置文件

vim /usr/local/prometheus/prometheus.yml
#在尾部增加如下內容- job_name: nginxmetrics_path: "/metrics"static_configs:- targets:- 192.168.2.107:9913labels:service: nginx

在這里插入圖片描述

重新載入配置

systemctl reload prometheus

Step5 訪問Prometheus web頁面

瀏覽器查看 Prometheus 頁面的 Status -> Targets
在這里插入圖片描述

五、部署 Grafana平臺進行展示

5.1 下載和安裝

#下載地址
https://grafana.com/grafana/download
https://mirrors.bfsu.edu.cn/grafana/yum/rpm/
yum install grafana-enterprise-8.5.9-1.x86_64.rpm

在這里插入圖片描述

systemctl enable grafana-server --nownetstat -natp | grep :3000

在這里插入圖片描述

瀏覽器訪問:http://192.168.2.108:3000默認賬號和密碼為 admin/admin
在這里插入圖片描述
在這里插入圖片描述

5.2 配置數據源

Configuration -> Data Sources -> Add data source -> 選擇 PrometheusHTTP -> URL 輸入 http://192.168.2.108:9090點擊 Save & Test

在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述

點擊 上方菜單 Dashboards--->Import 所有默認模板Dashboards -> Manage ,選擇 Prometheus 2.0 Stats 或 Prometheus Stats 即可看到 Prometheus job 實例的監控圖像

在這里插入圖片描述
在這里插入圖片描述

5.3 導入grafana監控面板

瀏覽器訪問:https://grafana.com/grafana/dashboards

在頁面中搜索 node exporter ,選擇適合的面板,點擊 Copy ID 或者 Download JSON

在這里插入圖片描述

在這里插入圖片描述

在這里插入圖片描述

grafana 頁面中,+ Create -> Import ,輸入面板 ID 號或者上傳 JSON 文件,點擊 Load,即可導入監控面板

在這里插入圖片描述

在這里插入圖片描述

在這里插入圖片描述

在這里插入圖片描述

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/162375.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/162375.shtml
英文地址,請注明出處:http://en.pswp.cn/news/162375.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

openGauss學習筆記-130 openGauss 數據庫管理-參數設置-重設參數

文章目錄 openGauss學習筆記-130 openGauss 數據庫管理-參數設置-重設參數130.1 背景信息130.2 GUC參數設置130.3 操作步驟130.4 示例 openGauss學習筆記-130 openGauss 數據庫管理-參數設置-重設參數 130.1 背景信息 openGauss提供了多種修改GUC參數的方法&#xff0c;用戶可…

【網絡】數據鏈路層協議

數據鏈路層協議 一、鏈路層解決的問題二、以太網協議1、局域網技術2、令牌環網&#xff08;了解&#xff09;3、以太網通信原理4、 MAC地址5、以太網幀格式6、碰撞避免7、最大傳輸單元MTU 二、ARP協議1、ARP數據的格式2、ARP協議的工作流程3、ARP緩存表4、ARP協議中的一些問題7…

11月23日星期四今日早報簡報微語報早讀

11月23日星期四&#xff0c;農歷十月十一&#xff0c;早報微語早讀。 1、我國5G基站總數達321.5萬個&#xff1b; 2、2023年兩院院士增選結果揭曉&#xff0c;共133人當選&#xff1b; 3、北京低保標準提升至每人每月1395元&#xff1b; 4、上海制定體育發展條例&#xff1a…

多重背包問題的優化 學習筆記 AcWing 5. 多重背包問題 II(算法基礎課)

乘法原理 百度百科 乘法原理是說把多個步驟的所有方法相乘&#xff0c;表示整個事件所有可能的解決方法 原題 有 N&#xfffd; 種物品和一個容量是 V&#xfffd; 的背包。 第 i&#xfffd; 種物品最多有 si&#xfffd;&#xfffd; 件&#xff0c;每件體積是 vi&#…

程序員必讀!深入解析Java線程調度算法神秘面紗!

哈嘍大家好&#xff0c;我是小米&#xff01;今天我們要聊的話題是關于Java中的線程調度算法。這可是一個技術大拿們在面試時常常拿出來考察我們的點子呢&#xff01;廢話不多說&#xff0c;讓我們一起深入了解一下吧&#xff01; 線程調度算法的背后 首先&#xff0c;讓我們…

[Linux] shell腳本之循環

一、循環定義 一組被重復執行的語句稱之為 循環體,能否繼續重復,決定循環的終止條件。 循環語句 是由循環體及循環的終止條件兩部分組成的。 二、for循環 2.1 帶列表循環 語法 for 變量名 in 取值列表do 命令序列 done 花括號用法&#xff1a; 花括號{ }和seq在for循環…

設計模式——狀態模式介紹

狀態模式是一種行為設計模式&#xff0c;它允許對象在內部狀態改變時改變它的行為。它基于對象的內部狀態而改變其行為&#xff0c;看起來好像修改了對象的類。 狀態模式的關鍵組件有三個&#xff1a;上下文(Context)、狀態(State)和具體狀態(Concrete State)。 下面是一個例…

年輕有為!2023兩院院士增選揭榜 45歲顏寧當選

大家好&#xff0c;我是極智視界&#xff0c;歡迎關注我的公眾號&#xff0c;獲取我的更多前沿科技分享 邀您加入我的知識星球「極智視界」&#xff0c;星球內有超多好玩的項目實戰源碼和資源下載&#xff0c;鏈接&#xff1a;https://t.zsxq.com/0aiNxERDq 通常&#xff0c;兩…

電商網站選擇云服務器要考慮什么?

極高的安全性 交易平臺最重要的是數據安全&#xff0c;這涉及到產品、用戶、平臺信息等&#xff0c;能夠保護數據隱私的安全&#xff0c;是網站交易的首要原則。 2020年&#xff0c;數據泄露、網絡滲透、大量數據被銷售、勒索軟件爆發......每個網站都可能成為黑客的目標&#…

CuratorFrameworkFactory.builder()方法可配置屬性

CuratorFrameworkFactory.builder()方法可以配置以下屬性&#xff1a; 1. connectString&#xff1a;ZooKeeper服務器的連接字符串。 2. sessionTimeoutMs&#xff1a;ZooKeeper會話超時時間。 3. connectionTimeoutMs&#xff1a;ZooKeeper連接超時時間。 4. retryPolicy&…

springboot自動重啟及SpringBoot Developer tools簡介

項目中引用了SpringBoot Developer tools&#xff0c;修改類后會自動重啟。 <dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><optional>true</optional&…

BTS-GAN:基于MRI和條件對抗性網絡的乳腺腫瘤計算機輔助分割系統

BTS-GAN: Computer-aided segmentation system for breast tumor using MRI and conditional adversarial networks BTS-GAN&#xff1a;基于MRI和條件對抗性網絡的乳腺腫瘤計算機輔助分割系統背景貢獻實驗方法Parallel dilated convolution module&#xff08;并行擴展卷積模塊…

逸學java【初級菜鳥篇】9.5枚舉

hi&#xff0c;我是逸塵&#xff0c;一起學java吧 枚舉是信息的標志和分類 當一個變量有幾種固定可能的取值時&#xff0c;就可以將它定義為類型的枚舉。 優點&#xff1a;代碼可讀性好&#xff0c;入參約束嚴謹&#xff0c;代碼優雅&#xff0c;是最好的信息分類技術&#x…

【AI讀論文】AutoML的8年回顧:分類、綜述與趨勢

論文標題&#xff1a;Eight years of AutoML: categorisation, review and trends 論文鏈接&#xff1a;https://link.springer.com/article/10.1007/s10115-023-01935-1 本文主要圍繞自動機器學習&#xff08;AutoML&#xff09;展開了系統性的文獻綜述&#xff0c;總結了該領…

【文末送書】重磅!這本30w人都在看的Python數據分析暢銷書:更新了!

歡迎關注博主 Mindtechnist 或加入【智能科技社區】一起學習和分享Linux、C、C、Python、Matlab&#xff0c;機器人運動控制、多機器人協作&#xff0c;智能優化算法&#xff0c;濾波估計、多傳感器信息融合&#xff0c;機器學習&#xff0c;人工智能等相關領域的知識和技術。關…

div中添加el-loading(局部loading的使用)

效果&#xff1a;在div中實現el-loading <div class"content-main">{{ hotList }}</div>getHotList(columnType) {this.$nextTick(() > {var loading this.$loading({lock: true,text: "努力加載中...",spinner: "el-icon-loading&qu…

揭示卡爾曼濾波器的威力

一、說明 作為一名數據科學家&#xff0c;我們偶爾會遇到需要對趨勢進行建模以預測未來值的情況。雖然人們傾向于關注基于統計或機器學習的算法&#xff0c;但我在這里提出一個不同的選擇&#xff1a;卡爾曼濾波器&#xff08;KF&#xff09;。 1960 年代初期&#xff0c;Rudol…

天池 機器學習算法(一): 基于邏輯回歸的分類預測

pytorch實戰 課時7 神經網絡 MSE的缺點&#xff1a;偏導值在輸出概率值接近0或者接近1的時候非常小&#xff0c;這可能會造成模型剛開始訓練時&#xff0c;偏導值幾乎消失&#xff0c;模型速度非常慢。 交叉熵損失函數&#xff1a;平方損失則過于嚴格&#xff0c;需要使用更合…

開始通過 Amazon SageMaker JumpStart 在亞馬遜云科技上使用生成式 AI

目前&#xff0c;生成式 AI 正受到公眾的廣泛關注&#xff0c;人們圍繞著許多人工智能技術展開討論。很多客戶一直在詢問有關亞馬遜云科技生成式 AI 解決方案的更多信息&#xff0c;本文將為您進行解答。 這篇文章通過一個真實的客戶使用案例概述了生成式 AI&#xff0c;提供了…

感恩節99句祝福語,感恩父母老師朋友親人朋友們,永久快樂幸福

1、流星讓夜空感動&#xff0c;生死讓人生感動&#xff0c;愛情讓生活感動&#xff0c;你讓我感動&#xff0c;在感恩節真心祝福你比所有的人都開心快樂。 2、感恩節到了&#xff0c;想問候你一下&#xff0c;有太多的話語想要說&#xff0c;但是不知從何說起&#xff0c;還是用…