![見出し画像](https://assets.st-note.com/production/uploads/images/130995327/rectangle_large_type_2_5b2e076b01b57c58aa1357bec274c81b.png?width=1200)
php5なuploaderをauroraで使う (ECS)
ECRにpush
ここは特に何も変更してないので前のpushスクリプトを作ってください
749a92f37d0d: Layer already exists
768c0eac2de9: Layer already exists
latest: digest: sha256:b2798962fad22fd7ec9af6f8d85972f3aabe6f1bde9737b2b7f53a7aa5a8a3d1 size: 4292
せっかくだし、新たなクラスターを作っておいてこか
クラスターを立てる
![](https://assets.st-note.com/img/1707844319062-QIJhZlqsi3.png?width=1200)
タスク定義
サービスを立てる前にクラスターがぶん回ってる間にタスク定義を新規作成する
![](https://assets.st-note.com/img/1707844420405-9seslAI2bB.png?width=1200)
相変わらずarmのセコセコ構成
![](https://assets.st-note.com/img/1707844463962-hdOfoQPYOh.png?width=1200)
環境変数がちょっとちゃうで
![](https://assets.st-note.com/img/1707844797352-UdQEoOX3PW.png?width=1200)
とりあえず面倒くさいのでPASSWORDもそのままつっこんだ。パラメーターストアから持ってくる場合は前の記事よんで
サービスの設定
![](https://assets.st-note.com/img/1707844909798-PLM3eRXMdI.png?width=1200)
最初からロードバランサーつくっておくからね
DBの用意
でまあ今schemaが例によってないのでメンテ用のec2を起動
$ mysql -uadmin -ppassword -huploader-demo.cluster-cmxstlofflyf.ap-northeast-1.rds.amazonaws.com
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 20
Server version: 5.7.12 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
基本的にwriterでやればよい
MySQL [(none)]> create database uploader_demo;
とかして
schema.sql
session_data.sql
を流しこんだ
![](https://assets.st-note.com/img/1707845318377-yinrDJyAFc.png?width=1200)
リーダーがイカれててもこのように起動はしてくる、が、まあ少し待っておこう。
![](https://assets.st-note.com/img/1707847379063-Pu69PdlGBa.png?width=1200)
ちゃんとuploadして削除できればok。てかecsを付け忘れていたので揮発しちゃうしな。
次回パフォーマンスのテストとかフェイルオーバーとかしてみよう。てか高いから一々閉じる必要があるんだよな〜ん
この記事が気に入ったらサポートをしてみませんか?