中文字幕日韩精品一区二区免费_精品一区二区三区国产精品无卡在_国精品无码专区一区二区三区_国产αv三级中文在线

k8s部署zabbix監(jiān)控系統(tǒng)-創(chuàng)新互聯(lián)

zabbix簡(jiǎn)介

目前創(chuàng)新互聯(lián)建站已為上千家的企業(yè)提供了網(wǎng)站建設(shè)、域名、網(wǎng)站空間、網(wǎng)站托管維護(hù)、企業(yè)網(wǎng)站設(shè)計(jì)、莊河網(wǎng)站維護(hù)等服務(wù),公司將堅(jiān)持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長(zhǎng),共同發(fā)展。

    Zabbix 是一種網(wǎng)絡(luò)監(jiān)視、管理系統(tǒng),基于 Server-Client 架構(gòu)。可用于監(jiān)視各種網(wǎng)絡(luò)服務(wù)、服務(wù)器和網(wǎng)絡(luò)機(jī)器等狀態(tài)。Zabbix 使用 MySQL、PostgreSQL、SQLite、Oracle 或 IBM DB2 儲(chǔ)存資料。Server 端基于 C語(yǔ)言、Web 前端則是基于 PHP 所制作的。Zabbix 可以使用多種方式監(jiān)視??梢灾皇褂?Simple Check 不需要安裝 Client 端,亦可基于 SMTP 或 HTTP 等各種協(xié)定做死活監(jiān)視。在客戶端如 UNIX、Windows 中安裝 Zabbix Agent 之后,可監(jiān)視 CPU 負(fù)荷、網(wǎng)絡(luò)使用狀況、硬盤容量等各種狀態(tài)。而就算沒(méi)有安裝 Agent 在監(jiān)視對(duì)象中,Zabbix 也可以經(jīng)由 SNMP、TCP、ICMP檢查,以及利用 IPMI、SSH、telnet 對(duì)目標(biāo)進(jìn)行監(jiān)視。另外,Zabbix 包含 XMPP 等各種 Item 警示功能。

zabbix特性

  • 安裝部署簡(jiǎn)單

  • web可視化管理界面

  • 開(kāi)源

  • 分布式

  • 實(shí)時(shí)繪圖

實(shí)驗(yàn)環(huán)境

  • Kubernetes版本1.16.0

  • zabbix版本4.4.5(官方鏡像)

  • mysql版本8.0.19(官方鏡像)

  • (猜你喜歡:使用zabbix監(jiān)控K8s出現(xiàn)異常POD的解決方法)

zabbix k8s部署

  • 部署mysql(采用hostpath做數(shù)據(jù)持久化)

   1.創(chuàng)建pv

vim mysql-pv.yamlkind: PersistentVolume apiVersion: v1 metadata:   name: mysql-pv-volume   labels:     type: local spec:   storageClassName: manual   capacity:     storage: 20Gi   accessModes:     - ReadWriteOnce   hostPath:     path: "/mnt/data" --- apiVersion: v1 kind: PersistentVolumeClaim metadata:   name: mysql-pv-claim spec:   storageClassName: manual   accessModes:     - ReadWriteOnce   resources:     requests:       storage: 20Gi

    2.創(chuàng)建mysql配置文件(configMap)

  • (猜你喜歡:zabbix監(jiān)控k8s出現(xiàn)的pod error status的解決方法)

vim mysql-config.yamlapiVersion: v1 kind: ConfigMap metadata:   name: mysql-config data:   custom.cnf: |     [mysqld]     default_storage_engine=innodb     skip_external_locking     skip_host_cache     skip_name_resolve     default_authentication_plugin=mysql_native_password

    3.創(chuàng)建mysql密碼(secret)

[root@k8s-master-01 mysql]# echo -n password|base64 cGFzc3dvcmQ= vim mysql-secret.yamlapiVersion: v1 kind: Secret metadata:   name: mysql-user-pwd data:   mysql-root-pwd: cGFzc3dvcmQ=

    4.創(chuàng)建mysql部署文件

vim mysql-deploy.yamlapiVersion: v1 kind: Service metadata:   name: mysql spec:   type: NodePort   ports:   - port: 3306     nodePort: 30006     protocol: TCP     targetPort: 3306    selector:     app: mysql --- apiVersion: apps/v1 kind: Deployment metadata:   name: mysql spec:   replicas: 1   selector:     matchLabels:       app: mysql   strategy:     type: Recreate   template:     metadata:       labels:         app: mysql     spec:       containers:       - image: mysql         name: mysql         imagePullPolicy: IfNotPresent         env:         - name: MYSQL_ROOT_PASSWORD           valueFrom:             secretKeyRef:               name: mysql-user-pwd               key: mysql-root-pwd         ports:         - containerPort: 3306           name: mysql         volumeMounts:         - name: mysql-config           mountPath: /etc/mysql/conf.d/         - name: mysql-persistent-storage           mountPath: /var/lib/mysql         - name: timezone           mountPath: /etc/localtime       volumes:       - name: mysql-config         configMap:           name: mysql-config       - name: timezone         hostPath:           path: /usr/share/zoneinfo/Asia/Shanghai       - name: mysql-persistent-storage         persistentVolumeClaim:           claimName: mysql-pv-claim

    5.使用kubectl命令及以上yaml文件部署mysql

[root@k8s-master-01 mysql]# kubectl apply -f ./       configmap/mysql-config created service/mysql created deployment.apps/mysql created persistentvolume/mysql-pv-volume created persistentvolumeclaim/mysql-pv-claim created secret/mysql-user-pwd created
  • 部署zabbix-server

vim zabbix-server-deploy.yamlapiVersion: v1 kind: Service metadata:   name: zabbixserver spec:   type: NodePort   ports:   - port:  10051     nodePort: 30051     protocol: TCP     targetPort: 10051   selector:     app: zabbix-server --- apiVersion: apps/v1 kind: Deployment metadata:   name: zabbix-server spec:   replicas: 1   selector:     matchLabels:       app: zabbix-server   template:     metadata:       labels:         app: zabbix-server     spec:       containers:         - name: zabbix-server           image: zabbix/zabbix-server-mysql           imagePullPolicy: IfNotPresent           ports:           - containerPort: 10051             name: server             protocol: TCP           readinessProbe:             tcpSocket:               port: server             initialDelaySeconds: 5             periodSeconds: 10           livenessProbe:             tcpSocket:               port: server             initialDelaySeconds: 15             periodSeconds: 20           env:           - name: DB_SERVER_HOST             value: "mysql"           - name: MYSQL_USER             value: "zabbix"           - name: MYSQL_PASSWORD             value: "zabbix"           - name: MYSQL_DATABASE             value: "zabbix"           - name: ZBX_CACHESIZE             value: "1024M"           - name: ZBX_TRENDCACHESIZE             value: "1024M"           - name: ZBX_HISTORYCACHESIZE             value: "2048M"           - name: ZBX_HISTORYINDEXCACHESIZE             value: "1024M"           - name: ZBX_STARTTRAPPERS             value: "5"           - name: ZBX_STARTPREPROCESSORS             value: "10"           - name: ZBX_STARTDBSYNCERS             value: "10"           - name: DB_SERVER_PORT             value: "3306"         - name: zabbix-agent           image: zabbix/zabbix-agent           imagePullPolicy: Always           ports:           - containerPort: 10050             name: zabbix-agent           env:           - name: ZBX_HOSTNAME             value: "Zabbix server"           - name: ZBX_SERVER_HOST             value: "127.0.0.1"           - name: ZBX_PASSIVE_ALLOW             value: "true"           - name: ZBX_STARTAGENTS             value: "3"           - name: ZBX_TIMEOUT             value: "10"           securityContext:             privileged: true
  • 部署zabbix-web

vim zabbix-web.yamlapiVersion: v1 kind: Service metadata:   name: zabbix-web spec:   type: NodePort   ports:   - port: 80     protocol: TCP     nodePort: 30080     targetPort: 80   selector:     app: zabbix-web --- apiVersion: apps/v1 kind: Deployment metadata:   name: zabbix-web spec:   replicas: 2   selector:     matchLabels:       app: zabbix-web   template:     metadata:       labels:         app: zabbix-web     spec:       containers:       - image: zabbix/zabbix-web-nginx-mysql         name: zabbix-web         imagePullPolicy: IfNotPresent         ports:         - containerPort: 80           name: web           protocol: TCP         env:         - name: DB_SERVER_HOST           value: "mysql"         - name:  ZBX_SERVER_HOST           value: "zabbixserver"         - name: MYSQL_USER           value: "zabbix"         - name: MYSQL_PASSWORD           value: "zabbix"         - name: TZ           value: "Asia/Shanghai"

   使用kubectl命令及以上yaml文件部署

[root@k8s-master-01 zabbix]# kubectl apply -f ./ service/zabbixserver created deployment.apps/zabbix-server created service/zabbix-web created deployment.apps/zabbix-web created
  • 查看部署的組件狀態(tài)

[root@k8s-master-01 zabbix]# kubectl get deploy,pod,svc,cm,secret,pv,pvc -o wide NAME                            READY   UP-TO-DATE   AVAILABLE   AGE     CONTAINERS                   IMAGES                                           SELECTOR deployment.apps/mysql           1/1     1            1           15m     mysql                        mysql                                            app=mysql deployment.apps/zabbix-server   1/1     1            1           3m23s   zabbix-server,zabbix-agent   zabbix/zabbix-server-mysql,zabbix/zabbix-agent   app=zabbix-server deployment.apps/zabbix-web      2/2     2            2           3m23s   zabbix-web                   zabbix/zabbix-web-nginx-mysql                    app=zabbix-web NAME                                READY   STATUS    RESTARTS   AGE     IP             NODE          NOMINATED NODE   READINESS GATES pod/mysql-ffcc44677-g2tlr           1/1     Running   0          15m     10.244.0.126   k8s-node-01   <none>           <none> pod/zabbix-server-75cdd8865-rnxhx   2/2     Running   0          3m24s   10.244.0.127   k8s-node-01   <none>           <none> pod/zabbix-web-856989975-8k45c      1/1     Running   0          3m23s   10.244.0.128   k8s-node-01   <none>           <none> pod/zabbix-web-856989975-hxdfl      1/1     Running   0          3m24s   10.244.1.118   k8s-node-02   <none>           <none> NAME                   TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)           AGE     SELECTOR service/kubernetes     ClusterIP   10.0.0.1     <none>        443/TCP           88d     <none> service/mysql          NodePort    10.0.0.15    <none>        3306:30006/TCP    15m     app=mysql service/zabbix-web     NodePort    10.0.0.189   <none>        80:30080/TCP      3m23s   app=zabbix-web service/zabbixserver   NodePort    10.0.0.234   <none>        10051:30051/TCP   3m23s   app=zabbix-server NAME                     DATA   AGE configmap/mysql-config   1      15m NAME                         TYPE                                  DATA   AGE secret/default-token-7qhlz   kubernetes.io/service-account-token   3      88d secret/mysql-user-pwd        Opaque                                1      15m secret/tls-secret            kubernetes.io/tls                     2      61d NAME                               CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                    STORAGECLASS   REASON   AGE   VOLUMEMODE persistentvolume/mysql-pv-volume   20Gi       RWO            Retain           Bound    default/mysql-pv-claim   manual                  15m   Filesystem NAME                                   STATUS   VOLUME            CAPACITY   ACCESS MODES   STORAGECLASS   AGE   VOLUMEMODE persistentvolumeclaim/mysql-pv-claim   Bound    mysql-pv-volume   20Gi       RWO            manual         15m   Filesystem
  • 通過(guò)瀏覽器訪問(wèn)測(cè)試

    瀏覽器地址欄輸入任意node節(jié)點(diǎn)的ip:30080   k8s部署zabbix監(jiān)控系統(tǒng)

   輸入用戶名及密碼訪問(wèn)

默認(rèn)用戶:Admin 默認(rèn)密碼:zabbix

k8s部署zabbix監(jiān)控系統(tǒng)

至此k8s部署zabbix-server測(cè)試完成。

本文暫不展開(kāi)說(shuō)明k8s基礎(chǔ)環(huán)境部署,后期再專門就k8s基礎(chǔ)環(huán)境部署做專門說(shuō)明。

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

本文標(biāo)題:k8s部署zabbix監(jiān)控系統(tǒng)-創(chuàng)新互聯(lián)
分享鏈接:http://www.rwnh.cn/article14/ddcjge.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供商城網(wǎng)站、網(wǎng)站改版、網(wǎng)站設(shè)計(jì)、云服務(wù)器、響應(yīng)式網(wǎng)站、軟件開(kāi)發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

綿陽(yáng)服務(wù)器托管
彩票| 新乐市| 怀宁县| 寿宁县| 成都市| 綦江县| 独山县| 扎鲁特旗| 崇礼县| 永仁县| 清河县| 新民市| 阿拉善右旗| 邛崃市| 北京市| 麻栗坡县| 泽州县| 福贡县| 平遥县| 唐山市| 田阳县| 武城县| 嵩明县| 雷州市| 漳州市| 炉霍县| 从江县| 蒲城县| 孝义市| 台北市| 娄烦县| 怀仁县| 蕉岭县| 武陟县| 封丘县| 商南县| 交口县| 肃宁县| 临城县| 贺州市| 荣昌县|