scala - S3 bucket name gets added to the S3 endpoint -
when trying access file s3 bucket using scala, bucket name gets added front of endpoint , endpoint becomes wrong , in-accessible.
libraries:
librarydependencies += "org.apache.spark" % "spark-core_2.11" % "2.0.0" librarydependencies += "org.apache.spark" % "spark-sql_2.11" % "2.0.0" librarydependencies += "org.apache.hadoop" % "hadoop-aws" % "2.8.0"
code:
sc.hadoopconfiguration.set("fs.s3a.endpoint", "[endpoint]") sc.textfile("s3a://[bucket_name]/testa.txt")
enabling path style urls solves issue there no virtual hosts configuration done on server s3 installed. fs.s3a.path.style.access
(docs) can set true enable path style urls.
Comments
Post a Comment