mc config host add
μλ μ격 μ¦λͺ
νμΈμ 건λ λ°λ μ΅μ
μ΄μμ μ μμ΅λλ€.
mc config host add s3-somebucket https://s3.cn-north-1.amazonaws.com.cn XXXXX XXXXXXXXXX S3v4
mc: <ERROR> Unable to initialize new config from the provided credentials. The specified bucket does not exist.
λ΄ s3 iam μ μ± μ λ€μκ³Ό κ°μ΅λλ€.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1506154426000",
"Effect": "Allow",
"Action": [
"s3:*"
],
"Resource": [
"arn:aws-cn:s3:::somebucket/*"
]
},
{
"Sid": "Stmt1506154452000",
"Effect": "Allow",
"Action": [
"s3:*"
],
"Resource": [
"arn:aws-cn:s3:::somebucket"
]
}
]
}
μ΄μ λ²μ μ mcμμλ μ격 μ¦λͺ
μ μΆκ° ν λ νμΈνμ§ μμ΅λλ€.
κ·Έλ¦¬κ³ s3 μ‘μΈμ€ ν€μ λν΄ λ§€μ° μ격ν κΆνμ λΆμ¬ν©λλ€. κ·Έλμ λ€μκ³Ό κ°μ΄ν©λλ€.
μ‘μΈμ€ ν€λ λ²ν· μ΄λ¦μ λμ΄ ν μ μμ΅λλ€.
macOS, Ubuntu 16.04μμ ν μ€νΈ λ¨
--api s3v4
μ§μ μ 곡νμ¬ μ ν¨μ± κ²μ¬ νΈμΆ κ²½λ‘λ₯Ό νΈμΆν΄μλ μλ©λλ€.
@ tru2dagame λ΅λ³
(https://docs.minio.io/docs/minio-client-complete-guide)κ° s3v4
λ₯Ό κΈ°λ³Έκ°μΌλ‘ μ§μ νκΈ° λλ¬Έμ λλ΅μ μ½κ° νΌλ μ€λ½μ΅λλ€. --api
μ΅μ
μ μ¬μ©νλ©΄ λͺ
μ μ μΌλ‘ ν¨κ³Όκ°μμμ΅λλ€ (macos mc λ²μ 2018-03-25T01). μ΅μ
μ΄ μμΌλ©΄ μ¬κΈ°μλ³΄κ³ λ κ²κ³Ό λμΌν μ€λ₯κ° νμλ©λλ€.
--api
μ΅μ
μ΄ μ 곡λλ©΄ @rbetts μ격 μ¦λͺ
νμΈμ 건λ λλλ€. μ΅μ
μ μ§μ νμ§ μμΌλ©΄ κ·νμ κ²½μ° μ€ν¨ν νμΈμ μνν©λλ€. λ¬Έμμ μ΅μ
μΆκ°λ₯Ό κ²ν ν©λλ€.
--api s3v4
λ§€κ° λ³μμμ΄ μλνλ €λ©΄ mc
μ νν μ΄λ€ κΆνμ΄ νμν©λκΉ? μλ s3 μ¬μ©μ κΆνμ λΆμ¬νμ§λ§ μ¬μ ν μλνμ§ μμ΅λλ€.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws-cn:s3:::<my-bucket>"
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": "arn:aws-cn:s3:::<my-bucket>/*"
},
{
"Sid": "VisualEditor2",
"Effect": "Allow",
"Action": "s3:GetBucketLocation",
"Resource": "arn:aws-cn:s3:::<my-bucket>"
},
{
"Sid": "VisualEditor3",
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "*"
}
]
}
λλ μ΄μ κ°μ λͺ λ Ήμ μ¬μ©νκ³ μλ μ€λ₯ λ©μμ§κ° λνλ©λλ€.
$ docker run -it --entrypoint=/bin/sh minio/mc:RELEASE.2018-05-25T20-20-15Z
$ mc config host add s3 <endpoint> <key> <secret>; mc ls s3/<my-bucket>
mc: Configuration written to `/root/.mc/config.json`. Please update your access credentials.
mc: Successfully created `/root/.mc/share`.
mc: Initialized share uploads `/root/.mc/share/uploads.json` file.
mc: Initialized share downloads `/root/.mc/share/downloads.json` file.
mc: <ERROR> Unable to initialize new config from the provided credentials. The specified bucket does not exist.
mc: <ERROR> Unable to stat `<my-bucket>`. Requested file `<my-bucket>` not found
κ·Έλ¦¬κ³ --api s3v4
λ§€κ° λ³μλ₯Ό μΆκ°νλ©΄ λͺ¨λ κ²μ΄ μ μλν©λλ€.
--api s3v4λ₯Ό μ§μ μ 곡νλ©΄ κ°λ₯νλ©° μ ν¨μ± κ²μ¬ νΈμΆ κ²½λ‘λ₯Ό νΈμΆνλ©΄ μλ©λλ€.
μ΄κ²μ λλ₯Ό μν΄ μΌνμ΅λλ€. κ·Έλ¬λ μ¬νμ΄ μκ±°λμ΄ λ¬Έμ λ₯Ό λ°©λ¬Ένμ§ μκ³ λ μ΄ν΄νκΈ°κ° λ§€μ° νΌλμ€λ½κ³ λΆκ°λ₯ν©λλ€.
mc config host add
μ (λ) --api
μΈμ κ·Όμ²μ μ€λͺ
μ΄μμ μ μμΌλ©°, μ΄λ νμ± νλ‘λΈλ₯Ό λ°©μ§ ν κ²μ΄λΌκ³ λ§ν©λλ€.
λν μΆκ° --debug
μΆλ ₯ * μ무κ²λ *, λͺ
λ Ήμ λ¨μ§ 1 λΆ μ΄μ λΉ λμΌλ‘ λλ₯Ό μ³λ€ λ³Έλ€ .. : /
κ°μ₯ μ μ©ν λκΈ
--api s3v4
μ§μ μ 곡νμ¬ μ ν¨μ± κ²μ¬ νΈμΆ κ²½λ‘λ₯Ό νΈμΆν΄μλ μλ©λλ€.