1.nones and free tier
-
EC2 just like a computer with only an operating system. The free tier for it
is 750 hours which means you can continuously run an instance in your account for 31 days or you can choose to run 2 instance for 15 days for each of it. - Elastic IP: It is a static IP address which can be associated with your EC2 Instance. So if you shut down your EC2 and restart your EC2, the IP address would not be changed. But for free tier, if Elastic IP is not associated with a running instance or an instance is associated with more than one elastic IP address, you would be charge for fee.
- difference between EC2 and Elastic Beanstalk:simply, EC2 is IaaS and Elastic Beanstalk is PaaS. Therefore, Elastic Beanstalk is more easy-to-use. You can simply upload the code and Elastic Beanstalk would automatically help you configure the infrastructure.
- difference between S3 and RDS:S3 is a storage place, you can upload or retrieve data from it and RDS provide database service.
2.glassfish server & Derby database & Netbean
1)install glassfish and configure it
2)edit inbound and outbound rule in EC2
3)add JDBC connection pool in glassfish(can use ping to check the connection)
this step is very important, you have to setup right server name, database name, user name and also password in order to be able to connect to the database.
4)add JDBC resources in glassfish
5)In Netbean, you should connect to the server, otherwise, you would not be able to deploy your application. You can also connect to your database to check the data.
6)You also need to set up the JDBC connection and JDBC resource for your application.
DB.java & glassfish_resource.xml is related for database conenction in the project. In glassfish_resource, JDBC connection pool and JDBC resource is able to be seen.
3. S3
build a bucket
need to be remined:
-
import associated jar library in to your code project
-
need to change the withRegion to the region that your EC2 instance in.
- need to copy .aws with credential in it to:
4.RDS
need to change connector to a lower edition, if you have the following problem:
5.Elastic beanstalk
should be aware that the application in Elastic Beanstalk still use the data stored in Derby database in Glassfish. And therefore, we should change the URL in DB.java and also change the JDBC connection and resource(make sure the database URL is correct).