Skip to content

Commit 57152f7

Browse files
committed
翻译58.4.1 AWS Elastic Beanstalk
1 parent 20494f3 commit 57152f7

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed
Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
### 58.4.1 AWS Elastic Beanstalk
22

3-
As described in the official Elastic Beanstalk Java guide, there are two main options to deploy a Java application; You can either use the “Tomcat Platform” or the “Java SE platform”.
3+
就像在官方的[Elastic Beanstalk Java指南](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Java.html)里描述的那样,有两种主要的方式来部署Java应用。你可以使用““Tomcat平台”或者“Java SE平台”。
44

5-
Using the Tomcat platform
5+
**使用Tomcat平台**
66

7-
This option applies to Spring Boot projects producing a war file. There is no any special configuration required, just follow the official guide.
7+
这个选项适用于产生war文件的Spring Boot工程。不需要任何特殊的配置,按照官方的指南一步步来就好。
88

9-
Using the Java SE platform
10-
11-
This option applies to Spring Boot projects producing a jar file and running an embedded web container. Elastic Beanstalk environments run an nginx instance on port 80 to proxy the actual application, running on port 5000. To configure it, add the following to your application.properties:
9+
**使用Java SE平台**
1210

11+
这个选项适用于产生jar文件并运行一个内嵌的网络容器的Spring Boot工程。Elastic Beanstalk环境在80端口上运行一个nginx实例,来代理运行在5000端口上的实际的应用。在你的`application.properties`中加入以下内容,来进行配置:
12+
```properties
1313
server.port=5000
14-
Best practices
15-
16-
Uploading binaries instead of sources
14+
```
15+
**最佳实践**
1716

18-
By default Elastic Beanstalk uploads sources and compile them in AWS. To upload the binaries instead, add the following to your .elasticbeanstalk/config.yml file:
17+
**上传二进制文件代替源码**
1918

19+
默认地,Elastic Beanstalk上传源码并在AWS进行编译。为了上传二进制文件作为替代,在你的`.elasticbeanstalk/config.yml`文件中加入以下内容:
20+
```properties
2021
deploy:
2122
artifact: target/demo-0.0.1-SNAPSHOT.jar
2223
Reduce costs by setting the environment type
23-
24-
By default an Elastic Beanstalk environment is load balanced. The load balancer has a cost perspective, to avoid it, set the environment type to “Single instance” as described in the Amazon documentation. Single instance environments can be created using the CLI as well using the following command:
25-
26-
eb create -s
24+
```
25+
默认地,Elastic Beanstalk环境负载均衡。负载均衡器会优先考虑成本,为了避免这个,按照[亚马逊文档](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-create-wizard.html#environments-create-wizard-capacity)里描述的那样,设置环境类型为“单个实例”。单个实例环境可以使用CLI或者以下命令进行创建:
26+
```command
27+
eb create -s
28+
```

0 commit comments

Comments
 (0)