2015-08-15 106 views
4

我試圖部署一個簡單的ExpressJS應用程序我必須Openshift使用命令行工具。我在下面提供了一個調試跟蹤:無法將Node應用程序部署到Openshift

>npm info ok 
Preparing build for deployment 
Deployment id is 5e2abc99 
Activating deployment 
HAProxy already running 
HAProxy instance is started 
Starting NodeJS cartridge 
Sat Aug 15 2015 15:17:47 GMT-0400 (EDT): Starting application 'xxxxx' ... 
Waiting for application port (8080) become available ... 
Application 'xxxxx' failed to start (port 8080 not available) 

Git Post-Receive Result: failure 
Activation status: failure 
Activation failed for the following gears: 
55cf8fc589f5cf9dbf00023c (Error activating gear: CLIENT_ERROR: Failed to execute: 'control start' for /var/lib/openshift/55cf8fc589f5cf9dbf00023c/nodejs 
#<IO:0x00000001ec7290> 
#<IO:0x00000001ec7218> 
>) 
Deployment completed with status: failure 
postreceive failed 

但是我的應用程序正在偵聽端口8080:

app.listen(process.env.OPENSHIFT_NODEJS_PORT || 8080); 

誰能幫助?

部署一個空應用程序似乎不會引發任何錯誤。

+0

你解決了這個問題嗎?我遇到同樣的問題 –

回答

9

您是否檢查過服務器上的日誌?我遇到了類似的問題,這是因爲我的腳本中有語法錯誤。如果你SSH進入你的應用程序和

tail app-root/logs/nodejs.log 

你可以看到應用程序的控制檯輸出。使用-n [行數]查看更多的日誌,如果10不夠用,或者使用減去,如果要上下滾動查看文檔,按shift + g查看文檔。

+1

作爲對這個問題的評論,這會更合適。 – gnerkus

+0

問題是服務器在失敗時會自行破壞,所以沒有日誌來檢查 –

0

嘗試通過ssh登錄到您的openshift節點。我使用rhc tool。運行你的代碼,你會看到問題出在哪裏。

相關問題