Sync Redmine attachments to S3
I was considering a design to build Redmine on AWS, and I decided to make it redundant.
In the end, I created the configuration as shown in this figure.
Redmine itself uses ALB and Auto Scaling to determine the minimum and maximum number of EC2 units and scales based on the average CPU usage rate.
The database has a Multi-AZ configuration.
With this configuration, I was wondering what to do with the attached files.
table of contents
Find plugins
There was a plugin that saved Redmine attachments to S3.
But you have to write the access key and secret key in the settings.
I would like to use IAM roles if possible, so I stopped using this plugin this time.
Sync files from each instance to S3
As a requirement, I just need to be able to view the files attached from each instance on each instance, and it doesn't need to be very real-time, so I decided to synchronize using CLI commands.
I think it would be a good idea to create an S3 bucket and periodically synchronize it bidirectionally with the /var/lib/redmine/files directory.
I regularly execute a shell file like the one above using crontab.
There are issues with files accumulating locally on EC2 and the initial synchronization of additionally launched instances taking time, so I think there is an option to use EFS, but as of January 2018, it is not usable. There are limited regions, so I think you should consider it as an option.
Thank you for reading until the end!
I wrote a book called "AWS Certification Exam Text & Question Collection AWS Certified Solution Architect - Professional Revised 2nd Edition".
I wrote a book called "AWS Certification Exam Text: AWS Certified Cloud Practitioner Revised 2nd Edition."
I wrote a book called "Pocket Study AWS Certified Developer Associate [DVA-C02 Compatible]".
I wrote a book called ``AWS Certified Solutions Architect-Associate: Getting Started with the Key Points.''
I wrote a book called ``Getting Started with Linux on AWS.''
I am a Software Engineer who has been working as a development vendor for 5 years, a total of 9 years in the user company system department, and 5 years as an IT instructor.I also started working as a prototype builder.
Please feel free to ask any questions in the comments or on SNS.
I will answer to the best of my ability.
All content/statements on this blog are personal opinions and are not related to any organization to which I am affiliated.
This blog is intended to share experiences, etc., and does not guarantee procedures or results.
When using this information as a reference, please use your own judgment.
Also, when I write a report on a study session or event, I write down what I'm interested in or what I thought after listening to it, so it's not the speaker's opinion or presentation content.
ad
ad
Related article
-
-
Install mautic on AWS EC2 Amazon Linux (Sendgrid, Nginx, MySQL on RDS)
Installing mautic on Amazon Linux, Nginx, MySQL on RDS…
-
-
Verified AWS KMS multi-region key
KMS multi-region keys were released in June 2021. Multilig...
-
-
Question forms in common serverless architectures
This article participates in Serverless2 Advent Calendar 2018…
-
-
Create an Amazon CloudWatch cross-region cross-account dashboard
This blog's CloudFront and WAF accounts, EC2, RDS, S3, etc...
-
-
Notify by email when Out of memory occurs in php-fpm (AWS CloudWatch, Amazon SNS)
Ng on Amazon EC2 with AWS CloudWatch Logs agent…
-
-
I checked the AWS Client VPN connection logs
I've set up AWS Client VPN, and since I've created a certificate, I've set up a lot of things...
-
-
AWS Transit Gateway Accelerated Site-to-Site VPN Connection Check
When creating a VPN connection on Transit Gateway, Global Acc…
-
-
I tried a tutorial on uploading photos from a browser to Amazon S3 using the JavaScript SDK.
I tried uploading photos from the browser to Amazon S3. HT...
-
-
Building AWS Managed Microsoft AD and adding users
Preparation Create a VPC with DNS hostname and name resolution enabled, and publish it to two AZs...
-
-
Is it possible to shorten the expiration date of credentials assigned to AssumeRole by EC2 instance profile?
"Valid credentials AssumeRole by EC2 instance profile...