Deploying to AWS

301 views
Skip to first unread message

paulca...@gmail.com

unread,
Apr 7, 2018, 1:37:10 PM4/7/18
to Shopizer
Are there any instructions for deploying Shopizer to AWS?

I've the database running on an Aurora mySQL service, which I've been able to connect to and use when. my app is running locally on muy Mac.

I then created an Elastic Beanstalk service and deployed the WAR file to it but when I try to acccess the endpoint it generated I get the folowing 502 error:


Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /.

Reason: Error reading from remote server


It seems to timeout after 60 seconds.

Carl Samson

unread,
Apr 7, 2018, 3:23:19 PM4/7/18
to shop...@googlegroups.com
Hi

You need to configure AWS firewall to accept port 8080 i guess


--
You received this message because you are subscribed to the Google Groups "Shopizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shopizer+unsubscribe@googlegroups.com.
To post to this group, send email to shop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shopizer/738fde7e-a61c-4bc2-8054-7752d24e0260%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

paulca...@gmail.com

unread,
Apr 9, 2018, 4:40:50 PM4/9/18
to Shopizer
I'm not familiar with AWS. In EC2 security groups I selected the relevant group and in the Inbound tab I added Custom TCP Rule with port range 8080 and source 0.0.0.0/0. Is that wat you're referring to?

abhi...@gmail.com

unread,
Apr 14, 2018, 6:38:28 AM4/14/18
to Shopizer
On Tuesday, 10 April 2018 02:10:50 UTC+5:30, paulca...@gmail.com wrote:
> I'm not familiar with AWS. In EC2 security groups I selected the relevant group and in the Inbound tab I added Custom TCP Rule with port range 8080 and source 0.0.0.0/0. Is that wat you're referring to?

Yes, you need to add a rule in security group to accept traffic on http 8080 port.

paulca...@gmail.com

unread,
Apr 27, 2018, 3:04:46 PM4/27/18
to Shopizer
Thanks. I tried that but no joy. I also tried several things such as setting server_port in Elastic Beanstalk, setting the database credentials as environment variables in Elastic Beanstalk, setting server.port in application.properties. I also tried different security configurations but still no joy. Elastic Beanstalk offered different deployment options. I tried both Tomcat and Java. I think Java is probably the correct choice though.

One thing is I didn't have Elasticsearch configured but I don't think that should cause the 502 error.

Has anybody got this working on AWS and if so do they have the steps they followed? I've no AWS experience beyond what I'm trying here so any help would be appreciated.

paulca...@gmail.com

unread,
Apr 27, 2018, 3:20:16 PM4/27/18
to Shopizer
One other thing. I'm deploying the ROOT.war file. Should I be building this as a jar file and deploy that?

Umesh Awasthi

unread,
Apr 27, 2018, 3:29:32 PM4/27/18
to shop...@googlegroups.com
I believe Carl did deployment on AWS sometime back, he should be able to provide more input on this, this is an interesting problem, maybe try to deploy it on the AWS over the weekend

On Fri, Apr 27, 2018 at 12:20 PM, <paulca...@gmail.com> wrote:
One other thing. I'm deploying the ROOT.war file. Should I be building this as a jar file and deploy that?
--
You received this message because you are subscribed to the Google Groups "Shopizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shopizer+unsubscribe@googlegroups.com.
To post to this group, send email to shop...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
With Regards
Umesh Awasthi
http://www.travellingrants.com/

   

abhi...@gmail.com

unread,
Apr 27, 2018, 3:35:36 PM4/27/18
to Shopizer
On Saturday, 28 April 2018 00:50:16 UTC+5:30, paulca...@gmail.com wrote:
> One other thing. I'm deploying the ROOT.war file. Should I be building this as a jar file and deploy that?

If the Elastic beanstalk platform is Java, you need to wrap jar in zip file and upload

If the Elastic beanstalk platform is tomcat, you need to upload war file.

Make sure, by default the Elastic beanstalk listens application on 5000. So either change you app default port to 5000 or change the nginx rule to forward to your applications port.

Carl Samson - GMail

unread,
Apr 27, 2018, 10:57:04 PM4/27/18
to shop...@googlegroups.com
Hi

I am used to work with gcp but one of the committer has done deployment on aws elastic bt, i'll ask him the procedure, will get back

Sent from my iPhone
> --
> You received this message because you are subscribed to the Google Groups "Shopizer" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to shopizer+u...@googlegroups.com.
> To post to this group, send email to shop...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/shopizer/e6b7c893-0014-481b-95a2-c331135e04af%40googlegroups.com.

paulca...@gmail.com

unread,
May 4, 2018, 2:16:53 AM5/4/18
to Shopizer
Made some progress. I messed about with quite a few steps and haven't looked through what helped and what didn't. If I get a chance to go through that and give more specific help I will but for now, heres what I did.

- In sm-shop/src/main/resources/application.properties add:
server.port = 5000
- Start with creating a database. You'll need the details for the database.properties file. I created a mySQL Aurora DB.
- Add the database properties to sm-shop/src/main/resources/database.properties.
- In AWS, create Elastic Beanstalk application and environment. I went with Tomcat so had to build a war file, which I deployed to the environment.
- In Configuration > Software set the following:
Initial JVM heap size (Xms) = 1024m
Max JVM heap size (Xmx) = 1024m
XX:MaxPermSize = 256m
- Add the following Environment Properties:
HIBERNATE_DIALECT = org.hibernate.dialect.MySQLDialect
JDBC_CONNECTION_STRING = jdbc:mysql://mydb.ptmjbhdur9pw.eu-west-2.rds.amazonaws.com:3306/SALESMANAGER?user=username&password=password&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&&driverClass=com.mysql.cj.jdbc.Driver
SERVER_PORT = 5000
- In Configuration > Modify instances:
Instance type = (at least)m1.small
EC2 security groups - I ticked the database security group here.
- In Configuration > Modify capacity:
Environment type = Load balanced
- In Configuration > Load balancer add the following listener:
Port = 8080
Protocol = HTTP
Instance Port = 8080
Instance Protocol = HTTP

When all that was done and I starrted the application without any apparent AWS issues, the application wouldn't load so I checked the Catalina log. It showed the same error as in https://groups.google.com/forum/#!searchin/shopizer/ru%7Csort:date/shopizer/hQjqp_5UswI/goVKf5BTCQAJ so I made that change. The application now loads.

I hope that saves somebody some time(and grief).

Carl Samson

unread,
May 4, 2018, 10:19:24 AM5/4/18
to shop...@googlegroups.com
Many thanks ! i will copy this recipe and save it in documentation section

Regards 👍

--
You received this message because you are subscribed to the Google Groups "Shopizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shopizer+unsubscribe@googlegroups.com.

To post to this group, send email to shop...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages