AWS Microインスタンスにswap追加する手順(CentOS6.4)

備忘録と入力したのに美貌と入力 ある意味 美しい変換である
準備物
AMI:ami-9ffa709e
  CentOS-6.4-x86_64-GA-EBS-9ededd96-9ff7-4ba1-ae15-2c99f7e93990-ami-d79bf0be.1
  aws-marketplaceのCentOS release 6.4 (Final)を利用しました。

コンソールにログインしてswapを確認するとswapなし、この状態でALMiniumを
インストールしたら、メモリが足りませんと言われ使えなくなったことがある

■手順
#free
                total       used       free     shared    buffers     cached
Mem:        604680     598132       6548          0       1652     509004
-/+ buffers/cache:      87476     517204

#dd if=/dev/zero of=/swapfile bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 28.9361 s, 37.1 MB/s

#ls -l /
total 1048664
dr-xr-xr-x.  2 root root       4096 2013-05-27 11:16 bin
dr-xr-xr-x.  4 root root       4096 2013-05-27 11:17 boot
~~~~~~~~~~~~省略~~~~~~~~~~~~~~
dr-xr-x—.  3 root root       4096 2013-06-29 05:30 root
dr-xr-xr-x.  2 root root       4096 2013-05-27 11:16 sbin
drwxr-xr-x.  7 root root          0 2013-06-29 05:30 selinux
drwxr-xr-x.  2 root root       4096 2011-09-23 11:50 srv
-rw-r–r–.  1 root root 1073741824 2013-06-29 05:42 swapfile
drwxr-xr-x. 13 root root          0 2013-06-29 05:30 sys
drwxrwxrwt.  3 root root       4096 2013-06-29 05:30 tmp
drwxr-xr-x. 13 root root       4096 2013-05-27 11:15 usr
drwxr-xr-x. 17 root root       4096 2013-05-27 11:15 var
スワップ領域を作成する
# mkswap /swapfile
スワップ領域を有効する
# swapon /swapfile
スワップが追加されていることを確認する→増えた!!
# free
             total       used       free     shared    buffers     cached
Mem:        604680     598132       6548          0       1652     509004
-/+ buffers/cache:      87476     517204
Swap:      1048568          0    1048568
起動時にスワップ領域がマウントされるようにfstabを編集
#vi /etc/fstab
/dev/xvde               /        ext4      defaults         0 0
devpts     /dev/pts  devpts  gid=5,mode=620   0 0
tmpfs      /dev/shm  tmpfs   defaults         0 0
proc       /proc     proc    defaults         0 0
sysfs      /sys      sysfs   defaults         0 0
/swapfile  swap      swap    defaults         0 0試しにリブートしてスワップがマウントされるか確認してみる
# reboot
起動したら、topでもfreeで確認する
# top
# top – 05:46:20 up 0 min,  1 user,  load average: 0.08, 0.02, 0.01
Tasks:  54 total,   1 running,  53 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.3%sy,  0.0%ni, 99.0%id,  0.7%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    604680k total,   112636k used,   492044k free,     4824k buffers
Swap:  1048568k total,        0k used,  1048568k free,    33988k cached

シェアする

  • このエントリーをはてなブックマークに追加

フォローする

adana escort adıyaman escort afyon escort ağrı escort aksaray escort amasya escort ankara escort antalya escort ardahan escort artvin escort aydın escort balıkesir escort bartın escort batman escort bayburt escort bilecik escort bingöl escort bitlis escort bolu escort burdur escort bursa escort çanakkale escort çankırı escort çorum escort denizli escort diyarbakır escort düzce escort edirne escort elazığ escort erzincan escort erzurum escort eskişehir escort gaziantep escort gebze escort giresun escort gümüşhane escort hakkari escort hatay escort ığdır escort ısparta escort istanbul escort izmir escort izmit escort kahramanmaraş escort karabük escort karaman escort kars escort kastamonu escort kayseri escort kilis escort kırıkkale escort kırklareli escort kırşehir escort kocaeli escort konya escort kütahya escort malatya escort manisa escort mardin escort mersin escort muğla escort muş escort nevşehir escort niğde escort ordu escort osmaniye escort rize escort sakarya escort samsun escort şanlıurfa escort siirt escort sinop escort şırnak escort sivas escort tekirdağ escort tokat escort trabzon escort tunceli escort uşak escort van escort yalova escort yozgat escort zonguldak escort marmaris escort bodrum escort alanya escort side escort konyaaltı escort muratpaşa escort manavgat escort çeşme escort sincan escort çankaya escort keçiören escort mamak escort etimesgut escort buca escort konak escort karabağlar escort bornova escort karşıyaka escort bayraklı escort alsancak escort ataşehir escort pendik escort maltepe escort kartal escort kadıköy escort görükle escort atakum escort ayvalık escort deutsche escort berlin escort düsseldorf escort hamburg escort münchen escort stuttgart escort berlin escort düsseldorf escort hamburg escort münchen escort stuttgart escort deutsche escort köln escort ataşehir escort avcılar escort bağcılar escort bahçelievler escort bakırköy escort başakşehir escort bayrampaşa escort bebek escort beşiktaş escort beykoz escort beylikdüzü escort beyoğlu escort çatalca escort çekmeköy escort esenler escort esenyut escort fatih escort gaziosmanpaşa escort güngören escort kadıköy escort kağıthane escort kartal escort küçükcekmece escort maltepe escort pendik escort sancaktepe escort sarıyer escort şile escort silivri escort şişli escort sultanbeyli escort sultangazi escort taksim escort tuzla escort ümraniye escort üsküdar escort zeytinburnu escort manavgat escort