起因
最近項目使用MongoDB,但是作為一個技術菜鳥,NoSQL數據庫我還真不會用,于是我就在自己的阿里云服務器上安裝了一個MongoDB4.0.9。
現象
但是當我使用yum -y update升級以后,MongoDB無法啟動了,即使重裝刪除了MongDB的文件了還是啟動不起來。
解決方案
最后我找到了stackoverflow上的一個問答,解決了這個問題。
按照提示:Most probably this was from previous MongoDB version. I deleted the file (rm -rf /tmp/mongodb-27017.sock) and finished the installation:,由于之前的版本信息導致當前的MongoDB無法啟動起來,執行rm -rf /tmp/mongodb-27017.sock
即可執行systemctl start mongod
啟動起來了。