简体   繁体   English

用于postgres + node + AWS弹性beantalk的package.json

[英]package.json for postgres+node+AWS elastic beanstalk

The Postgres interface (to a remote DB) isnt working on my node app using Sequelize. 使用Sequelize,Postgres接口(到远程数据库)在我的节点应用程序上不起作用。 mysql works. mysql的作品。 postgres did need some kicking on my development machine, so I am not surprised it didnt just magically work. postgres确实需要在我的开发机器上进行一些操作,所以我并不惊讶它并没有神奇地起作用。 Now when sequelize attempts to use the postgres dialect it fails. 现在,当sequelize尝试使用postgres方言时,它会失败。 I have ssh'd onto my instance, and the pg and pg-hstore stuff is there, but my server just crashes on start up (I stuck an error message in just prior to sequelize init which gets printed about 16 times a restart, but I jave no other information). 我已经将ssh'd到了我的实例上,并且那里有pg和pg-hstore的东西,但是我的服务器在启动时崩溃了(我在sequelize init之前粘贴了一条错误消息,该消息在重启后大约打印了16次,但是我没有其他信息)。

I wanted to manually do some npm install -save stuff, just to get the lights on, but I cant just do that it seems (no node or npm). 我想手动做一些npm install -save东西,只是为了打开灯,但我不能只是做它(没有节点或npm)。 Either way, I dont really want to be SSHing about, I just want to know how to install postgres node stuff on elastic beanstalk. 无论哪种方式,我都不想要SSH,我只想知道如何在弹性beantalk上安装postgres节点。 Is there some magic I need to add in package.json, if I want this to be scalable then I assume all the into needs to go into that. 我需要在package.json中添加一些魔术,如果我希望它具有可伸缩性,那么我认为所有需要的东西都可以放入其中。

EDIT: My problems were nothing to do with postgres at all, and everything to do with the INTERVAL data type I added to data-types.js in sequelize. 编辑:我的问题根本与postgres无关,与我在sequelize中添加到data-types.js的INTERVAL数据类型无关。 postgres installs just fine with postgres可以很好地安装

"pg":"latest"
"pg-hstore":"latest"

Elastic Beanstalk is mainly designed to serve as a web server, so installing databases is outside of its comfort zone. Elastic Beanstalk主要设计为充​​当Web服务器,因此安装数据库不在其舒适范围之内。 I'd personally recommend you'd use AWS RDS with postgres, which comes pre-installed and ready to use with Elastic Beanstalk. 我个人建议您将AWS RDS与postgres一起使用,该组件已预先安装并可以与Elastic Beanstalk一起使用。 A very simple example can be found here . 在这里可以找到一个非常简单的示例。 You tried to install PG manually via SSH, but that won't help, as Elastic Beanstalk loses all changes upon restart, and it will restart at its own free will without your control. 您尝试通过SSH手动安装PG,但这无济于事,因为Elastic Beanstalk在重新启动后会丢失所有更改,并且它将在不受您控制的情况下随意重新启动。 So please don't count on any SSH change you make. 因此,请不要指望您进行任何SSH更改。
Now if you really need to install PG yourself, I'd go with the docker approach as you can just grab a ready made postgres installation from here . 现在,如果您真的需要自行安装PG,我将采用docker方法,因为您可以从此处进行现成的postgres安装。
Lastly, if you need help resolving any error you get when you install PG manually, you'll need to share the errors in this thread. 最后,如果您需要帮助解决手动安装PG时遇到的任何错误,则需要在此线程中共享错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM