创建基本的微服务环境之后:
设置环境变量后,内存不足:
JAVA_OPTS ='-Xmx512m'
和我的计算机自己的 8Go (系统使用2Go)
jhipster-registry 通过./mvnw
启动jhipster- {uaa,网关,微服务,foo} 通过./gradlew
启动感谢您的帮助
注意:用于生成这些应用程序的jh文件下方的
# documentation https://www.jhipster.tech/jdl/
application {
config {
baseName uaa,
packageName fr.org.foo.uaa,
applicationType uaa,
serverPort 9999,
buildTool gradle,
clientPackageManager npm,
nativeLanguage en,
languages [en,fr],
enableTranslation true,
authenticationType uaa,
cacheProvider hazelcast,
databaseType mongodb,
devDatabaseType mongodb,
prodDatabaseType mongodb,
searchEngine elasticsearch,
enableHibernateCache true,
serviceDiscoveryType eureka,
testFrameworks [gatling,cucumber],
skipClient true
}
entities Workflow, Task, Command
}
application {
config {
baseName gateway,
packageName fr.org.foo.gateway,
applicationType gateway,
serverPort 8080,
buildTool gradle,
clientPackageManager npm,
nativeLanguage en,
languages [en,fr],
enableTranslation true,
authenticationType uaa,
uaaBaseName "uaa",
cacheProvider hazelcast,
websocket spring-websocket,
databaseType mongodb,
devDatabaseType mongodb,
prodDatabaseType mongodb,
searchEngine elasticsearch,
enableHibernateCache true,
serviceDiscoveryType eureka,
clientFramework react,
testFrameworks [gatling,cucumber,protractor],
jhiPrefix jhi
}
entities Workflow, Task, Command
}
application {
config {
baseName foo,
packageName fr.org.foo.foo,
applicationType microservice,
serverPort 8081,
buildTool gradle,
clientPackageManager npm,
nativeLanguage en,
languages [en,fr],
enableTranslation true,
authenticationType uaa,
uaaBaseName "uaa",
cacheProvider hazelcast,
websocket spring-websocket,
databaseType mongodb,
devDatabaseType mongodb,
prodDatabaseType mongodb,
searchEngine elasticsearch,
enableHibernateCache true,
serviceDiscoveryType eureka,
testFrameworks [gatling,cucumber],
jhiPrefix jhi
}
entities Workflow, Task, Command
}
entity Workflow {
id Long required,
name String required minlength(3),
description String
}
entity Task {
id Long required,
name String required minlength(3),
type TaskType required,
description String
}
# http://www.workflowpatterns.com/patterns/
enum TaskType {
Sequence,
Split,
Synchronization,
ExclusiveChoice,
SimpleMerge
}
entity Command {
id Long required,
command String required minlength(3),
parameters String,
version String required
}
relationship OneToMany {
Workflow{task} to Task,
Task{command} to Command
}
relationship ManyToOne {
Task{previous} to Task
Task{next} to Task
}
microservice Workflow, Task, Command with foo
答案 0 :(得分:2)
您确定mvnw或gradlew使用JAVA_OPTS吗?
我个人在spring-boot-maven-plugin配置的pom.xml中设置了JVM args:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
...
<configuration>
<executable>true</executable>
<fork>true</fork>
<mainClass>${start-class}</mainClass>
<jvmArguments>-Xms64m -Xmx128m</jvmArguments>
</configuration>
</plugin>
gradle也有类似的设置
bootRun {
jvmArgs = ["-Xms64m", "-Xmx128m"]
}