java - 如何将 Jhipster 堆栈部署到 AWS
问题描述
我使用带有 React 前端的 Jhipster 堆栈构建了我的单体应用程序。我可以正常运行我的应用程序。我想将我的应用程序部署到 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
但平台(Tomcat 8.5 和 Java 8 在 64 位 Amazon Linux 上运行)已弃用。
我试图打开应用程序地址http://xxx.us-west-1.elasticbeanstalk.com/
,它只显示 HTTP 状态 404 – 未找到
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
我不知道哪里错了。我找不到关于这个的其他教程
解决方案
推荐阅读
- sql - SQL查询以获取其他行的平均总和并存储在当前行中
- python - 将 numpy.einsum 用于切片的张量点
- perl - 想知道 sed 或 awk 是否可以使用行号重新排序
- javascript - 如何在 componentWillUnmount 中从 core-ui/react 隐藏 AppAsideToggler 组件?
- list - 使用冒泡排序按长度对列表中的列表进行排序 - Haskell
- reactjs - 如果您必须拆分代码以提高性能,那么单页大型应用程序的意义何在?
- arrays - 通过引用函数传递二维数组
- javascript - 如何在JS中将一个对象数组中的属性值添加到另一个对象(对于匹配的对象)
- macos - dyld:惰性符号绑定失败:找不到符号:____chkstk_darwin
- javascript - 为 Django 实现数据输入表前端的标准方法