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.
--
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.
Yes, you need to add a rule in security group to accept traffic on http 8080 port.
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.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/shopizer/321d520d-5395-4f2b-8639-5360ae1c7a4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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.
- 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).
--
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/4e7c1927-086c-454d-8747-7b0d7ef8311c%40googlegroups.com.