logstash-plugins / logstash-output-s3

Apache License 2.0
58 stars 151 forks source link

[minio] Document force_path_style #226

Open TomonoriSoejima opened 4 years ago

TomonoriSoejima commented 4 years ago

I spent some time fixing a problem below and wanted to leave this issue just in case someone runs into the same problem.

Error validating bucket write permissions! {:message=>"Failed to open TCP connection to
hoge.127.0.0.1:9000 (initialize: name or service not known)"

Clearly someone ran into it in the past

    additional_settings => {
          "force_path_style" => true
        }
output {
  stdout { codec => rubydebug }
  s3 {
    access_key_id => "minioadmin"
    secret_access_key => "minioadmin"
    endpoint => "http://127.0.0.1:9000"
    bucket => "logstash"
    additional_settings => {
          "force_path_style" => true
        }

  }
}

image

Now force_path_style is an option for Aws::S3::Client

:force_path_style (Boolean) — default: false — When set to true, the bucket name is always left in the request URI and never moved to the host as a sub-domain. See Plugins::S3BucketDns for more details.

Which makes sense that it does construct hoge.127.0.0.1:9000 in my case.