91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

使用Yearning 做MYSQL審計docker+K8S部署

發布時間:2020-06-09 06:46:40 來源:網絡 閱讀:1163 作者:juestnow 欄目:系統運維

下載percona-toolkit (可選)

工作目錄 /apps/work/docker/sql-audit
下載percona-toolkit 套件
wget https://www.percona.com/downloads/percona-toolkit/3.0.13/binary/tarball/percona-toolkit-3.0.13_x86_64.tar.gz
tar -xvf percona-toolkit-3.0.13_x86_64.tar.gz
cd percona-toolkit-3.0.13
mv ./bin   /apps/work/docker/sql-audit/ptbin

下載Yearning-go

wget https://github.com/cookieY/Yearning/releases/download/v2.1.1/Yearning-2.1.1.linux-amd64.zip
tar -xvf Yearning-2.1.1.linux-amd64.zip
cd Yearning-2.1.1.linux-amd64/Yearning-go
# 刪除無用文件
rm # README .DS_Store
# 復制文件到/apps/work/docker/sql-audit/ 目錄
cp -pdr Yearning dist conf.toml /apps/work/docker/sql-audit/
# Yearning 可執行權限 
chmod +x Yearning

修改配置及修改dockerfile

cd  /apps/work/docker/sql-audit/
# 生成16位 SecretKey
< /dev/urandom tr -dc A-Z-a-z|head -c ${1:-16};echo 
[root@jenkins ~]# < /dev/urandom tr -dc A-Z-a-z|head -c ${1:-16};echo
vMEUDgvGIJqapfPQ
vi conf.toml
[Mysql]
Db = "Yearning"
Host = "sql-audit-mysql"
Port = "3306"
Password = "kUgUS6mYbL"
User = "root"

[General]
SecretKey = "vMEUDgvGIJqapfPQ"

#cp 一份時區文件
cp /usr/share/zoneinfo/Hongkong ./localtime
# 修改dockerfile
vi Dockerfile
ARG ARCH="amd64"
ARG OS="linux"
FROM alpine:latest
LABEL maintainer="The audit sql Authors <87984115@qq.com>"
ENV VERSION 2.1.1
COPY Yearning  /opt/Yearning
COPY dist /opt/dist
COPY conf.toml /opt/conf.toml
COPY ptbin/ /bin
COPY localtime /etc/localtime
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
RUN apk add --no-cache ca-certificates \
            perl-dbi perl-dbd-mysql \
            perl-time-hires perl-io-socket-ssl \
            && rm -rf /tmp/* \
            && rm -rf /var/cache/apk/*
EXPOSE   8000
WORKDIR /opt

ENTRYPOINT  ["/opt/Yearning"]

CMD ["-m", "-s"]

制作docker images

docker build -t mysql-audit:2.1.1 .
# docker 標簽上傳倉庫
 docker tag mysql-audit:2.1.1 docker.xxxx.com/library/mysql-audit:2.1.1
 docker push docker.xxxx.com/library/mysql-audit:2.1.1

docker run 方式運行

# mysql版本必須5.7及以上版本,請事先自行安裝完畢且創建Yearning庫,字符集應為UTF-8/UTF8mb4 (僅Yearning所需mysql版本)
docker run -tid --name sql-audit-mysql \
           -e MYSQL_ROOT_PASSWORD="kUgUS6mYbL" \
           -p "3306:3306" \
           -v/apps/mysqldb:/var/lib/mysql \
           mysql:5.7.26 \
           --character-set-server=utf8mb4 \
           --collation-server=utf8mb4_unicode_ci \
           --max_allowed_packet=256M \
           --transaction-isolation=READ-COMMITTED
# 等待mysql 啟動完成
使用Navicat  或者mysql 客戶端工具連接登陸mysql 數據庫 創建Yearning庫
CREATE DATABASE `Yearning` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
# 啟動Yearning
docker run -tid -p8000:8000 --link sql-audit-mysql:sql-audit-mysql mysql-audit:2.1.1 
#http://ip:8000 端口訪問
#Yearning 基于1080p分辨率開發僅支持1080p及以上顯示器訪問
#由于使用較多新的前端技術棧,請使用Chrome最新版本(不包括360等其他魔改版本)
默認密碼:admin/Yearning_admin
或者docker logs 容器ID 

k8s 方式運行

# 創建命名空間 sql-audit
kubectl create   namespace sql-audit
# helm 方式部署 mysql 
helm install -n sql-audit --name-template sql-audit --set metrics.enabled=true,metrics.serviceMonitor.enabled=true,persistence.size=50Gi stable/mysql
# 查看mysql 部署root 密碼
kubectl get secret --namespace sql-audit sql-audit-mysql -o jsonpath="{.data.mysql-root-password}" | base64 --decode; echo
[root@]~]#kubectl get secret --namespace sql-audit sql-audit-mysql -o jsonpath="{.data.mysql-root-password}" | base64 --decode; echo
Fo7FZg8FuA
# 我這里內網環境與K8S pod 及k8s 自身網絡已經打通可以遠程直接訪問
mysql -hsql-audit-mysql.sql-audit.svc.cluster.local -u root -p
# kubectl get pod --namespace sql-audit
[root@]~]#kubectl get pod --namespace sql-audit
NAME                               READY   STATUS    RESTARTS   AGE
sql-audit-mysql-6f6bcbf4bc-27d   2/2     Running   4          14d
kubectl exec -ti sql-audit-mysql-6f6bcbf4bc-27d /bin/bash -n  sql-audit
[root@]~]#kubectl exec -ti sql-audit-mysql-6f6bcbf4bc-27d /bin/bash -n  sql-audit
Defaulting container name to sql-audit-mysql.
Use 'kubectl describe pod/sql-audit-mysql-6f6bcbf4bc-27d -n sql-audit' to see all of the containers in this pod.
root@sql-audit-mysql-6f6bcbf4bc-27d:/#
root@sql-audit-mysql-6f6bcbf4bc-27d:/#
root@sql-audit-mysql-6f6bcbf4bc-27d:/#
root@sql-audit-mysql-6f6bcbf4bc-27d:/#

root@sql-audit-mysql-6f6bcbf4bc-27d:/# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7504
Server version: 5.7.26-log MySQL Community Server (GPL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE `Yearning` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
# 創建Yearning 數據庫
CREATE DATABASE `Yearning` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
# 創建mysql-audit configmap
vi mysql-audit-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: config-etc
  namespace: sql-audit
data:
  conf.toml: |
     [Mysql]
     Db = "Yearning"
     Host = "sql-audit-mysql"
     Port = "3306"
     Password = "Fo7FZg8FuA"
     User = "root"

     [General]
     SecretKey = "vMEUDgvGIJqapfPQ"
# 創建mysql-audit ingress
vi mysql-audit-ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: mysql-audit
  namespace: sql-audit
  annotations:
    kubernetes.io/ingress.class: traefik
    traefik.frontend.rule.type: PathPrefixStrip
    traefik.ingress.kubernetes.io/frontend-entry-points: http,https
    traefik.ingress.kubernetes.io/redirect-entry-point: https
spec:
  rules:
  - host: audit.xxxx.com
    http:
      paths:
        - path: /
          backend:
            serviceName: mysql-audit
            servicePort: 8000
  tls:
   - secretName:  tls-cert
# 創建mysql-audit secrets 
vi mysql-audit-secrets.yaml
apiVersion: v1
kind: Secret
metadata:
  labels:
    k8s-app: mysql-audit
  name: tls-cert
  namespace: sql-audit
type: Opaque
data:
  tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUdYekNDQlVlZ0F3SUJBZ0lTQkdVcDlSaVAvK2lNMDVYM0FuY0FUeTg1TUEwR0NTcUdTSWIzRFFFQkN3VUEKTUVveEN6QUpCZ05WQkFZVEFsVlRNUll3RkFZRFZRUUtFdzFNWlhRbmN5QkZibU55ZVhCME1TTXdJUVlEVlFRRApFeHBNWlhRbmN5QkZibU55ZVhCMElFRjFkR2h3Y21sMGVTQllNekFlRncweE9UQTNNRGt3T1RJNU1ESmFGdzB4Ck9URXdNRGN3T1RJNU1ESmFNQll4RkRBU0JnTlZCQU1UQzIxa1pHZGhiV1V1WTI5dE1JSUNJakFOQmdrcWhraUcKOXcwQkFRRUZBQU9DQWc4QU1JSUNDZ0tDQWdFQW9mSVdOdTE4YUp1T3Jzd0JjZE9lODN0dWpXZ2dpUXl0VVYxQwpqNVhYb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UbHdGa09OdU9xU254Vk1wYUM4aUQ1R1VIVi9JN3dBMTFRQjZlVEM3Wmd0ejhQRHM3MHN6U1A2dzNrNXIxaGpyCnJhV2RpMnBDL1hUQzRiR3VRQ3dhNXcwVTNBSWJCVGxCQW9JQkFEc1RONGhvclVHNWw3MXhLZk5ibVBTbDZ6RlIKYTJ4d2U2VVZPOVZzMFpHeEdLWWJSN1VuVDBDL1FqUiswS2JsbE9leDdFY3cyMklCcmFFVzBGbXpuVnoyUW9FNwpMUE5COXhyTTFEeE56UjZEbFBUeERMcEFGWVlUcm40SWY1cjFVdVdpc2lMdmd6T2xGTlVITnN5UFJIZWNGblhUCnNhTk9JWkgrQTJ5KzF3QWdpSFZIS2JPRGRHeVFQVlQ0TXFFWkJaY2pQcmRBekNKcnloSHlYdHBqRjFSdlFEYTMKTwVM3U3JVTGM4djJGQWJ1VG1QZ2R1ZHBKd1Q4dENCa2VRKzZ4YmJWN3YrZzBEMG5EWFNIZFVwNXFyUzcrTnhtVwp4NWV4UHo1VENhYXcxSnkzWjRmT1MzMTV6eHJGdmRHTmhWRXhMMzRlUVlzOHRYN0N0VWxuWkNray9zYz0KLS0tLS1FTkQgUlNBIFBSSVZBVEUgS0VZLS0tLS0=

# 創建mysql-audit service
vi mysql-audit-service.yaml
---
kind: Service
apiVersion: v1
metadata:
  labels:
    k8s-app: mysql-audit
  name: mysql-audit
  namespace: sql-audit
spec:
  sessionAffinity: ClientIP
  sessionAffinityConfig:
    clientIP:
      timeoutSeconds: 10800
  selector:
    k8s-app: mysql-audit
  ports:
    - protocol: TCP
      port: 8000
      name: web
  type: ClusterIP
# 創建 mysql-audit deployment 
vi mysql-audit-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mysql-audit
  namespace: sql-audit
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: mysql-audit
  template:
    metadata:
      labels:
        k8s-app: mysql-audit
    spec:
      containers:
        - name: mysql-audit
          image: docker.xxxx.com/library/mysql-audit:2.1.1
          ports:
           - containerPort: 8000
             name: web
             protocol: TCP
          readinessProbe:
           httpGet:
             path: /
             port: web
             scheme: HTTP
           initialDelaySeconds: 25
           periodSeconds: 2
          livenessProbe:
           httpGet:
             path: /           
             port: web
             scheme: HTTP
           initialDelaySeconds: 30
           periodSeconds: 2
          resources:
            requests:
              cpu: 200m
              memory: 1Gi
            limits:
              memory: 2Gi
              cpu: 250m
          volumeMounts:
          - name: config-etc-volume
            mountPath: /opt/conf.toml
            subPath: conf.toml
      volumes:
        - name: config-etc-volume
          configMap:
            name: config-etc
            defaultMode: 0644
            items:
            - key: conf.toml
              path: conf.toml         

創建 Yearning 服務

kubectl apply -f .

驗證 Yearning 是否正常

 [root@]~]#kubectl get pod --namespace sql-audit | grep mysql-audit
mysql-audit-79899bdd44-4gb4l       1/1     Running   0          76m
#正常運行
#綁定hosts  我這個對外ingress ip 192.168.30.36
192.168.30.36 audit.xxxx.com
http://audit.mddgame.com # 會強制調整到https
查看密碼
kubectl log mysql-audit-79899bdd44-4gb4l   --namespace sql-audit
默認密碼:admin/Yearning_admin
# 都是中文版本具體里面功能操作摸索就能搞定

使用Yearning 做MYSQL審計docker+K8S部署
使用Yearning 做MYSQL審計docker+K8S部署
使用Yearning 做MYSQL審計docker+K8S部署

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

乐亭县| 保亭| 桓台县| 木兰县| 宕昌县| 班玛县| 延川县| 宁安市| 买车| 新昌县| 防城港市| 河津市| 杨浦区| 武宣县| 东兰县| 盐津县| 福泉市| 华亭县| 科技| 繁峙县| 桐城市| 平潭县| 林西县| 苏尼特右旗| 达拉特旗| 虹口区| 兴海县| 新田县| 辉南县| 天峨县| 沁水县| 浦县| 鹿泉市| 永寿县| 池州市| 榆林市| 舒城县| 景泰县| 枣阳市| 榆中县| 光山县|