惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
NISL@THU
NISL@THU
E
Exploit-DB.com RSS Feed
L
LINUX DO - 热门话题
L
Lohrmann on Cybersecurity
K
Kaspersky official blog
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
S
Schneier on Security
G
GRAHAM CLULEY
The Hacker News
The Hacker News
T
Threat Research - Cisco Blogs
Scott Helme
Scott Helme
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
T
Tor Project blog
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
爱范儿
爱范儿
P
Privacy International News Feed
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
S
Securelist
G
Google Developers Blog
The Last Watchdog
The Last Watchdog
Google Online Security Blog
Google Online Security Blog
美团技术团队
F
Fortinet All Blogs
小众软件
小众软件
Recorded Future
Recorded Future
V
Visual Studio Blog
B
Blog RSS Feed
H
Help Net Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Martin Fowler
Martin Fowler
Latest news
Latest news
Spread Privacy
Spread Privacy
H
Heimdal Security Blog

博客园 - 勤劳の洗碗机

pyinstaller打包exe故障解析 curl 访问k8s api k8s 之HPA应用 statefulset 及storageclass hadoop 伪分布式 完全分布式 及HA部署 LDAP部署及实践 docker 制作自己的mysql镜像 k8s 压测工具之perf-test mysql相关(三)、主从复制 shell执行mysql脚本 image-syncer 误删libc.so.6文件补救 docker 使用bind 动态扩容pvc k8s备份工具之velero jmeter使用 docker 制作ssh镜像 docker 制作自定义的nginx镜像 docker部署sharding-proxy
分布式minio
勤劳の洗碗机 · 2020-12-01 · via 博客园 - 勤劳の洗碗机

 http://slack.minio.org.cn/people/1

https://blog.csdn.net/qq_42875105/article/details/106675711?utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2~all~first_rank_v2~rank_v25-8-106675711.nonecase

https://github.com/minio/operator

hostpath形式

1、node加标签

kubectl  label nodes test-01 minio=true
kubectl  label nodes test-02 minio=true
kubectl  label nodes test-03 minio=true
kubectl label nodes test-04 minio=true
 

2、建立storageclass

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: local-storage
provisioner: kubernetes.io/no-provisioner
reclaimPolicy: Retain
volumeBindingMode: WaitForFirstConsumer

3、minio.yaml

apiVersion: v1
kind: Service
metadata:
  name: cluster-minio
  namespace: velero
  labels:
    app: cluster-minio
spec:
  clusterIP: None
  ports:
    - port: 9000
      name: cluster-minio
  selector:
    app: cluster-minio
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: cluster-minio
  namespace: velero
spec:
  selector:
    matchLabels:
      app: cluster-minio
  serviceName: cluster-minio
  replicas: 4
  template:
    metadata:
      labels:
        app: cluster-minio
    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: app
                operator: In
                values:
                - "cluster-minio"
            topologyKey: kubernetes.io/hostname
      tolerations:
      - operator: Exists
      containers:
      - name: cluster-minio
        env:
        - name: MINIO_ACCESS_KEY
          value: "cluster-minio"
        - name: MINIO_SECRET_KEY
          value: "cluster-minio123"
        image: 10.1.11.46/k8s-deploy/minio:latest
        args:
        - server
        - http://cluster-minio-{0...3}.cluster-minio.velero.svc.cluster.local/data
        ports:
        - containerPort: 9000
        # These volume mounts are persistent. Each pod in the PetSet
        # gets a volume mounted based on this field.
        volumeMounts:
        - name: data
          mountPath: /data
  # These are converted to volume claims by the controller
  # and mounted at the paths mentioned above.
  volumeClaimTemplates:
  - metadata:
      name: data
    spec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 100Mi
      # Uncomment and add storageClass specific to your requirements below. Read more https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class-1
      storageClassName: local-storage
      volumeMode: Filesystem

4、建立pv

apiVersion: v1
kind: PersistentVolume
metadata:
  name: minio-pv-0
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 1Gi
  hostPath:
    path: /minio-data-0
    type: ""
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: minio
          operator: In
          values:
          - "true"
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-storage
  volumeMode: Filesystem
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: minio-pv-1
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 1Gi
  hostPath:
    path: /minio-data-1
    type: ""
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: minio
          operator: In
          values:
          - "true"
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-storage
  volumeMode: Filesystem
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: minio-pv-2
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 1Gi
  hostPath:
    path: /minio-data-2
    type: ""
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: minio
          operator: In
          values:
          - "true"
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-storage
  volumeMode: Filesystem
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: minio-pv-3
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 1Gi
  hostPath:
    path: /minio-data-3
    type: ""
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: minio
          operator: In
          values:
          - "true"
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-storage
  volumeMode: Filesystem

5、建立service

apiVersion: v1
kind: Service
metadata:
  name: minio-nodeport
  namespace: velero
  labels:
    app: minio
spec:
  type: NodePort
  ports:
    - port: 9000
      name: minio
      targetPort: 9000
  selector:
    app: minio

nfs形式

前提:新建好nfs相关内容

nfs-client.yaml

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    NFSADDR: 192.168.92.147
    NFSPATH: /nfs/
    type: NFS
  name: nfs1
parameters:
  archiveOnDelete: "false"
provisioner: nfs-client-provisioner-nfs
reclaimPolicy: Delete
volumeBindingMode: Immediate

1、sts

apiVersion: v1
kind: Service
metadata:
  name: minio
  labels:
    app: minio
spec:
  clusterIP: None
  ports:
    - port: 9000
      name: minio
  selector:
    app: minio
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: minio
spec:
  selector:
    matchLabels:
      app: minio
  serviceName: minio
  replicas: 4
  template:
    metadata:
      labels:
        app: minio
    spec:
      tolerations:
      - key: "node-role.kubernetes.io/master"
        operator: "Exists"
        effect: "NoSchedule"
      containers:
      - name: minio
        env:
        - name: MINIO_ACCESS_KEY
          value: "minio"
        - name: MINIO_SECRET_KEY
          value: "minio123"
        image: minio/minio:RELEASE.2020-06-01T17-28-03Z
        args:
        - server
        - http://minio-{0...3}.minio.default.svc.cluster.local/data
        ports:
        - containerPort: 9000
        # These volume mounts are persistent. Each pod in the PetSet
        # gets a volume mounted based on this field.
        volumeMounts:
        - name: data
          mountPath: /data
  # These are converted to volume claims by the controller
  # and mounted at the paths mentioned above.
  volumeClaimTemplates:
  - metadata:
      name: data
    spec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 1Gi
      # Uncomment and add storageClass specific to your requirements below. Read more https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class-1
      storageClassName: nfs-client

2、建立pv

apiVersion: v1
kind: PersistentVolume
metadata:
  name: minio-pv-0
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 1Gi
  nfs:
    path: /nfs/top/minio/0
    server: 192.168.*.*
  persistentVolumeReclaimPolicy: Delete
  storageClassName: nfs-client
  volumeMode: Filesystem
apiVersion: v1
kind: PersistentVolume
metadata:
  name: minio-pv-1
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 1Gi
  nfs:
    path: /nfs/top/minio/1
    server: 192.168.*.*
  persistentVolumeReclaimPolicy: Delete
  storageClassName: nfs-client
  volumeMode: Filesystem
apiVersion: v1
kind: PersistentVolume
metadata:
  name: minio-pv-2
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 1Gi
  nfs:
    path: /nfs/top/minio/2
    server: 192.168.*.*
  persistentVolumeReclaimPolicy: Delete
  storageClassName: nfs-client
  volumeMode: Filesystem
apiVersion: v1
kind: PersistentVolume
metadata:
  name: minio-pv-3
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 1Gi
  nfs:
    path: /nfs/top/minio/3
    server: 192.168.*.*
  persistentVolumeReclaimPolicy: Delete
  storageClassName: nfs-client
  volumeMode: Filesystem

3、登录nfs服务器新建目录

mkdir -p /nfs/top/minio/{0,1,2,3}

4、对外服务

apiVersion: v1
kind: Service
metadata:
  labels:
    app: minio
  name: minio-svc-nodeport
  namespace: default
spec:
  ports:
  - name: minio
    port: 9000
    protocol: TCP
    targetPort: 9000
nodePort: 33007
selector: app: minio sessionAffinity: None type: NodePort

5、访问

[root@host-239 minio]# kubectl  get svc                           
NAME                                         TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)            AGE
minio-svc-nodeport                           NodePort       10.*.*.*         <none>        9000:33007/TCP     59s

使用nodeip加33007端口访问minio

压测

参考 https://www.cnblogs.com/yuhaohao/p/13099507.html

https://blog.csdn.net/ff_gogo/article/details/85252189

1、安装jdk环境和其他依赖

yum install  -y wget nmap-ncat

2、下载

wget https://github.com/intel-cloud/cosbench/releases/download/v0.4.2.c4/0.4.2.c4.zip

3、解压,修改配置

主要修改conf/s3-config-sample.xml的storage内容,添加minio 账号密码和地址

每个workflow可以多个workstage,每个workstage下可以有多个work;

每钟workstage对应一个工作类别,有work下的type字段标识,总共有init(创建bucket),write(创建object写数据)、cleanup(删除object)、dispose(删除bucket)。

修改后的内容:

<?xml version="1.0" encoding="UTF-8" ?>
<workload name="s3-sample" description="sample benchmark for s3">

  <storage type="s3" config="accesskey=minio;secretkey=minio123;endpoint=http://10.1.11.*:30780" />

  <workflow>

    <workstage name="init">
      <work type="init" workers="1" config="cprefix=s3testqwer;containers=r(1,2)" />
    </workstage>

    <workstage name="prepare">
      <work type="prepare" workers="1" config="cprefix=s3testqwer;containers=r(1,2);objects=r(1,10);sizes=c(128)KB" />
    </workstage>

    <workstage name="main">
      <work name="main" workers="8" runtime="30">
        <operation type="read" ratio="80" config="cprefix=s3testqwer;containers=u(1,2);objects=u(1,10)" />
        <operation type="write" ratio="20" config="cprefix=s3testqwer;containers=u(1,2);objects=u(11,20);sizes=c(128)KB" />
      </work>
    </workstage>

    <workstage name="cleanup">
      <work type="cleanup" workers="1" config="cprefix=s3testqwer;containers=r(1,2);objects=r(1,20)" />
    </workstage>

    <workstage name="dispose">
      <work type="dispose" workers="1" config="cprefix=s3testqwer;containers=r(1,2)" />
    </workstage>

  </workflow>

</workload>