Когда я раскручиваю свои докер-контейнеры, используя docker-compose, я получаю следующую ошибку:
partyb | Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
partyb | at java.util.Arrays.copyOf(Arrays.java:3236)
partyb | at java.io.ByteArrayOutputStream.toByteArray(ByteArrayOutputStream.java:191)
partyb | at kotlin.io.ByteStreamsKt.readBytes(IOStreams.kt:123)
partyb | at kotlin.io.ByteStreamsKt.readBytes$default(IOStreams.kt:120)
partyb | at net.corda.core.internal.InternalUtils.readFully(InternalUtils.kt:122)
partyb | at net.corda.node.internal.cordapp.JarScanningCordappLoader.getJarHash(JarScanningCordappLoader.kt:224)
partyb | at net.corda.node.internal.cordapp.JarScanningCordappLoader.toCordapp(JarScanningCordappLoader.kt:151)
partyb | at net.corda.node.internal.cordapp.JarScanningCordappLoader.loadCordapps(JarScanningCordappLoader.kt:104)
partyb | at net.corda.node.internal.cordapp.JarScanningCordappLoader.access$loadCordapps(JarScanningCordappLoader.kt:42)
partyb | at net.corda.node.internal.cordapp.JarScanningCordappLoader$cordapps$2.invoke(JarScanningCordappLoader.kt:54)
partyb | at net.corda.node.internal.cordapp.JarScanningCordappLoader$cordapps$2.invoke(JarScanningCordappLoader.kt:42)
partyb | at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
partyb | at net.corda.node.internal.cordapp.JarScanningCordappLoader.getCordapps(JarScanningCordappLoader.kt)
partyb | at net.corda.node.internal.cordapp.CordappLoaderTemplate$cordappSchemas$2.invoke(JarScanningCordappLoader.kt:400)
partyb | at net.corda.node.internal.cordapp.CordappLoaderTemplate$cordappSchemas$2.invoke(JarScanningCordappLoader.kt:386)
partyb | at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
partyb | at net.corda.node.internal.cordapp.CordappLoaderTemplate.getCordappSchemas(JarScanningCordappLoader.kt)
partyb | at net.corda.node.internal.AbstractNode.<init>(AbstractNode.kt:153)
partyb | at net.corda.node.internal.AbstractNode.<init>(AbstractNode.kt:126)
partyb | at net.corda.node.internal.Node.<init>(Node.kt:97)
partyb | at net.corda.node.internal.Node.<init>(Node.kt:96)
partyb | at net.corda.node.internal.NodeStartup.createNode(NodeStartup.kt:170)
partyb | at net.corda.node.internal.NodeStartup$initialiseAndRun$5.invoke(NodeStartup.kt:162)
partyb | at net.corda.node.internal.NodeStartup$initialiseAndRun$5.invoke(NodeStartup.kt:117)
partyb | at net.corda.node.internal.NodeStartupLogging$DefaultImpls.attempt(NodeStartup.kt:450)
partyb | at net.corda.node.internal.NodeStartup.attempt(NodeStartup.kt:117)
partyb | at net.corda.node.internal.NodeStartup.initialiseAndRun(NodeStartup.kt:160)
partyb | at net.corda.node.internal.NodeStartupCli.runProgram(NodeStartup.kt:108)
partyb | at net.corda.cliutils.CordaCliWrapper.call(CordaCliWrapper.kt:184)
partyb | at net.corda.cliutils.CordaCliWrapper.call(CordaCliWrapper.kt:152)
partyb | at picocli.CommandLine.execute(CommandLine.java:1056)
partyb | at picocli.CommandLine.access$900(CommandLine.java:142)
(ошибка показана для partyb, но это одинаковая ошибка для всех узлов, кроме нотариуса).Очевидно, мой CorDapp слишком большой.
Я прочитал некоторые статьи о Java в контейнере Docker и попытался настроить их соответствующим образом, но пока безуспешно.
Я пытался получить доступ к опции Java UseCGroupMemoryLimitForHeap и инициализированный рой docker для использования конфигурации resources , но это не сработало.
Вот файл compose без какой-либо конфигурации роя:
version: '3.7'
services:
notary:
image: corda/corda-zulu-4.0:latest
container_name: notary
networks:
- corda
volumes:
- ./nodes/notary_node.conf:/etc/corda/node.conf
- ./nodes/notary/certificates:/opt/corda/certificates
- ./nodes/notary/network-parameters:/opt/corda/network-parameters
- ./nodes/notary/additional-node-infos:/opt/corda/additional-node-infos
partya:
image: corda/corda-zulu-4.0:latest
container_name: partya
networks:
- corda
volumes:
- ./nodes/partya_node.conf:/etc/corda/node.conf
- ./nodes/partya/certificates:/opt/corda/certificates
- ./nodes/partya/network-parameters:/opt/corda/network-parameters
- ./build/libs/:/opt/corda/cordapps
- ./nodes/partya/additional-node-infos:/opt/corda/additional-node-infos
partyb:
image: corda/corda-zulu-4.0:latest
container_name: partyb
networks:
- corda
volumes:
- ./nodes/partyb_node.conf:/etc/corda/node.conf
- ./nodes/partyb/certificates:/opt/corda/certificates
- ./nodes/partyb/network-parameters:/opt/corda/network-parameters
- ./build/libs/:/opt/corda/cordapps
- ./nodes/partyb/additional-node-infos:/opt/corda/additional-node-infos
oracle:
image: corda/corda-zulu-4.0:latest
container_name: oracle
networks:
- corda
volumes:
- ./nodes/oracle_node.conf:/etc/corda/node.conf
- ./nodes/oracle/certificates:/opt/corda/certificates
- ./nodes/oracle/network-parameters:/opt/corda/network-parameters
- ./build/libs/:/opt/corda/cordapps
- ./nodes/oracle/additional-node-infos:/opt/corda/additional-node-infos
clientA:
image: cordaclient:latest
networks:
- corda
container_name: clientA
environment:
- USER=XXX
- PASSWORD=XXX
- NETWORK_HOST_AND_RPC_ADDRESS=XXX
depends_on:
- partya
ports:
- "8090:8080"
clientB:
image: cordaclient:latest
networks:
- corda
container_name: clientB
environment:
- USER=XXX
- PASSWORD=XXX
- NETWORK_HOST_AND_RPC_ADDRESS=XXX
depends_on:
- partyb
ports:
- "8070:8080"
networks:
corda:
Заранее благодарю за любую помощь!