Because it is a Raid server, uploading is not stable because it is unknown whether to connect to server-01 or server-02
Image uploaded on server-01
Image uploaded on server-02
Images are deleted because they are synchronized with server-01
・ Raid server built with AWS (server-01 + server-02)
┗ server-02 is synchronized with the server-01 document root every 5 minutes
・ Custom CMS using phpFlow of behavior when uploading from CMS
server-02: synchronizes server-01's document root every 5 minutes
Upload via CMS
server-02: Image upload
server-02: Image deleted to synchronize under document root of server-01 every 5 minutes
Image data is registered in DB, but it is not on the server and an error occurs
Answer # 1
Raid serveris not common, so if you don't know the exact configuration, you can't say anything.
The answer is based on guessing whether it is a server that is simply distributed in DNS round robin.
Since there are merits/disadvantages/restrictions, please examine/verify whether they can be introduced.Simple method (method without application modification)
Change the sorting method so that all pages that upload images will access server-01.Simple method 2 (don't give up deleting files)
For example, if you can only upload images from the CMS management screen,
Prepare another domain (or subdomain) and access the management screen only from the other domain.
By registering only the IP address of server-01 in the A record of another domain, the file will be uploaded only to server-01
Do not delete files for the image upload directory in server-01 → server-02 file synchronization
Add file synchronization from server-02 to server-01 (no image deletion)Classically common method 1
Make the image upload directory of server-01 a shared directory so that it can be mounted from server-02
Since directories are synchronized in real time, sync every 5 minutesClassically common method 2
Perform bidirectional real-time synchronization with Lsyncd + RsyncA method unique to AWS. Comparatively easy (no need to modify the application, change the settings on the OS side)
Mount EFS from server-01 and server-02A method unique to AWS. Application needs to be modified
Use S3 (as in CHERRY's answer)
Answer # 2
Yamakan from the current contents.
If it is a high load countermeasure, Server1 and Server2 are distributed by the load balancer.
If you don't know the relationship between Server1 and Server2 and the database, it will be difficult to answer concretely.
- php - i want to upload an image using xfree
- php - i want to upload an image file from the developer tool posting screen of chrome
- i want to know how to resize and upload multiple image files with jquery + php
- i want to store the image file path in mysql using php
- php - i want to implement laravel60 image upload
- php - file upload does not work when image size is large
- how to send an email using yahoo mail in php
- php - i want to pass the image file to the server
- css - i want to hide the first image only when using slick on a pc
- i want to update the db using variables in pdo in php, but it doesn't work
- image recognition using python beginner pyautogui is not possible
- php - payment using square i want to register a memo or product name in payment
- i want to display an image using a variable name on the [django] template
- php - about passing value to form using tag
- ruby - [rails] i want to create an image link using the url of the image output using active storage
- php - png image is not displayed
- php - about the version when developing using the framework
- php - wordpress: tab switching using custom field items
- php - i want to call my name using my membership information, but
- php - if there is an image in the body before the title of the article list with wordpress, i want to output the icon before the
- please explain the source code of cakephp
- narrow down by the conditions of the cakephp association destination
- i can't calculate variables in php
- i want to create multiple approvals for cakephp4 authentication plugins
- is authentication using an access token secure with swift + cakephp?
- i'm having trouble using the paginate part of php
- [cakephp3] become a missing controller (what to do if documentroot and webroot are different)
- [cakephp4] i want to set the cache engine settings for each site
- php - is it okay to share composerlock if the major versions of composer are the same?