AWS踩坑指南

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

image.png

need to be remined:

  • import associated jar library in to your code project
    image.png

    image.png
  • need to change the withRegion to the region that your EC2 instance in.
    image.png
  • 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:


image.png

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).

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容