雖然我已經嘗試過幾種解決SO相關問題的解決方案,但是在Google Compute Engine上將Meteor項目部署到虛擬機時似乎沒有解決我的問題。使用mupx將流星部署配置到Google Compute Engine虛擬機
我設置mupx處理的部署,沒有任何明顯的問題,運行
sudo mupx deploy
當我mup.json
如下
{
// Server authentication info
"servers": [
{
"host": "104.199.141.232",
"username": "simonlayfield",
"password": "xxxxxxxx"
// or pem file (ssh based authentication)
// "pem": "~/.ssh/id_rsa"
}
],
// Install MongoDB in the server, does not destroy local MongoDB on future setup
"setupMongo": true,
// WARNING: Node.js is required! Only skip if you already have Node.js installed on server.
"setupNode": true,
// WARNING: If nodeVersion omitted will setup 0.10.36 by default. Do not use v, only version number.
"nodeVersion": "0.10.36",
// Install PhantomJS in the server
"setupPhantom": true,
// Show a progress bar during the upload of the bundle to the server.
// Might cause an error in some rare cases if set to true, for instance in Shippable CI
"enableUploadProgressBar": true,
// Application name (No spaces)
"appName": "simonlayfield",
// Location of app (local directory)
"app": ".",
// Configure environment
"env": {
"ROOT_URL": "http://simonlayfield.com"
},
// Meteor Up checks if the app comes online just after the deployment
// before mup checks that, it will wait for no. of seconds configured below
"deployCheckWaitTime": 30
}
當在瀏覽器中瀏覽到我的外部IP我可以看到Meteor網站模板,但是Mongodb數據沒有顯示出來。
我已經設置防火牆規則了在虛擬機上,允許端口流量27017
Name: mongodb
Description: Allow port 27017 access to http-server
Network: default
Source filter: Allow from any source (0.0.0.0/0)
Allowed protocols and ports: tcp:27017
Target tags: http-server
我也試過路過的環境變量MONGO_URL
但經過幾次失敗的嘗試,我發現this post在流星論壇上建議在使用本地Mongodb數據庫時不需要它。
我目前使用ssh而不是gcloud SDK連接到VM,但如果它能幫助解決問題,我很樂意設置它。
我真的很感激,如果有人可以提供一些指導我如何能夠具體知道什麼是錯的。我設置的防火牆規則是否足夠?特別是在使用Google Compute Engine虛擬機時是否還有其他因素需要考慮?有沒有辦法讓我通過ssh檢查服務器上的日誌,以獲得有關連接/防火牆/配置問題的額外清晰度?
我在這方面的知識是有限的,所以如果有一個簡單的解決方案逃避了我的道歉。
在此先感謝。
更新:檢查在瀏覽器控制檯中,我可以看到存在針對ws://simonlayfield.com/sockjs/612/6dozasr9/websocket的url請求,該請求處於「掛起」狀態。我認爲這是相關的。 –
你使用什麼密碼?我認爲GCE不允許通過用戶名/密碼進行用戶認證? – Srini