附014.Kubernetes Prometheus+Grafana+EFK+Kibana+Glusterfs整合性方案

来源:https://www.cnblogs.com/itzgr/archive/2020/03/20/12531442.html
-Advertisement-
Play Games

一 glusterfs存儲集群部署 註意:以下為簡略步驟,詳情參考《附009.Kubernetes永久存儲之GlusterFS獨立部署》。 1.1 架構示意 略 1.2 相關規劃 主機 IP 磁碟 備註 k8smaster01 172.24.8.71 —— Kubernetes Master節點 H ...


一 glusterfs存儲集群部署

註意:以下為簡略步驟,詳情參考《附009.Kubernetes永久存儲之GlusterFS獨立部署》。

1.1 架構示意

1.2 相關規劃

主機 IP 磁碟 備註
k8smaster01 172.24.8.71 —— Kubernetes Master節點 Heketi主機
k8smaster02 172.24.8.72 —— Kubernetes Master節點 Heketi主機
k8smaster03 172.24.8.73 —— Kubernetes Master節點 Heketi主機
k8snode01 172.24.8.74 sdb Kubernetes Worker節點 glusterfs 01節點
k8snode02 172.24.8.75 sdb Kubernetes Worker節點 glusterfs 02節點
k8snode03 172.24.8.76 sdb Kubernetes Worker節點 glusterfs 03節點
提示:本規劃直接使用裸磁碟完成。

1.3 安裝glusterfs

# yum -y install centos-release-gluster # yum -y install glusterfs-server # systemctl start glusterd # systemctl enable glusterd 提示:建議所有節點安裝。

1.4 添加信任池

[root@k8snode01 ~]# gluster peer probe k8snode02 [root@k8snode01 ~]# gluster peer probe k8snode03 [root@k8snode01 ~]# gluster peer status #查看信任池狀態 [root@k8snode01 ~]# gluster pool list #查看信任池列表 提示:僅需要在glusterfs任一節點執行一次即可。

1.5 安裝heketi

[root@k8smaster01 ~]# yum -y install heketi heketi-client

1.6 配置heketi

[root@k8smaster01 ~]# vi /etc/heketi/heketi.json
  1 {
  2   "_port_comment": "Heketi Server Port Number",
  3   "port": "8080",
  4 
  5   "_use_auth": "Enable JWT authorization. Please enable for deployment",
  6   "use_auth": true,
  7 
  8   "_jwt": "Private keys for access",
  9   "jwt": {
 10     "_admin": "Admin has access to all APIs",
 11     "admin": {
 12       "key": "admin123"
 13     },
 14     "_user": "User only has access to /volumes endpoint",
 15     "user": {
 16       "key": "xianghy"
 17     }
 18   },
 19 
 20   "_glusterfs_comment": "GlusterFS Configuration",
 21   "glusterfs": {
 22     "_executor_comment": [
 23       "Execute plugin. Possible choices: mock, ssh",
 24       "mock: This setting is used for testing and development.",
 25       "      It will not send commands to any node.",
 26       "ssh:  This setting will notify Heketi to ssh to the nodes.",
 27       "      It will need the values in sshexec to be configured.",
 28       "kubernetes: Communicate with GlusterFS containers over",
 29       "            Kubernetes exec api."
 30     ],
 31     "executor": "ssh",
 32 
 33     "_sshexec_comment": "SSH username and private key file information",
 34     "sshexec": {
 35       "keyfile": "/etc/heketi/heketi_key",
 36       "user": "root",
 37       "port": "22",
 38       "fstab": "/etc/fstab"
 39     },
 40 
 41     "_db_comment": "Database file name",
 42     "db": "/var/lib/heketi/heketi.db",
 43 
 44     "_loglevel_comment": [
 45       "Set log level. Choices are:",
 46       "  none, critical, error, warning, info, debug",
 47       "Default is warning"
 48     ],
 49     "loglevel" : "warning"
 50   }
 51 }
 

1.7 配置免秘鑰

[root@k8smaster01 ~]# ssh-keygen -t rsa -q -f /etc/heketi/heketi_key -N "" [root@k8smaster01 ~]# chown heketi:heketi /etc/heketi/heketi_key [root@k8smaster01 ~]# ssh-copy-id -i /etc/heketi/heketi_key.pub root@k8snode01 [root@k8smaster01 ~]# ssh-copy-id -i /etc/heketi/heketi_key.pub root@k8snode02 [root@k8smaster01 ~]# ssh-copy-id -i /etc/heketi/heketi_key.pub root@k8snode03

1.8 啟動heketi

[root@k8smaster01 ~]# systemctl enable heketi.service [root@k8smaster01 ~]# systemctl start heketi.service [root@k8smaster01 ~]# systemctl status heketi.service [root@k8smaster01 ~]# curl http://localhost:8080/hello #測試訪問

1.9 配置Heketi拓撲

[root@k8smaster01 ~]# vi /etc/heketi/topology.json
  1 {
  2   "clusters": [
  3     {
  4       "nodes": [
  5         {
  6           "node": {
  7             "hostnames": {
  8               "manage": [
  9                 "k8snode01"
 10               ],
 11               "storage": [
 12                 "172.24.8.74"
 13               ]
 14             },
 15             "zone": 1
 16           },
 17           "devices": [
 18             "/dev/sdb"
 19           ]
 20         },
 21         {
 22           "node": {
 23             "hostnames": {
 24               "manage": [
 25                 "k8snode02"
 26               ],
 27               "storage": [
 28                 "172.24.8.75"
 29               ]
 30             },
 31             "zone": 1
 32           },
 33           "devices": [
 34             "/dev/sdb"
 35           ]
 36         },
 37         {
 38           "node": {
 39             "hostnames": {
 40               "manage": [
 41                 "k8snode03"
 42               ],
 43               "storage": [
 44                 "172.24.8.76"
 45               ]
 46             },
 47             "zone": 1
 48           },
 49           "devices": [
 50             "/dev/sdb"
 51           ]
 52         }
 53       ]
 54     }
 55   ]
 56 }
  [root@k8smaster01 ~]# echo "export HEKETI_CLI_SERVER=http://k8smaster01:8080" >> /etc/profile.d/heketi.sh [root@k8smaster01 ~]# echo "alias heketi-cli='heketi-cli --user admin --secret admin123'" >> .bashrc [root@k8smaster01 ~]# source /etc/profile.d/heketi.sh [root@k8smaster01 ~]# source .bashrc [root@k8smaster01 ~]# echo $HEKETI_CLI_SERVER http://k8smaster01:8080 [root@k8smaster01 ~]# heketi-cli --server $HEKETI_CLI_SERVER --user admin --secret admin123 topology load --json=/etc/heketi/topology.json

1.10 集群管理及測試

[root@heketi ~]# heketi-cli cluster list #集群列表 [root@heketi ~]# heketi-cli node list #捲信息 [root@heketi ~]# heketi-cli volume list #捲信息 [root@k8snode01 ~]# gluster volume info #通過glusterfs節點查看

1.11 創建StorageClass

[root@k8smaster01 study]# vi heketi-secret.yaml
  1 apiVersion: v1
  2 kind: Secret
  3 metadata:
  4   name: heketi-secret
  5   namespace: heketi
  6 data:
  7   key: YWRtaW4xMjM=
  8 type: kubernetes.io/glusterfs
  [root@k8smaster01 study]# kubectl create ns heketi [root@k8smaster01 study]# kubectl create -f heketi-secret.yaml #創建heketi [root@k8smaster01 study]# kubectl get secrets -n heketi [root@k8smaster01 study]# vim gluster-heketi-storageclass.yaml #正式創建StorageClass
  1 apiVersion: storage.k8s.io/v1
  2 kind: StorageClass
  3 metadata:
  4   name: ghstorageclass
  5 parameters:
  6   resturl: "http://172.24.8.71:8080"
  7   clusterid: "ad0f81f75f01d01ebd6a21834a2caa30"
  8   restauthenabled: "true"
  9   restuser: "admin"
 10   secretName: "heketi-secret"
 11   secretNamespace: "heketi"
 12   volumetype: "replicate:3"
 13 provisioner: kubernetes.io/glusterfs
 14 reclaimPolicy: Delete
  [root@k8smaster01 study]# kubectl create -f gluster-heketi-storageclass.yaml 註意:storageclass資源創建後不可變更,如修改只能刪除後重建。 [root@k8smaster01 heketi]# kubectl get storageclasses #查看確認 NAME PROVISIONER AGE gluster-heketi-storageclass kubernetes.io/glusterfs 85s [root@k8smaster01 heketi]# kubectl describe storageclasses ghstorageclass  

二 集群監控Metrics

註意:以下為簡略步驟,詳情參考《049.集群管理-集群監控Metrics》。

2.1 開啟聚合層

開機聚合層功能,使用kubeadm預設已開啟此功能,可如下查看驗證。 [root@k8smaster01 ~]# cat /etc/kubernetes/manifests/kube-apiserver.yaml

2.2 獲取部署文件

[root@k8smaster01 ~]# git clone https://github.com/kubernetes-incubator/metrics-server.git [root@k8smaster01 ~]# cd metrics-server/deploy/1.8+/ [root@k8smaster01 1.8+]# vi metrics-server-deployment.yaml
  1 ……
  2         image: mirrorgooglecontainers/metrics-server-amd64:v0.3.6	#修改為國內源
  3         command:
  4         - /metrics-server
  5         - --metric-resolution=30s
  6         - --kubelet-insecure-tls
  7         - --kubelet-preferred-address-types=InternalIP,Hostname,InternalDNS,ExternalDNS,ExternalIP	#添加如上command
  8 ……
 

2.3 正式部署

[root@k8smaster01 1.8+]# kubectl apply -f . [root@k8smaster01 1.8+]# kubectl -n kube-system get pods -l k8s-app=metrics-server [root@k8smaster01 1.8+]# kubectl -n kube-system logs -l k8s-app=metrics-server -f #可查看部署日誌

2.4 確認驗證

[root@k8smaster01 ~]# kubectl top nodes [root@k8smaster01 ~]# kubectl top pods --all-namespaces  

三 Prometheus部署

註意:以下為簡略步驟,詳情參考《050.集群管理-Prometheus+Grafana監控方案》。

3.1 獲取部署文件

[root@k8smaster01 ~]# git clone https://github.com/prometheus/prometheus

3.2 創建命名空間

[root@k8smaster01 ~]# cd prometheus/documentation/examples/ [root@k8smaster01 examples]# vi monitor-namespace.yaml
  1 apiVersion: v1
  2 kind: Namespace
  3 metadata:
  4   name: monitoring
[root@k8smaster01 examples]# kubectl create -f monitor-namespace.yaml

3.3 創建RBAC

[root@k8smaster01 examples]# vi rbac-setup.yml
  1 apiVersion: rbac.authorization.k8s.io/v1beta1
  2 kind: ClusterRole
  3 metadata:
  4   name: prometheus
  5 rules:
  6 - apiGroups: [""]
  7   resources:
  8   - nodes
  9   - nodes/proxy
 10   - services
 11   - endpoints
 12   - pods
 13   verbs: ["get", "list", "watch"]
 14 - apiGroups:
 15   - extensions
 16   resources:
 17   - ingresses
 18   verbs: ["get", "list", "watch"]
 19 - nonResourceURLs: ["/metrics"]
 20   verbs: ["get"]
 21 ---
 22 apiVersion: v1
 23 kind: ServiceAccount
 24 metadata:
 25   name: prometheus
 26   namespace: monitoring               #僅需修改命名空間
 27 ---
 28 apiVersion: rbac.authorization.k8s.io/v1beta1
 29 kind: ClusterRoleBinding
 30 metadata:
 31   name: prometheus
 32 roleRef:
 33   apiGroup: rbac.authorization.k8s.io
 34   kind: ClusterRole
 35   name: prometheus
 36 subjects:
 37 - kind: ServiceAccount
 38   name: prometheus
 39   namespace: monitoring              #僅需修改命名空間
[root@k8smaster01 examples]# kubectl create -f rbac-setup.yml

3.4 創建Prometheus ConfigMap

[root@k8smaster01 examples]# cat prometheus-kubernetes.yml | grep -v ^$ | grep -v "#" >> prometheus-config.yaml [root@k8smaster01 examples]# vi prometheus-config.yaml
  1 apiVersion: v1
  2 kind: ConfigMap
  3 metadata:
  4   name: prometheus-server-conf
  5   labels:
  6     name: prometheus-server-conf
  7   namespace: monitoring               #修改命名空間
  8 ……
[root@k8smaster01 examples]# kubectl create -f prometheus-config.yaml

3.5 創建持久PVC

[root@k8smaster01 examples]# vi prometheus-pvc.yaml
  1 apiVersion: v1
  2 kind: PersistentVolumeClaim
  3 metadata:
  4   name: prometheus-pvc
  5   namespace: monitoring
  6   annotations:
  7     volume.beta.kubernetes.io/storage-class: ghstorageclass
  8 spec:
  9   accessModes:
 10   - ReadWriteMany
 11   resources:
 12     requests:
 13       storage: 5Gi
[root@k8smaster01 examples]# kubectl create -f prometheus-pvc.yaml

3.6 Prometheus部署

[root@k8smaster01 examples]# vi prometheus-deployment.yml
  1 apiVersion: apps/v1beta2
  2 kind: Deployment
  3 metadata:
  4   labels:
  5     name: prometheus-deployment
  6   name: prometheus-server
  7   namespace: monitoring
  8 spec:
  9   replicas: 1
 10   selector:
 11     matchLabels:
 12       app: prometheus-server
 13   template:
 14     metadata:
 15       labels:
 16         app: prometheus-server
 17     spec:
 18       containers:
 19         - name: prometheus-server
 20           image: prom/prometheus:v2.14.0
 21           command:
 22           - "/bin/prometheus"
 23           args:
 24             - "--config.file=/etc/prometheus/prometheus.yml"
 25             - "--storage.tsdb.path=/prometheus/"
 26             - "--storage.tsdb.retention=72h"
 27           ports:
 28             - containerPort: 9090
 29               protocol: TCP
 30           volumeMounts:
 31             - name: prometheus-config-volume
 32               mountPath: /etc/prometheus/
 33             - name: prometheus-storage-volume
 34               mountPath: /prometheus/
 35       serviceAccountName: prometheus
 36       imagePullSecrets:
 37         - name: regsecret
 38       volumes:
 39         - name: prometheus-config-volume
 40           configMap:
 41             defaultMode: 420
 42             name: prometheus-server-conf
 43         - name: prometheus-storage-volume
 44           persistentVolumeClaim:
 45             claimName: prometheus-pvc
[root@k8smaster01 examples]# kubectl create -f prometheus-deployment.yml

3.7 創建Prometheus Service

[root@k8smaster01 examples]# vi prometheus-service.yaml
  1 apiVersion: v1
  2 kind: Service
  3 metadata:
  4   labels:
  5     app: prometheus-service
  6   name: prometheus-service
  7   namespace: monitoring
  8 spec:
  9   type: NodePort
 10   selector:
 11     app: prometheus-server
 12   ports:
 13     - port: 9090
 14       targetPort: 9090
 15       nodePort: 30001
[root@k8smaster01 examples]# kubectl create -f prometheus-service.yaml [root@k8smaster01 examples]# kubectl get all -n monitoring

3.8 確認驗證Prometheus

瀏覽器直接訪問:http://172.24.8.100:30001/ clipboard  

四 部署grafana

註意:以下為簡略步驟,詳情參考《050.集群管理-Prometheus+Grafana監控方案》。

4.1 獲取部署文件

[root@k8smaster01 ~]# git clone https://github.com/liukuan73/kubernetes-addons [root@k8smaster01 ~]# cd /root/kubernetes-addons/monitor/prometheus+grafana

4.2 創建持久PVC

[root@k8smaster01 prometheus+grafana]# vi grafana-data-pvc.yaml
  1 apiVersion: v1
  2 kind: PersistentVolumeClaim
  3 metadata:
  4   name: grafana-data-pvc
  5   namespace: monitoring
  6   annotations:
  7     volume.beta.kubernetes.io/storage-class: ghstorageclass
  8 spec:
  9   accessModes:
 10   - ReadWriteOnce
 11   resources:
 12     requests:
 13       storage: 5Gi
[root@k8smaster01 prometheus+grafana]# kubectl create -f grafana-data-pvc.yaml

4.3 grafana部署

[root@k8smaster01 prometheus+grafana]# vi grafana.yaml
  1 apiVersion: extensions/v1beta1
  2 kind: Deployment
  3 metadata:
  4   name: monitoring-grafana
  5   namespace: monitoring
  6 spec:
  7   replicas: 1
  8   template:
  9     metadata:
 10       labels:
 11         task: monitoring
 12         k8s-app: grafana
 13     spec:
 14       containers:
 15       - name: grafana
 16         image: grafana/grafana:6.5.0
 17         imagePullPolicy: IfNotPresent
 18         ports:
 19         - containerPort: 3000
 20           protocol: TCP
 21         volumeMounts:
 22         - mountPath: /var/lib/grafana
 23           name: grafana-storage
 24         env:
 25           - name: INFLUXDB_HOST
 26             value: monitoring-influxdb
 27           - name: GF_SERVER_HTTP_PORT
 28             value: "3000"
 29           - name: GF_AUTH_BASIC_ENABLED
 30             value: "false"
 31           - name: GF_AUTH_ANONYMOUS_ENABLED
 32             value: "true"
 33           - name: GF_AUTH_ANONYMOUS_ORG_ROLE
 34             value: Admin
 35           - name: GF_SERVER_ROOT_URL
 36             value: /
 37         readinessProbe:
 38           httpGet:
 39             path: /login
 40             port: 3000
 41       volumes:
 42       - name: grafana-storage
 43         persistentVolumeClaim:
 44           claimName: grafana-data-pvc
 45       nodeSelector:
 46         node-role.kubernetes.io/master: "true"
 47       tolerations:
 48       - key: "node-role.kubernetes.io/master"
 49         effect: "NoSchedule"
 50 ---
 51 apiVersion: v1
 52 kind: Service
 53 metadata:
 54   labels:
 55     kubernetes.io/cluster-service: 'true'
 56     kubernetes.io/name: monitoring-grafana
 57   annotations:
 58     prometheus.io/scrape: 'true'
 59     prometheus.io/tcp-probe: 'true'
 60     prometheus.io/tcp-probe-port: '80'
 61   name: monitoring-grafana
 62   namespace: monitoring
 63 spec:
 64   type: NodePort
 65   ports:
 66   - port: 80
 67     targetPort: 3000
 68     nodePort: 30002
 69   selector:
 70     k8s-app: grafana
[root@k8smaster01 prometheus+grafana]# kubectl label nodes k8smaster01 node-role.kubernetes.io/master=true [root@k8smaster01 prometheus+grafana]# kubectl label nodes k8smaster02 node-role.kubernetes.io/master=true [root@k8smaster01 prometheus+grafana]# kubectl label nodes k8smaster03 node-role.kubernetes.io/master=true [root@k8smaster01 prometheus+grafana]# kubectl create -f grafana.yaml [root@k8smaster01 examples]# kubectl get all -n monitoring

4.4 確認驗證Prometheus

瀏覽器直接訪問:http://172.24.8.100:30002/

4.4 grafana配置

  • 添加數據源:略
  • 創建用戶:略
提示:所有grafana配置可配置參考:https://grafana.com/docs/grafana/latest/installation/configuration/。

4.5 查看監控

瀏覽器再次訪問:http://172.24.8.100:30002/ clipboard  
您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 使用UUID或者GUID產生的ID沒有規則 Snowflake演算法是Twitter的工程師為實現遞增而不重覆的ID實現的 概述 分散式系統中,有一些需要使用全局唯一ID的場景,這種時候為了防止ID衝突可以使用36位的UUID,但是UUID有一些缺點,首先他相對比較長,另外UUID一般是無序的。有些時 ...
  • 帶著問題去思考!大家好。 修飾符 修飾符有什麼作用呢?它是什麼東西呢? 首先修飾符有四種 private[ˈpraɪvət] protected [prə'tektɪd] internal [ɪnˈtɜːnl] public [ˈpʌblɪk] 他們的特效依次是: private 修飾符用於設置類或 ...
  • Humanizer 能夠滿足您所有.Net關於操作和展示以下類型的需求,包括字元串、枚舉、日期、時間、時間跨度、數字和數量。它採用 MIT 進行授權分發。 ...
  • using System.Security.Cryptography; static void Main(string[] args) { string rawString = "Make every second count."; string encryptedString = Encrypt3 ...
  • 近期公司重構了些界面,因為換膚和界面定製的緣故,需要把樣式和邏輯分開;所以記錄下關鍵的操作;主要是利用命令代替事件... 1 <Window x:Class="Demo_MVVM.MainWindow" 2 xmlns="http://schemas.microsoft.com/winfx/2006 ...
  • 客戶端請求Api資源網關(受保護的資源)時,第一次收到請求會到授權中心(ids4服務網關)獲取驗證公鑰,並保持到記憶體中,後面的請求不會再到授權中心去獲得驗證公鑰,而是Api資源網關(受保護的資源)中直接通過保存下來的驗證公鑰進行驗證,從而通過授權 ...
  • 接下來的問題是記憶體怎麼分割? 這樣就可以將程式的各個段載入到相應的記憶體分區中 1. 固定分區與可變分區 2. 可變分區的管理過程 核心數據結構 請求分配 釋放記憶體 再次申請 例題: 3. 引入分頁 解決記憶體分區導致的記憶體效率問題 1. 可變分區造成的問題 2. 從連續到離散 3. 接下來就是頁表 ...
  • 先編寫應用程式,使之包含三個進程,分別輸出三個字母,不知道從何下手,先研究一下上課老師講的例子,代碼如下 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <pthread.h> 4 5 void loop(){ 6 while(1); 7 ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...