Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot make secor work with AWS instance profile #1873

Open
dovka opened this issue Feb 22, 2021 · 8 comments
Open

Cannot make secor work with AWS instance profile #1873

dovka opened this issue Feb 22, 2021 · 8 comments

Comments

@dovka
Copy link
Contributor

dovka commented Feb 22, 2021

Hi guys,
we are prohibited form using the hardcoded AWS credentials
(that we had been using until now) and trying to make secor work with AWS instance profile or role.

I didn't find any documentation but from the secor.common.properties comment
we infer that we need to leave the credentials blank and set the role name.

`# AWS authentication credentials.
"

Leave empty if using IAM role-based authentication with s3a filesystem.

aws.access.key=
aws.secret.key=

Session token only required if using temporary S3 access keys

aws.session.token=
aws.role=
`
We specified the role name (not sure what to do with aws.session.token) but still get the same error:

2021-02-22 12:55:27,900 [main] (com.pinterest.secor.main.ConsumerMain:87) ERROR Consumer failed java.lang.RuntimeException: Failed to find required configuration option 'aws.access.key'. at com.pinterest.secor.common.SecorConfig.checkProperty(SecorConfig.java:725) at com.pinterest.secor.common.SecorConfig.getString(SecorConfig.java:731) at com.pinterest.secor.common.SecorConfig.getAwsAccessKey(SecorConfig.java:417) at com.pinterest.secor.util.FileUtil.configure(FileUtil.java:75) at com.pinterest.secor.main.ConsumerMain.main(ConsumerMain.java:70)
how to make secor use instance profile or role?
thank you for your help!
David

@HenryCaiHaiying
Copy link
Contributor

HenryCaiHaiying commented Feb 23, 2021 via email

@dovka
Copy link
Contributor Author

dovka commented Feb 23, 2021

Henry,
thank you for your advice -
switching to s3a and HadoopS3UploadManager did the trick -
secor started implicitly using instance profile :)

@HenryCaiHaiying
Copy link
Contributor

HenryCaiHaiying commented Feb 23, 2021 via email

@dovka
Copy link
Contributor Author

dovka commented Mar 2, 2021

Henry,
I will gladly do update the README file.
How do I do it - via pull request or just attach here?

We put the IAM roles authentication config in production yesterday and since then we see duoble the CPU usage by secor.
We need twice the amount of nodes (had 3 now need 6 or we are falling behind with data being queued up)

The only thing we changed is authentication.
Is it possible the the code checking on re-authentication (AWS token expiration) all the time and causes this CPU drain?

Thank you for your help Henry

@HenryCaiHaiying
Copy link
Contributor

HenryCaiHaiying commented Mar 2, 2021 via email

@dovka
Copy link
Contributor Author

dovka commented Jun 1, 2021

Henry,
we run into an issue with secor instance profile in AWS China region.

The S3 code that works in regular AWS breaks in AWS China with this error:

com.amazonaws.services.s3.model.AmazonS3Exception: Bad Request (Service: Amazon S3; Status Code: 400; Error Code: 400 Bad Request; Request ID: SMY7YNMPSYCKSKNJ

I asked for the clarification from AWS Support, and here is their answer:

"This request is sent to Amazon Global region, not China region;

So let us check the region setting first.

When using resources in China region, we must clearly specify the region information.

I saw you use Amazon Java SDK V1, you could use below code to set the region:
AmazonS3 s3 = AmazonS3ClientBuilder.standard().withRegion(Regions.CN-NORTH-1).build();
"
Would you please check the code,
how easy would it be to patch it up?

Thank you for your help!
David

@dovka
Copy link
Contributor Author

dovka commented Jun 2, 2021

created pull request #2095 with instructions on instance profile setup

@HenryCaiHaiying
Copy link
Contributor

HenryCaiHaiying commented Jun 4, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants