Mysql 帆在生产中不起作用
我正在部署我的第一个应用程序。我使用了一个Mysql 帆在生产中不起作用,mysql,node.js,amazon-web-services,sails.js,production,Mysql,Node.js,Amazon Web Services,Sails.js,Production,我正在部署我的第一个应用程序。我使用了一个AWS-MySQL-RDS实例。我尝试将我的本地sails.js应用程序连接到RDS实例。我已经更改了config/env/production.js、config/models.js和config/connection.js中的连接参数,如下所示 ***** config/connection.js ****** myproduction: { module: 'sails-mysql', host: 'MySQL
AWS-MySQL-RDS
实例。我尝试将我的本地sails.js应用程序连接到RDS实例。我已经更改了config/env/production.js
、config/models.js
和config/connection.js
中的连接参数,如下所示
***** config/connection.js ******
myproduction: {
module: 'sails-mysql',
host: 'MySQLRDSHostName',
port: 3306,
user: 'myUserName',
password: 'myPassword',
database: 'myDatabaseName'
}
***** config/models.js ******
module.exports.models = {
/***************************************************************************
* *
* Your app's default connection. i.e. the name of one of your app's *
* connections (see `config/connections.js`) *
* *
***************************************************************************/
connection: 'myproduction',
/***************************************************************************
* *
* How and whether Sails will attempt to automatically rebuild the *
* tables/collections/etc. in your schema. *
* *
* See http://sailsjs.org/#/documentation/concepts/ORM/model-settings.html *
* *
***************************************************************************/
migrate: 'safe' //This setting applies in production environment
};
***** config/env/production.js ******
module.exports = {
/***************************************************************************
* Set the default database connection for models in the production *
* environment (see config/connections.js and config/models.js ) *
***************************************************************************/
models: {
connection: 'myproduction'
},
/***************************************************************************
* Set the port in the production environment to 80 *
***************************************************************************/
port: 80
/***************************************************************************
* Set the log level in production environment to "silent" *
***************************************************************************/
// log: {
// level: "silent"
// }
};
当我运行sails lift--prod
时,我得到以下错误
info: Starting app...
error:
------------------------------------------------------------------------
grunt-cli: The grunt command line interface. (v0.1.13)
Fatal error: Unable to find local grunt.
If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:
http://gruntjs.com/getting-started
------------------------------------------------------------------------
error: Looks like a Grunt error occurred--
error: Please fix it, then **restart Sails** to continue running tasks (e.g. watching for changes in assets)
error: Or if you're stuck, check out the troubleshooting tips below.
error: Troubleshooting tips:
error:
error: *-> Are "grunt" and related grunt task modules installed locally? Run `npm install` if you're not sure.
error:
error: *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
error:
error: *-> Or maybe you don't have permissions to access the `.tmp` directory?
error: e.g., `/home/ec2-user/pick/pick-backend/.tmp` ?
error:
error: If you think this might be the case, try running:
error: sudo chown -R YOUR_COMPUTER_USER_NAME /home/ec2-user/pick/pick-backend/.tmp
我尝试将超时时间从20000增加到60000。这没用
我更改了我的config/env/development.js
以指向RDS,并进行了sails-lift
,效果非常好
module.exports = {
/***************************************************************************
* Set the default database connection for models in the development *
* environment (see config/connections.js and config/models.js ) *
***************************************************************************/
models: {
connection: 'myproduction' //Just to check if it works!
}
};
我能够成功地将RDS
连接到我的MySQL工作台
我迷路了。我在这里遗漏了什么吗?您尝试过“故障排除提示”中提到的内容吗?是的,我尝试过。没有任何帮助编辑看起来像是一个与mysql无关的咕噜问题,这可能会有所帮助:您尝试了“疑难解答提示”中提到的内容吗?是的,我尝试了。没有任何帮助编辑看起来像是一个与mysql无关的咕噜问题,这可能会有所帮助:您尝试了“疑难解答提示”中提到的内容吗?是的,我尝试了。没有任何帮助编辑看起来像是与mysql无关的grunt问题,这可能会有帮助: