1. mount 查看當(dāng)前系統(tǒng)所有分區(qū)掛載情況,包括分區(qū)類型
/dev/vda1 on / type ext4 (rw,errors=remount-ro)
/dev/vdb1 on /sda type ext4 (rw)
2. fdisk -l 顯示分區(qū)信息
Disk /dev/vda: 53.7 GB, 53687091200 bytes
Disk identifier: 0x000da36d
Device Boot? ? ? Start? ? ? ? End? ? ? Blocks? Id? System
/dev/vda1? *? ? ? ? 2048? 104855551? ? 52426752? 83? Linux
Disk /dev/vdb: 322.1 GB, 322122547200 bytes
Disk identifier: 0x000da36d
Device Boot? ? ? Start? ? ? ? End? ? ? Blocks? Id? System
/dev/vdb1? ? ? ? ? ? 2048? 629145599? 314571776? 83? Linux
3. df -h 顯示各分區(qū)磁盤空間使用情況:
Filesystem? ? ? Size? Used Avail Use% Mounted on
/dev/vda1? ? ? ? 50G? 6.0G? 41G? 13% /
/dev/vdb1? ? ? 296G? 272G? 8.7G? 97% /sda
4.? fdisk /dev/vdb1 對準(zhǔn)備操作的磁盤進(jìn)行預(yù)查看,出現(xiàn)以下報警信息:
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x744ad656.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
5. 如何解決上述問題孤个?
快到了十一點(diǎn)我才發(fā)現(xiàn)上面就是個逗逼的提示信息T呶唷滋觉!
媽蛋反惕,面臨著mongodb數(shù)據(jù)盤空間不足的緊要關(guān)頭,生怕被上面的提示信息一鼓搗,我的服務(wù)器從此失去mongo日志了炕吸!
緊張了一上午伐憾,才反應(yīng)過來就是個逗逼的提示信息,嚇得我半死K阃尽塞耕!
補(bǔ)充: 重啟ecs實例后,準(zhǔn)備擴(kuò)容磁盤嘴瓤。結(jié)果發(fā)現(xiàn)又走到老路上了: fdisk /dev/vdb1扫外。我干嘛老喜歡加上vdb1呢?這又導(dǎo)致我怎么創(chuàng)建新分區(qū)都是以前一樣的大小廓脆。我都差點(diǎn)兒要給阿里云打電話了I秆琛!
還好停忿,終于試著敲了一次 fdisk /dev/vdb 驾讲,然后 d , n , p ,1 開始擴(kuò)容。
現(xiàn)在運(yùn)行 resize2fs /dev/vdb1 席赂,結(jié)果提示必須運(yùn)行 e2fsck -f /dev/vdb1 (就是怕因為300G的日志導(dǎo)致這一過程)吮铭,所以擔(dān)驚受怕地敲了下去。最后resize2fs /dev/vdb1颅停,然后df發(fā)現(xiàn)一起大好谓晌。
補(bǔ)充: 詳細(xì)過程為: fdisk /dev/vdb 然后輸入(d,n,p,1),然后兩次回車,最后(wq)保存,這樣就創(chuàng)建了一個新分區(qū)并且使用了最大的磁盤容量。fdisk -l 查看一下癞揉。然后e2fsck -f /dev/vdb1,完成后使用 resize2fs /dev/vdb1纸肉。再次 fdisk -l 查看,然后 mount /dev/vdb1 /sda喊熟,df -h 看到新的擴(kuò)容后的數(shù)據(jù)盤變大了柏肪!
6. click server 系統(tǒng)自啟動redis server有問題, ../init.d/redis-server 有問題芥牌? 我必須執(zhí)行 redis-server /etc/redis/redis.conf 才可以確保使用了配置文件烦味,否則沒有使用配置文件.
懷疑如下命令正確與否:
if start-stop-daemon --start --quiet --umask 007 --pidfile $PIDFILE --chuid redis:redis --exec $DAEMON -- $DAEMON_ARGS
7. mongodb 關(guān)閉應(yīng)該自己手動調(diào)用命令或者下述別名關(guān)閉,確保數(shù)據(jù)不丟失壁拉。而不是讓系統(tǒng)去關(guān)閉拐叉。
alias mongostop='mongo admin --eval "db.shutdownServer()"'
8. jms 服務(wù)器關(guān)閉可以在jms admin輸入shutdown關(guān)閉。