順便把 EBS 處理過程也都列一列,假設已經新增並掛載 EBS 空間:
$ sudo lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
...
xvdb 202:16 0 4G 0 disk /mnt
xvdc 202:32 0 500G 0 disk
$ sudo file -s /dev/xvdc
$ sudo mkfs -t ext3 /dev/xvdc
$ sudo mkdir /data
$ sudo mount -t ext3 /dev/xvdc /data
$ sudo chmod 777 /da
$ sudo vim /etc/fstab
/dev/xvdc /data ext3 defaults,nofail 0 2
處理 MySQL Server:
$ sudo apt-get install mysql-server-5.6
$ sudo service mysql stop
$ sudo mv /var/lib/mysql /data/mysql
$ sudo ln -s /data/mysql /var/lib/mysql
$ sudo vim /etc/apparmor.d/usr.sbin.mysqld
/var/lib/mysql/ r,
/var/lib/mysql/** rwk,
/var/log/mysql/ r,
/var/log/mysql/* rw,
/data/mysql r,
/data/mysql** rwk,
/data/mysql r,
/data/mysql* rwk,
$ sudo service apparmor restart
$ sudo service mysql start
沒有留言:
張貼留言