{"id":1048,"date":"2021-12-08T12:26:11","date_gmt":"2021-12-08T04:26:11","guid":{"rendered":"https:\/\/www.yinyubo.com\/?p=1048"},"modified":"2022-05-16T18:02:14","modified_gmt":"2022-05-16T10:02:14","slug":"minio-2","status":"publish","type":"post","link":"https:\/\/www.yinyubo.com\/?p=1048","title":{"rendered":"minio\u5206\u5e03\u5f0f\u88f8\u673a\u5b89\u88c5\uff08\u56fe\u6587\u5e76\u8302\uff09"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u80cc\u666f&amp;\u67b6\u6784<\/h2>\n\n\n\n<p>\u56e0\u4e3a\u5355\u673a\u7684minio\u65e0\u6cd5\u6269\u5145\u8282\u70b9\uff0c\u65e0\u6cd5\u4f7f\u7528\u7248\u672c\u529f\u80fd\uff0c\u4e8e\u662f\u6211\u4eec\u8fb9\u5f00\u59cb\u4f7f\u7528minio\u7684\u5206\u5e03\u5f0f\u7248\u672c\uff0cminio\u7684\u5206\u5e03\u5f0f\u7248\u672c\u53ef\u4ee5\u4f7f\u7528docker\u3001kubernetes\u3001\u88f8\u673a\u4e09\u79cd\u65b9\u5f0f\uff0c\u8fd9\u91cc\u6211\u4eec\u4f7f\u7528\u88f8\u673a\u5b89\u88c5\uff0c\u67b6\u6784\u5982\u4e0b\u56fe\u6240\u793a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"751\" height=\"436\" src=\"https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-8.png\" alt=\"\" class=\"wp-image-1057\" srcset=\"https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-8.png 751w, https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-8-300x174.png 300w\" sizes=\"auto, (max-width: 751px) 100vw, 751px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">1\u51c6\u5907\u5de5\u4f5c<\/h2>\n\n\n\n<p>4\u53f0ubuntu18\u7684\u7535\u8111\uff0c\u6bcf\u53f0\u7535\u8111\u7684\u7cfb\u7edf\uff0cCPU\uff0c\u5185\u5b58\uff0c\u786c\u76d8\u7a7a\u95f4\u5927\u5c0f\u5747\u4e00\u81f4\u3002\u7ed9minio\u7528\u7684\u786c\u76d8\u9700\u4f7f\u7528XFS\u683c\u5f0f\u5316\u3002\u6302\u8f7d\u7ed9minio\u7528\u7684\u786c\u76d8\u5230\/mnt\/disk\u76ee\u5f55\u3002\u5206\u522b\u6309\u987a\u5e8f\u914d\u7f6e\u4e864\u4e2a\u57df\u540d<\/p>\n\n\n\n<p>minio1.sfere.local &nbsp;minio2.sfere.local minio3.sfere.local minio4.sfere.local<\/p>\n\n\n\n<p><strong>\u7f16\u8005\u6ce8\uff1a\u8fd9\u91cc\u6211\u4e0e\u5b98\u7f51\u7565\u6709\u4e0d\u540c\uff0c\u6211\u6bcf\u4e2a\u670d\u52a1\u5668\u53ea\u6709\u4e00\u5757\u786c\u76d8\u7ed9\u6302\u8f7d\uff0c\u5b98\u7f51\u662f\u6bcf\u4e2a\u670d\u52a1\u5668\u7ed94\u5757\u786c\u76d8\u6302\u8f7d<\/strong><\/p>\n\n\n\n<p>1\u4e2a\u5b89\u88c5\u4e86nginx\u7684\u670d\u52a1\u5668\uff0c\u57df\u540d\u662fminio.sfere.local<\/p>\n\n\n\n<p><strong>\u7f16\u8005\u6ce8\uff1a\u5982\u679c\u4f60\u6ca1\u6709\u57df\u540d\uff0c\u4f60\u53ef\u4ee5\u5728\u8fd95\u53f0\u673a\u5668\u91cc\u7684hosts\u6587\u4ef6\u91cc\u628a5\u4e2a\u5730\u5740\u52a0\u4e0a\uff0c\u518d\u5728\u4f60\u7684\u6d4b\u8bd5\u673a\u5668\u7684hosts\u91cc\u4e0a\u52a0\u4e0a\u8fd95\u4e2a\u5730\u5740<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">2.\u5b89\u88c5minio\u7a0b\u5e8f\uff084\u53f0\u7535\u8111\u5747\u8fdb\u884c\u4e00\u6837\u7684\u64cd\u4f5c\uff09<\/h2>\n\n\n\n<p>1.\u8fdb\u5165\u5b98\u7f51\u7684\u4e0b\u8f7d\u94fe\u63a5\uff0c\u4e0b\u8f7d\u4e00\u4e2a\u6700\u65b0\u7684deb\u6587\u4ef6<a href=\"https:\/\/dl.min.io\/server\/minio\/release\/linux-amd64\/\">https:\/\/dl.min.io\/server\/minio\/release\/linux-amd64\/<\/a>&nbsp;<\/p>\n\n\n\n<p>\u4f8b\u5982\u6211\u4e0b\u8f7d\u7684 \u662f&nbsp;<a href=\"https:\/\/dl.min.io\/server\/minio\/release\/linux-amd64\/minio_20211124231933.0.0_amd64.deb\">https:\/\/dl.min.io\/server\/minio\/release\/linux-amd64\/minio_20211124231933.0.0_amd64.deb<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"961\" height=\"551\" src=\"https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-3.png\" alt=\"\" class=\"wp-image-1050\" srcset=\"https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-3.png 961w, https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-3-300x172.png 300w, https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-3-768x440.png 768w\" sizes=\"auto, (max-width: 961px) 100vw, 961px\" \/><\/figure>\n\n\n\n<p>2.\u628a\u6700\u65b0\u6587\u4ef6\u653e\u52304\u53f0\u670d\u52a1\u5668\u4e0a\uff0c\u4f7f\u7528dpkg\u547d\u4ee4\u5b89\u88c5&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"818\" height=\"210\" src=\"https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-4.png\" alt=\"\" class=\"wp-image-1051\" srcset=\"https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-4.png 818w, https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-4-300x77.png 300w, https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-4-768x197.png 768w\" sizes=\"auto, (max-width: 818px) 100vw, 818px\" \/><\/figure>\n\n\n\n<p>3.sudo vi \/etc\/systemd\/system\/minio.service \u6ce8\u91ca\u6389ProtectProc=invisible \u3002\u8fd9\u4e2a\u662fkernel 5.8\u4e4b\u540e\u624d\u52a0\u5165\u7684\uff0c\u6211\u4eec\u7684ubuntu18\u7cfb\u7edf\u4e0d\u652f\u6301<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"994\" height=\"555\" src=\"https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-5.png\" alt=\"\" class=\"wp-image-1052\" srcset=\"https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-5.png 994w, https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-5-300x168.png 300w, https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-5-768x429.png 768w\" sizes=\"auto, (max-width: 994px) 100vw, 994px\" \/><\/figure>\n\n\n\n<p>4.\u6dfb\u52a0minio-user\u7528\u6237\u548c\u7528\u6237\u7ec4\u3002<strong>\u6ce8\u610f\uff1a\u6b64\u5904\u4e0e\u5b98\u7f51\u7565\u6709\u4e0d\u540c\uff0c\u5b98\u7f51\u6253\u9519\u5b57\u4e86\u628aminio-user\u6253\u6210\u4e86miniouser<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo groupadd -r minio-user\nsudo useradd -M -r -g minio-user minio-user\nsudo chown minio-user:minio-user \/mnt\/disk<\/code><\/pre>\n\n\n\n<p>5.\u521b\u5efa\u73af\u5883\u53d8\u91cf\u6587\u4ef6<\/p>\n\n\n\n<p>sudo nano \/etc\/default\/minio<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Set the hosts and volumes MinIO uses at startup\n# The command uses MinIO expansion notation {x...y} to denote a\n# sequential series.\n#\n# The following example covers four MinIO hosts\n# with 4 drives each at the specified hostname and drive locations.\n \nMINIO_VOLUMES=\"http:\/\/minio{1...4}.sfere.local\/mnt\/disk\/minio\"\n \n# Set all MinIO server options\n#\n# The following explicitly sets the MinIO Console listen address to\n# port 9001 on all network interfaces. The default behavior is dynamic\n# port selection.\n \nMINIO_OPTS=\"--console-address :9001\"\n \n# Set the root username. This user has unrestricted permissions to\n# perform S3 and administrative API operations on any resource in the\n# deployment.\n#\n# Defer to your organizations requirements for superadmin user name.\n \nMINIO_ROOT_USER=minioadmin\n \n# Set the root password\n#\n# Use a long, random, unique string that meets your organizations\n# requirements for passwords.\n \nMINIO_ROOT_PASSWORD=sfere!lzw!2021\n \n# Set to the URL of the load balancer for the MinIO deployment\n# This value *must* match across all MinIO servers. If you do\n# not have a load balancer, set this value to to any *one* of the\n# MinIO hosts in the deployment as a temporary measure.\n# nginx\u670d\u52a1\u5668\u5730\u5740\nMINIO_SERVER_URL=\"http:\/\/minio.sfere.local\"\n \nMINIO_IDENTITY_LDAP_TLS_SKIP_VERIFY=on\nMINIO_IDENTITY_LDAP_SERVER_INSECURE=on\nMINIO_IDENTITY_LDAP_STS_EXPIRY=24h\nMINIO_IDENTITY_LDAP_SERVER_ADDR=${LDAP\u57df\u540d}\nMINIO_IDENTITY_LDAP_LOOKUP_BIND_DN=${LDAP\u53ea\u8bfb\u8d26\u6237}\nMINIO_IDENTITY_LDAP_LOOKUP_BIND_PASSWORD=${LDAP\u53ea\u8bfb\u8d26\u6237\u7684\u5bc6\u7801}\nMINIO_IDENTITY_LDAP_USER_DN_SEARCH_BASE_DN=${LDAP\u7528\u6237\u641c\u7d22\u57df}\nMINIO_IDENTITY_LDAP_USER_DN_SEARCH_FILTER=(&amp;(objectClass=inetOrgPerson)(uid=%s))\nMINIO_IDENTITY_LDAP_GROUP_SEARCH_BASE_DN=${LDAP\u7ec4\u641c\u7d22\u57df}\nMINIO_IDENTITY_LDAP_GROUP_SEARCH_FILTER=(&amp;(objectclass=groupOfUniqueNames))<\/code><\/pre>\n\n\n\n<p>6. \u8fd0\u884cminio\u670d\u52a1\uff0c\u68c0\u67e5\u8fd0\u884c\u662f\u5426\u6210\u529f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start minio.service\nsudo systemctl status minio.service\njournalctl -f -u minio.service<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">nginx\u914d\u7f6e<\/h2>\n\n\n\n<p>\u5728\/etc\/nginx\/conf.d\u76ee\u5f55\u4e0b\u6dfb\u52a0\u4e00\u4e2aminio.conf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>upstream minio {\n    server minio1.sfere.local:9000;\n    server minio2.sfere.local:9000;\n    server minio3.sfere.local:9000;\n    server minio4.sfere.local:9000;\n}\n \nupstream console {\n    ip_hash;\n    server minio1.sfere.local:9001;\n    server minio2.sfere.local:9001;\n    server minio3.sfere.local:9001;\n    server minio4.sfere.local:9001;\n}\n \nserver {\n        listen       80;\n        listen  &#91;::]:80;\n        server_name  minio.sfere.local;\n \n        # To allow special characters in headers\n        ignore_invalid_headers off;\n        # Allow any size file to be uploaded.\n        # Set to a value such as 1000m; to restrict file size to a specific value\n        client_max_body_size 0;\n        # To disable buffering\n        proxy_buffering off;\n \n        location \/ {\n            proxy_set_header Host $http_host;\n            proxy_set_header X-Real-IP $remote_addr;\n            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n            proxy_set_header X-Forwarded-Proto $scheme;\n \n            proxy_connect_timeout 300;\n            # Default is HTTP\/1, keepalive is only enabled in HTTP\/1.1\n            proxy_http_version 1.1;\n            proxy_set_header Connection \"\";\n            chunked_transfer_encoding off;\n \n            proxy_pass http:\/\/minio;\n        }\n}\nserver {\n        listen       9001;\n        listen  &#91;::]:9001;\n        server_name  minio.sfere.local;\n \n        # To allow special characters in headers\n        ignore_invalid_headers off;\n        # Allow any size file to be uploaded.\n        # Set to a value such as 1000m; to restrict file size to a specific value\n        client_max_body_size 0;\n        # To disable buffering\n        proxy_buffering off;\n \n        location \/ {\n            proxy_set_header Host $http_host;\n            proxy_set_header X-Real-IP $remote_addr;\n            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n            proxy_set_header X-Forwarded-Proto $scheme;\n            proxy_set_header X-NginX-Proxy true;\n \n            # This is necessary to pass the correct IP to be hashed\n            real_ip_header X-Real-IP;\n \n            proxy_connect_timeout 300;\n \n            # To support websocket\n            proxy_http_version 1.1;\n            proxy_set_header Upgrade $http_upgrade;\n            proxy_set_header Connection \"upgrade\";\n \n            chunked_transfer_encoding off;\n \n            proxy_pass http:\/\/console;\n        }\n}<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f7f\u7528mc\u5ba2\u6237\u7aef\u6dfb\u52a0ldap\u8d85\u7ba1\uff0c\u666e\u901a\u7528\u6237<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>docker run --rm -it --entrypoint=\/bin\/sh minio\/mc\n \nmc config host add minio http:\/\/minio.sfere.local minioadmin 'sfere!lzw!2021' --api S3v4\n  \nmc admin policy list minio\n  \nmc admin policy set minio consoleAdmin user=cn=\u674e\u9547\u4f1f,ou=test-department,ou=NJ-Dev,ou=SFERE-RD,dc=sfere-elec,dc=com\nmc admin policy set minio readwrite group=cn=jira-software-users,dc=sfere-elec,dc=com\nmc admin policy set minio consoleAdmin group=cn=\u8d85\u7ea7\u7528\u6237,dc=sfere-elec,dc=com<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u8bbf\u95ee\u9875\u9762<\/h2>\n\n\n\n<p>\u8bbf\u95ee<a href=\"http:\/\/minio.sfere.local\/\">http:\/\/minio.sfere.local\/<\/a>&nbsp;\u4f1a\u81ea\u52a8\u8df3\u8f6c\u5230<a href=\"http:\/\/minio.sfere.local:9001\/login\">http:\/\/minio.sfere.local:9001\/login<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"957\" height=\"572\" src=\"https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-6.png\" alt=\"\" class=\"wp-image-1053\" srcset=\"https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-6.png 957w, https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-6-300x179.png 300w, https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-6-768x459.png 768w\" sizes=\"auto, (max-width: 957px) 100vw, 957px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"511\" src=\"https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-7-1024x511.png\" alt=\"\" class=\"wp-image-1054\" srcset=\"https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-7-1024x511.png 1024w, https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-7-300x150.png 300w, https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-7-768x383.png 768w, https:\/\/www.yinyubo.com\/wp-content\/uploads\/2021\/12\/image-7.png 1348w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u8003\u6587\u7ae0<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><\/p><cite><a href=\"https:\/\/docs.min.io\/minio\/baremetal\/installation\/deploy-minio-distributed.html\">https:\/\/docs.min.io\/minio\/baremetal\/installation\/deploy-minio-distributed.html<\/a><br><\/cite><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f&amp;\u67b6\u6784 \u56e0\u4e3a\u5355\u673a\u7684minio\u65e0\u6cd5\u6269\u5145\u8282\u70b9\uff0c\u65e0\u6cd5\u4f7f\u7528\u7248\u672c\u529f\u80fd\uff0c\u4e8e\u662f\u6211\u4eec\u8fb9\u5f00\u59cb\u4f7f\u7528minio\u7684\u5206\u5e03\u5f0f\u7248 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-1048","post","type-post","status-publish","format-standard","hentry","category-influxdb"],"_links":{"self":[{"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/posts\/1048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1048"}],"version-history":[{"count":4,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/posts\/1048\/revisions"}],"predecessor-version":[{"id":1059,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/posts\/1048\/revisions\/1059"}],"wp:attachment":[{"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}