简体   繁体   English

Mongo Meteor AWS EC2多个部署

[英]Mongo Meteor AWS EC2 Multiple Deploy

I was using Galaxy to host my meteor app and recently decided to host my app with Amazon Cloudfront serving static webpage (angular client) and connect that to my meteor app running on an EC2 container. 我当时使用Galaxy托管流星应用程序,最近决定使用Amazon Cloudfront服务静态网页(角度客户端)托管我的应用程序,并将其连接到运行在EC2容器上的流星应用程序。

I have the static page working and I have the meteor app on the EC2 container, which points to a remote mongo server, working as well. 我有静态页面,并且EC2容器上有流星应用程序,它也指向远程mongo服务器,也能正常工作。 I am using the meteor-client-bundler package to attempt to connect the client (static cloudfront) to the Meteor server via DDP URL. 我正在使用meteor-client-bundler软件包尝试通过DDP URL将客户端(静态Cloudfront)连接到Meteor服务器。 Here is where I am stuck. 这就是我卡住的地方。

The DDP Url should be my meteor server correct? DDP网址应该是我的流星服务器正确吗? Hosted at ec2....amazonaws.com)? 托管在ec2 .... amazonaws.com)? I feel like it has to be because I have publications and methods on the server I will need to hit constantly. 我觉得一定是因为我在服务器上需要不断发布出版物和方法。 If that is correct, then what if I also want to have two EC2 containers running the same Meteor app? 如果那是正确的,那么如果我还想让两个EC2容器运行同一Meteor应用程序怎么办? Just like in Galaxy, in case 1 is getting maintenance work done or goes down, I want the backup to take over. 就像在Galaxy中一样,如果情况1完成维护工作或发生故障,我希望备份可以接管。 How can I set up two different DDP urls? 如何设置两个不同的DDP网址?

You should use a custom domain for the server, and use that custom domain in the DDP URL. 您应该为服务器使用自定义域,并在DDP URL中使用该自定义域。 While using the EC2 address will work, it's better to use a different address, especially if you ever want to move to another provider. 虽然可以使用EC2地址,但最好使用其他地址,尤其是如果您想移至其他提供商时。

You can use NGINX as a reverse proxy to have 2 or more Meteor apps on the one box. 您可以将NGINX用作反向代理,以在一个盒子上安装2个或更多Meteor应用程序。 It's not too difficult to set up. 设置起来并不难。

You can also use Meteor up (aka mup) to do multiple deployments to the same box. 您还可以使用Meteor up(也称为mup)在同一个盒子上进行多个部署。 http://meteor-up.com/ Meteor up will give you a very simple way to deploy, it will even revert to the previous version if something goes wrong automatically. http://meteor-up.com/ Meteor up将为您提供一种非常简单的部署方式,如果出现问题,它甚至可以恢复到以前的版本。 You can even configure it to run letsencrypt to give you https security, and automatically renew the certs. 您甚至可以将其配置为运行letsencrypt以为您提供https安全性,并自动更新证书。

For anyone who is new to this stuff like I am, I figured out to buy another domain name, use dns (route 53) to a load balancer (elastic beanstalk) which handles multiple ec2s for 1 domain, and then point your ddp from the client to the domain. 对于像我这样的新手来说,我想买另一个域名,将dns(路由53)使用到一个负载均衡器(弹性beantalk),该负载均衡器可处理1个域的多个ec2,然后从客户端到域。 Boom. 繁荣。 Thanks for the help @Mikkel 感谢@Mikkel的帮助

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

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