繁体   English   中英

如何将 Jhipster 堆栈部署到 AWS

[英]How to deploy Jhipster stack to AWS

我使用 Jhipster 堆栈和 React 前端构建了我的单体应用程序。 我可以正常运行我的应用程序。 我想将我的应用程序部署到 AWS。

我按照指南然后运行jhipster aws 一切都好。 这是日志:

PS E:\source\vpark> jhipster aws
INFO! Using JHipster version installed globally
INFO! No custom sharedOptions found within blueprint: generator-jhipster-react-antd at C:/Users/dungreact/AppData/Roaming/npm/node_modules/generator-jhipster-react-antd
INFO! No custom commands found within blueprint: generator-jhipster-react-antd at C:/Users/dungreact/AppData/Roaming/npm/node_modules/generator-jhipster-react-antd
? Application name: vpark
? Environment name: vpark-env
? Name of S3 bucket: vpark-s3
? Database name: vpark
? Database username: root
? Database password: [hidden]
? On which EC2 instance type do you want to deploy? t2.small
? On which RDS instance class do you want to deploy? db.t2.micro
? On which region do you want to deploy? us-west-1
Building application
Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details
> Task :bootBuildInfo
> Task :nodeSetup UP-TO-DATE
> Task :npmSetup UP-TO-DATE

> Task :npm_install

up to date, audited 1677 packages in 24s

165 packages are looking for funding
  run `npm fund` for details

3 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> Task :webapp

> vpark@0.0.1-SNAPSHOT webapp:prod
> npm run clean-www && npm run webapp:build:prod


> vpark@0.0.1-SNAPSHOT clean-www
> rimraf build/resources/main/static/app/{src,build/}


> vpark@0.0.1-SNAPSHOT webapp:build:prod
> npm run webpack -- --config webpack/webpack.prod.js --progress=profile


> vpark@0.0.1-SNAPSHOT webpack
> node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "--config" "webpack/webpack.prod.js" "--progress=profile"

assets by status 576 KiB [cached] 5 assets
assets by status 5.06 MiB [compared for emit]
  assets by path content/ 1.24 MiB
    assets by status 1.08 MiB [big] 2 assets
  assets by path swagger-ui/ 3.77 MiB 14 assets
  assets by status 5.4 KiB [emitted]
    asset service-worker.js 3.61 KiB [emitted] [compared for emit] [minimized]
    asset index.html 1.79 KiB [emitted] [compared for emit]
  assets by path ./i18n/*.json 24.1 KiB
    asset ./i18n/vi.json 12.9 KiB [compared for emit]
    asset ./i18n/en.json 11.2 KiB [compared for emit]
  4 assets
assets by path app/*.js 1.63 MiB
  asset app/vendors.f5ebb1aa658a977e2d40.bundle.js 1.51 MiB [emitted] [immutable] [minimized] [big] (name: vendors) (id hint: commons) 1 related asset
  asset app/main.e88c24c5e7a0c24765e4.bundle.js 120 KiB [emitted] [immutable] [minimized] (name: main)
Entrypoint main [big] 2.15 MiB = app/vendors.f5ebb1aa658a977e2d40.bundle.js 1.51 MiB content/main.237501a1e51be6d9143b.css 533 KiB app/main.e88c24c5e7a0c24765e4.bundle.js 120 KiB
cached modules 5.87 MiB (javascript) 551 KiB (css/mini-extract) [cached] 1510 modules
runtime modules 11 KiB 15 modules
orphan modules 37.5 KiB [orphan] 1 module
javascript modules 120 KiB
  ./src/main/webapp/app/shared/reducers/locale.ts 1.21 KiB [built] [code generated]
  ./node_modules/rc-field-form/es/index.js + 14 modules 114 KiB [built] [code generated]
  ./node_modules/react-jhipster/lib/src/util/log-util.js 1.93 KiB [built] [code generated]
  ./node_modules/postcss/lib/postcss.js 2.57 KiB [built] [code generated]

LOG from GenerateSW
<i> The service worker at service-worker.js will precache
<i>         32 URLs, totaling 3.62 MB.

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  content/images/logo.png (318 KiB)
  content/images/map.png (788 KiB)
  swagger-ui/swagger-ui-bundle.js (1.13 MiB)
  swagger-ui/swagger-ui-es-bundle-core.js (518 KiB)
  swagger-ui/swagger-ui-es-bundle.js (1.13 MiB)
  swagger-ui/swagger-ui-standalone-preset.js (343 KiB)
  swagger-ui/swagger-ui.js (518 KiB)
  content/main.237501a1e51be6d9143b.css (533 KiB)
  app/vendors.f5ebb1aa658a977e2d40.bundle.js (1.51 MiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  main (2.15 MiB)
      app/vendors.f5ebb1aa658a977e2d40.bundle.js
      content/main.237501a1e51be6d9143b.css
      app/main.e88c24c5e7a0c24765e4.bundle.js


webpack 5.51.1 compiled with 2 warnings in 23251 ms

> Task :processResources UP-TO-DATE
> Task :compileJava UP-TO-DATE
> Task :generateGitProperties
> Task :classes
> Task :bootWar

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 1m 15s
9 actionable tasks: 5 executed, 4 up-to-date

Create S3 bucket
Bucket vpark-s-3 created successfully

Upload WAR to S3
War uploaded successful

Create database
Database created successfully

Waiting for database (This may take several minutes)
Database available at jdbc:mysql://vpark.culndou2fn7b.us-west-1.rds.amazonaws.com:3306/vpark

Verifying ElasticBeanstalk Roles

Create/Update application
Environment vpark-env created successfully
    force .yo-rc.json

No change to package.json was detected. No package manager install will be executed.
Congratulations, JHipster execution is complete!
Sponsored with ❤️  by @oktadev.

然后我打开 Elastic Beanstalk 控制台。 环境是green的,但平台(在 64 位 Amazon Linux 上运行 Java 8 的 Tomcat 8.5)已弃用。

我尝试打开应用地址http://xxx.us-west-1.elasticbeanstalk.com/ ,它只是显示 HTTP Status 404 – Not Found

HTTP Status 404 – Not Found
Type Status Report

Message The requested resource [/] is not available

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

Apache Tomcat/8.5.63

我不知道哪里错了。 我找不到关于此的其他教程

我在 AWS 上运行 JHipster 时也遇到了很多问题,我认为它没有得到更新和维护。

首先,尝试在 AWS 上手动创建和部署它,这将为您提供更大的灵活性来按照您需要的方式执行操作,并提供更多信息以便进行调试。 最后,JHipster 将是一个 Spring Boot 应用程序,任何 Spring Boot AWS 部署教程都应该有效。

你找到解决办法了吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM