暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

mac 上学习k8s系列(24):minio(part III)文件系统

            在启动minio的时候,我们会声明一个pv,其中定义了minio最终文件的存储方式和路径  minio/k8s/standalone/pv.yaml

    volumeMode: Filesystem
    hostPath:
    path: /Users/xiazemin/source/k8s_learn/minio/k8s/standalone/minio/

    进入到/Users/xiazemin/source/k8s_learn/minio/k8s/standalone/minio/这个目录,我们可以看到里面的有一个隐藏目录:

      .minio.sys

      进入到这个隐藏目录,里面的文件如下:

        buckets
        config
        format.json
        multipart
        tmp

        假设我们创建一个buckey  

          mymusic

          然后上传一个文件

            test.tar

            1,我们去buckets里面看下文件列表如下

              .bloomcycle.bin
              .minio.sys
              .tracker.bin
              .usage-cache.bin
              .usage.json
              mymusic

              进入到mymusic目录我们就看到了我们上传的文件test.tar

                .metadata.bin
                .usage-cache.bin
                test.tar

                接着看下.usage.json文件的详细类容

                  {
                  "lastUpdate": "2021-11-21T06:22:24.902605427Z",
                  "objectsCount": 1,
                  "objectsTotalSize": 9099,
                  "objectsReplicationInfo": null,
                  "bucketsCount": 1,
                  "bucketsUsageInfo": {
                  "mymusic": {
                  "size": 9099,
                  "objectsPendingReplicationTotalSize": 0,
                  "objectsFailedReplicationTotalSize": 0,
                  "objectsReplicatedTotalSize": 0,
                  "objectsPendingReplicationCount": 0,
                  "objectsFailedReplicationCount": 0,
                  "objectsCount": 1,
                  "objectsSizesHistogram": {
                  "BETWEEN_1024_B_AND_1_MB": 1,
                  "BETWEEN_10_MB_AND_64_MB": 0,
                  "BETWEEN_128_MB_AND_512_MB": 0,
                  "BETWEEN_1_MB_AND_10_MB": 0,
                  "BETWEEN_64_MB_AND_128_MB": 0,
                  "GREATER_THAN_512_MB": 0,
                  "LESS_THAN_1024_B": 0
                  },
                  "objectReplicaTotalSize": 0,
                  "objectsReplicationInfo": { }
                  }
                  },
                  "bucketsSizes": null
                  }

                  里面定义了文件数量和分桶的信息,以及每个桶内的统计信息。

                          2,config 目录下就一个文件和一个目录

                    config.json
                    iam

                    先看下config.json的详细内容:

                      {
                      "api": {
                      "_": [
                      {
                      "key": "requests_max",
                      "value": "0"
                      },
                      {
                      "key": "requests_deadline",
                      "value": "10s"
                      },
                      {
                      "key": "cluster_deadline",
                      "value": "10s"
                      },
                      {
                      "key": "cors_allow_origin",
                      "value": "*"
                      },
                      {
                      "key": "remote_transport_deadline",
                      "value": "2h"
                      },
                      {
                      "key": "list_quorum",
                      "value": "optimal"
                      },
                      {
                      "key": "replication_workers",
                      "value": "250"
                      },
                      {
                      "key": "replication_failed_workers",
                      "value": "8"
                      },
                      {
                      "key": "transition_workers",
                      "value": "100"
                      }
                      ]
                      },
                      "audit_kafka": {
                      "_": [
                      {
                      "key": "enable",
                      "value": "off"
                      },
                      {
                      "key": "topic",
                      "value": ""
                      },
                      {
                      "key": "brokers",
                      "value": ""
                      },
                      {
                      "key": "sasl_username",
                      "value": ""
                      },
                      {
                      "key": "sasl_password",
                      "value": ""
                      },
                      {
                      "key": "sasl_mechanism",
                      "value": "plain"
                      },
                      {
                      "key": "client_tls_cert",
                      "value": ""
                      },
                      {
                      "key": "client_tls_key",
                      "value": ""
                      },
                      {
                      "key": "tls_client_auth",
                      "value": "0"
                      },
                      {
                      "key": "sasl",
                      "value": "off"
                      },
                      {
                      "key": "tls",
                      "value": "off"
                      },
                      {
                      "key": "tls_skip_verify",
                      "value": "off"
                      },
                      {
                      "key": "version",
                      "value": ""
                      }
                      ]
                      },
                      "audit_webhook": {
                      "_": [
                      {
                      "key": "enable",
                      "value": "off"
                      },
                      {
                      "key": "endpoint",
                      "value": ""
                      },
                      {
                      "key": "auth_token",
                      "value": ""
                      },
                      {
                      "key": "client_cert",
                      "value": ""
                      },
                      {
                      "key": "client_key",
                      "value": ""
                      }
                      ]
                      },
                      "cache": {
                      "_": [
                      {
                      "key": "drives",
                      "value": ""
                      },
                      {
                      "key": "exclude",
                      "value": ""
                      },
                      {
                      "key": "expiry",
                      "value": "90"
                      },
                      {
                      "key": "quota",
                      "value": "80"
                      },
                      {
                      "key": "after",
                      "value": "0"
                      },
                      {
                      "key": "watermark_low",
                      "value": "70"
                      },
                      {
                      "key": "watermark_high",
                      "value": "80"
                      },
                      {
                      "key": "range",
                      "value": "on"
                      },
                      {
                      "key": "commit",
                      "value": "writethrough"
                      }
                      ]
                      },
                      "compression": {
                      "_": [
                      {
                      "key": "enable",
                      "value": "off"
                      },
                      {
                      "key": "allow_encryption",
                      "value": "off"
                      },
                      {
                      "key": "extensions",
                      "value": ".txt,.log,.csv,.json,.tar,.xml,.bin"
                      },
                      {
                      "key": "mime_types",
                      "value": "text/*,application/json,application/xml,binary/octet-stream"
                      }
                      ]
                      },
                      "credentials": {
                      "_": [
                      {
                      "key": "access_key",
                      "value": "minioadmin"
                      },
                      {
                      "key": "secret_key",
                      "value": "minioadmin"
                      }
                      ]
                      },
                      "etcd": {
                      "_": [
                      {
                      "key": "endpoints",
                      "value": ""
                      },
                      {
                      "key": "path_prefix",
                      "value": ""
                      },
                      {
                      "key": "coredns_path",
                      "value": "/skydns"
                      },
                      {
                      "key": "client_cert",
                      "value": ""
                      },
                      {
                      "key": "client_cert_key",
                      "value": ""
                      }
                      ]
                      },
                      "heal": {
                      "_": [
                      {
                      "key": "bitrotscan",
                      "value": "off"
                      },
                      {
                      "key": "max_sleep",
                      "value": "1s"
                      },
                      {
                      "key": "max_io",
                      "value": "10"
                      }
                      ]
                      },
                      "identity_ldap": {
                      "_": [
                      {
                      "key": "server_addr",
                      "value": ""
                      },
                      {
                      "key": "username_format",
                      "value": ""
                      },
                      {
                      "key": "user_dn_search_base_dn",
                      "value": ""
                      },
                      {
                      "key": "user_dn_search_filter",
                      "value": ""
                      },
                      {
                      "key": "group_search_filter",
                      "value": ""
                      },
                      {
                      "key": "group_search_base_dn",
                      "value": ""
                      },
                      {
                      "key": "sts_expiry",
                      "value": ""
                      },
                      {
                      "key": "tls_skip_verify",
                      "value": "off"
                      },
                      {
                      "key": "server_insecure",
                      "value": "off"
                      },
                      {
                      "key": "server_starttls",
                      "value": "off"
                      },
                      {
                      "key": "lookup_bind_dn",
                      "value": ""
                      },
                      {
                      "key": "lookup_bind_password",
                      "value": ""
                      }
                      ]
                      },
                      "identity_openid": {
                      "_": [
                      {
                      "key": "config_url",
                      "value": ""
                      },
                      {
                      "key": "client_id",
                      "value": ""
                      },
                      {
                      "key": "client_secret",
                      "value": ""
                      },
                      {
                      "key": "claim_name",
                      "value": "policy"
                      },
                      {
                      "key": "claim_prefix",
                      "value": ""
                      },
                      {
                      "key": "redirect_uri",
                      "value": ""
                      },
                      {
                      "key": "scopes",
                      "value": ""
                      },
                      {
                      "key": "jwks_url",
                      "value": ""
                      }
                      ]
                      },
                      "logger_webhook": {
                      "_": [
                      {
                      "key": "enable",
                      "value": "off"
                      },
                      {
                      "key": "endpoint",
                      "value": ""
                      },
                      {
                      "key": "auth_token",
                      "value": ""
                      }
                      ]
                      },
                      "notify_amqp": {
                      "_": [
                      {
                      "key": "enable",
                      "value": "off"
                      },
                      {
                      "key": "url",
                      "value": ""
                      },
                      {
                      "key": "exchange",
                      "value": ""
                      },
                      {
                      "key": "exchange_type",
                      "value": ""
                      },
                      {
                      "key": "routing_key",
                      "value": ""
                      },
                      {
                      "key": "mandatory",
                      "value": "off"
                      },
                      {
                      "key": "durable",
                      "value": "off"
                      },
                      {
                      "key": "no_wait",
                      "value": "off"
                      },
                      {
                      "key": "internal",
                      "value": "off"
                      },
                      {
                      "key": "auto_deleted",
                      "value": "off"
                      },
                      {
                      "key": "delivery_mode",
                      "value": "0"
                      },
                      {
                      "key": "publisher_confirms",
                      "value": "off"
                      },
                      {
                      "key": "queue_limit",
                      "value": "0"
                      },
                      {
                      "key": "queue_dir",
                      "value": ""
                      }
                      ]
                      },
                      "notify_elasticsearch": {
                      "_": [
                      {
                      "key": "enable",
                      "value": "off"
                      },
                      {
                      "key": "url",
                      "value": ""
                      },
                      {
                      "key": "format",
                      "value": "namespace"
                      },
                      {
                      "key": "index",
                      "value": ""
                      },
                      {
                      "key": "queue_dir",
                      "value": ""
                      },
                      {
                      "key": "queue_limit",
                      "value": "0"
                      },
                      {
                      "key": "username",
                      "value": ""
                      },
                      {
                      "key": "password",
                      "value": ""
                      }
                      ]
                      },
                      "notify_kafka": {
                      "_": [
                      {
                      "key": "enable",
                      "value": "off"
                      },
                      {
                      "key": "topic",
                      "value": ""
                      },
                      {
                      "key": "brokers",
                      "value": ""
                      },
                      {
                      "key": "sasl_username",
                      "value": ""
                      },
                      {
                      "key": "sasl_password",
                      "value": ""
                      },
                      {
                      "key": "sasl_mechanism",
                      "value": "plain"
                      },
                      {
                      "key": "client_tls_cert",
                      "value": ""
                      },
                      {
                      "key": "client_tls_key",
                      "value": ""
                      },
                      {
                      "key": "tls_client_auth",
                      "value": "0"
                      },
                      {
                      "key": "sasl",
                      "value": "off"
                      },
                      {
                      "key": "tls",
                      "value": "off"
                      },
                      {
                      "key": "tls_skip_verify",
                      "value": "off"
                      },
                      {
                      "key": "queue_limit",
                      "value": "0"
                      },
                      {
                      "key": "queue_dir",
                      "value": ""
                      },
                      {
                      "key": "version",
                      "value": ""
                      }
                      ]
                      },
                      "notify_mqtt": {
                      "_": [
                      {
                      "key": "enable",
                      "value": "off"
                      },
                      {
                      "key": "broker",
                      "value": ""
                      },
                      {
                      "key": "topic",
                      "value": ""
                      },
                      {
                      "key": "password",
                      "value": ""
                      },
                      {
                      "key": "username",
                      "value": ""
                      },
                      {
                      "key": "qos",
                      "value": "0"
                      },
                      {
                      "key": "keep_alive_interval",
                      "value": "0s"
                      },
                      {
                      "key": "reconnect_interval",
                      "value": "0s"
                      },
                      {
                      "key": "queue_dir",
                      "value": ""
                      },
                      {
                      "key": "queue_limit",
                      "value": "0"
                      }
                      ]
                      },
                      "notify_mysql": {
                      "_": [
                      {
                      "key": "enable",
                      "value": "off"
                      },
                      {
                      "key": "format",
                      "value": "namespace"
                      },
                      {
                      "key": "dsn_string",
                      "value": ""
                      },
                      {
                      "key": "table",
                      "value": ""
                      },
                      {
                      "key": "queue_dir",
                      "value": ""
                      },
                      {
                      "key": "queue_limit",
                      "value": "0"
                      },
                      {
                      "key": "max_open_connections",
                      "value": "2"
                      }
                      ]
                      },
                      "notify_nats": {
                      "_": [
                      {
                      "key": "enable",
                      "value": "off"
                      },
                      {
                      "key": "address",
                      "value": ""
                      },
                      {
                      "key": "subject",
                      "value": ""
                      },
                      {
                      "key": "username",
                      "value": ""
                      },
                      {
                      "key": "password",
                      "value": ""
                      },
                      {
                      "key": "token",
                      "value": ""
                      },
                      {
                      "key": "tls",
                      "value": "off"
                      },
                      {
                      "key": "tls_skip_verify",
                      "value": "off"
                      },
                      {
                      "key": "cert_authority",
                      "value": ""
                      },
                      {
                      "key": "client_cert",
                      "value": ""
                      },
                      {
                      "key": "client_key",
                      "value": ""
                      },
                      {
                      "key": "ping_interval",
                      "value": "0"
                      },
                      {
                      "key": "streaming",
                      "value": "off"
                      },
                      {
                      "key": "streaming_async",
                      "value": "off"
                      },
                      {
                      "key": "streaming_max_pub_acks_in_flight",
                      "value": "0"
                      },
                      {
                      "key": "streaming_cluster_id",
                      "value": ""
                      },
                      {
                      "key": "queue_dir",
                      "value": ""
                      },
                      {
                      "key": "queue_limit",
                      "value": "0"
                      }
                      ]
                      },
                      "notify_nsq": {
                      "_": [
                      {
                      "key": "enable",
                      "value": "off"
                      },
                      {
                      "key": "nsqd_address",
                      "value": ""
                      },
                      {
                      "key": "topic",
                      "value": ""
                      },
                      {
                      "key": "tls",
                      "value": "off"
                      },
                      {
                      "key": "tls_skip_verify",
                      "value": "off"
                      },
                      {
                      "key": "queue_dir",
                      "value": ""
                      },
                      {
                      "key": "queue_limit",
                      "value": "0"
                      }
                      ]
                      },
                      "notify_postgres": {
                      "_": [
                      {
                      "key": "enable",
                      "value": "off"
                      },
                      {
                      "key": "format",
                      "value": "namespace"
                      },
                      {
                      "key": "connection_string",
                      "value": ""
                      },
                      {
                      "key": "table",
                      "value": ""
                      },
                      {
                      "key": "queue_dir",
                      "value": ""
                      },
                      {
                      "key": "queue_limit",
                      "value": "0"
                      },
                      {
                      "key": "max_open_connections",
                      "value": "2"
                      }
                      ]
                      },
                      "notify_redis": {
                      "_": [
                      {
                      "key": "enable",
                      "value": "off"
                      },
                      {
                      "key": "format",
                      "value": "namespace"
                      },
                      {
                      "key": "address",
                      "value": ""
                      },
                      {
                      "key": "key",
                      "value": ""
                      },
                      {
                      "key": "password",
                      "value": ""
                      },
                      {
                      "key": "queue_dir",
                      "value": ""
                      },
                      {
                      "key": "queue_limit",
                      "value": "0"
                      }
                      ]
                      },
                      "notify_webhook": {
                      "_": [
                      {
                      "key": "enable",
                      "value": "off"
                      },
                      {
                      "key": "endpoint",
                      "value": ""
                      },
                      {
                      "key": "auth_token",
                      "value": ""
                      },
                      {
                      "key": "queue_limit",
                      "value": "0"
                      },
                      {
                      "key": "queue_dir",
                      "value": ""
                      },
                      {
                      "key": "client_cert",
                      "value": ""
                      },
                      {
                      "key": "client_key",
                      "value": ""
                      }
                      ]
                      },
                      "policy_opa": {
                      "_": [
                      {
                      "key": "url",
                      "value": ""
                      },
                      {
                      "key": "auth_token",
                      "value": ""
                      }
                      ]
                      },
                      "region": {
                      "_": [
                      {
                      "key": "name",
                      "value": ""
                      }
                      ]
                      },
                      "scanner": {
                      "_": [
                      {
                      "key": "delay",
                      "value": "10"
                      },
                      {
                      "key": "max_wait",
                      "value": "15s"
                      },
                      {
                      "key": "cycle",
                      "value": "1m"
                      }
                      ]
                      },
                      "storage_class": {
                      "_": null
                      }
                      }

                      里面定义了minio的全局配置,比如消息通知,有多种方式,redis,kafka,postgres,nsq,webhook等等,同时也定义了认证方式,审计,日志,https 等相关内容,比如初始化的用户名和密码:

                            "credentials": {
                        "_": [
                        {
                        "key": "access_key",
                        "value": "minioadmin"
                        },
                        {
                        "key": "secret_key",
                        "value": "minioadmin"
                        }
                        ]
                        },

                        在iam里面只有一个文件format.json,内容如下:

                          {"version":1}

                                   3,外层的format.json文件

                            format.json
                             {"version":"1","format":"fs","id":"bd78d817-8f16-4589-a8fd-e7db8569033e","fs":{"version":"2"}}

                            定义了format是fs

                                   4,multipart,由于我们没有分片上传过文件,所以multipart目录里面是空的。

                                    5,最后看下tmp目录,里面是一系列目录

                              tmp
                              1eb28e69-63c4-4c14-b02b-0b0c5452acbb
                              1fe4efd1-aa6a-4403-bcf1-080894be4b08
                              9aca98bc-0f13-44ef-b5d6-6f783bcda0a3

                              每次上传文件的时候都会创建一个目录,目录里面内容是空的。因为文件上传完毕后都会mv到指定bucket的目录。


                              文章转载自golang算法架构leetcode技术php,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

                              评论