创建过程:
Shaman[[[[[[[[[[[[[[[[[@SHAMAN-PC](/user/SHAMAN-PC)](/user/SHAMAN-PC)](/user/SHAMAN-PC)](/user/SHAMAN-PC)](/user/SHAMAN-PC)](/user/SHAMAN-PC)](/user/SHAMAN-PC)](/user/SHAMAN-PC)](/user/SHAMAN-PC)](/user/SHAMAN-PC)](/user/SHAMAN-PC)](/user/SHAMAN-PC)](/user/SHAMAN-PC)](/user/SHAMAN-PC)](/user/SHAMAN-PC)](/user/SHAMAN-PC)](/user/SHAMAN-PC) /e/cloudfoundry/testapp
$ vmc push
Would you like to deploy from the current directory? [Yn]: y
Application Name: testapp
Detected a Node.js Application, is this correct? [Yn]: y
Application Deployed URL [testapp.cloudfoundry.com]: shaman.cloudfoundry.com
Memory reservation (128M, 256M, 512M, 1G, 2G) [64M]: 1G
How many instances? 1:
Create services to bind to ‘testapp’? [yN]: y
1: mongodb
2: mysql
3: postgresql
4: rabbitmq
5: redis
What kind of service?: 2
Specify the name of the service [mysql-a8398]:
Create another? [yN]: n
Would you like to save this configuration? [yN]: y
Manifest written to manifest.yml.
Creating Application: OK
Creating Service [mysql-a8398]: OK
Binding Service [mysql-a8398]: OK
Uploading Application:
Checking for available resources: OK
Processing resources: OK
Packing application: OK
Uploading (11K): OK
Push Status: OK
Staging Application ‘testapp’: OK
Starting Application ‘testapp’: …
Error: Application [testapp] failed to start, logs information below.
====> /logs/stdout.log <====
Express server listening on port 3000 in development mode
Delete the application? [Yn]: n
最后在 start 出错了 , 然后我重新启动的时候提示 already started , 查看了app状态 如下:
什么原因 , 初学nodejs 和使用cloudfoundry ,请教什么原因
换掉端口 update 后,还是启动失败 :
好蛋疼啊,就差最后一步 郁闷
port = (process.env.VMC_APP_PORT || 3000); host = (process.env.VCAP_APP_HOST || ‘localhost’);
入口一定是 server.js
本地先跑跑看 能不能起来
将node_modules下的.bin目录删掉 试试~~~
我testapp是用的express安装的一个默认应用啥也没改,入口是app.js,本地能跑起来
还是不行,删掉后的更新重启
这个 /logs/stdout.log 到哪里去查看呢
同遇到这个问题~晚上回来解决一下!
不过我的是连接不上数据库,想问下lz,数据库的密码和帐号在哪里查看,并且在哪里管理的!
我还没开始连接数据库,就是用express安装了一个默认的testapp来测试一下能否启动
至于配置,可以参考下我的 config
用nae吧 哈
多谢,是端口的原因。不能指定端口号,应该使用环境变量来取得相应的端口。
3Q,问题找到了,应该使用环境变量取得端口号
木有邀请码 :(
@shaman email 多少 ,我发给你
@xieren58 27231583@qq.com 已经可以登录到http://cnodejs.net/application了,应该可以了吧
@shaman 那就是可以了~~
@xieren58 嗯 非常感谢
@shaman 具体怎么实现的呢,最近我也遇到相同的问题,怎么使用环境变量取得端口和IP?请指点,谢谢哈