开发人员指南 > 开发人员指南 > Codebeamer 架构 > 集群架构 > 如何使用 Docker Compose 设置群集
如何使用 Docker Compose 设置群集
基础设施图
EC2 的主机名如下:
ip-172-31-6-71.eu-central-1.compute.internal - Codebeamer
ip-172-31-0-235.eu-central-1.compute.internal - Codebeamer
ip-172-31-14-188.eu-central-1.compute.internal - MySQL。
Docker 配置
docker-compose.yml
# Copyright by Intland Software, https://www.intland.com
#
# All rights reserved.
#
# Please note that if you change this docker file, we do not take any responsibility and we are not liable for
# any damage caused through use of this image, be it indirect, special, incidental
# or consequential damages (including but not limited to damages for loss of business, loss of profits, interruption or the like).


version: '2.1'


services:
codebeamer-app:
image: intland/codebeamer-git:21.09-SP6
ports:
- 8080:8080
- 4001:4001
- 4002:4002
- 9000:9000
hostname: ip-172-31-6-71.eu-central-1.compute.internal
environment:
- DEBUG=false
- CB_CLUSTER_ENABLED=true
- CB_ping_testingEnabled=true

# RMI - Common
- CB_RMI_CACHE_HOSTNAME=<HOSTNAME>
- CB_RMI_REPLICATION_CACHE_PORT=4001
- CB_RMI_INVALIDATION_CACHE_PORT=4002
- CB_RMI_CACHE_SOCKET_TIMEOUT_MILLIS=12000
- CB_RMI_CACHE_REMOTE_OBJECT_PORT=9000

# RMI - Manual
- CB_RMI_CACHE_INSTANCES=<CLUSTER_HOSTNAMES>

# RMI - Discovery
## New configuration - TTL of living RMI cache node, if no update from the node after 10 seconds, codebeamer will remove this node from the cache synchronization
- CB_RMI_CACHE_TIME_TO_LIVE=10s
## New configuration - Frequently of RMI node's hearth beat
- CB_RMI_HEARTH_BEAT_INTERVAL=1s

- CB_notification_enableWebsocket=true
- CB_DOCKER_LOGGING=true
- TZ=Europe/Berlin
- WAIT_HOSTS=ip-172-31-14-188.eu-central-1.compute.internal:3306
- WAIT_HOSTS_TIMEOUT=120
- CB_DOCS_SIZE_CALCULATION=false
- "JVM_OPTIONS=-Djava.rmi.server.hostname=ip-172-31-6-71.eu-central-1.compute.internal -Djava.net.preferIPv4Stack=true"
- "CB_database_JDBC_Username=user"
- "CB_database_JDBC_Password=pass"
- "CB_database_JDBC_Driver=com.mysql.jdbc.Driver"
- "CB_database_JDBC_ConnectionURL=jdbc:mysql://ip-172-31-14-188.eu-central-1.compute.internal:3306/codebeamer?autoReconnect=true&zeroDateTimeBehavior=convertToNull&emulateLocators=true&characterEncoding=UTF-8&useSSL=false"
volumes:
- /vol/access:/home/appuser/codebeamer/repository/access
- /vol/git:/home/appuser/codebeamer/repository/git
- /vol/svn:/home/appuser/codebeamer/repository/svn
- /vol/hg:/home/appuser/codebeamer/repository/hg
- /vol/docs:/home/appuser/codebeamer/repository/docs
- /vol/search:/home/appuser/codebeamer/repository/search
- /vol/logs:/home/appuser/codebeamer/logs
- /vol/lucene:/home/appuser/codebeamer/repository/lucene
- /vol/tmp:/home/appuser/codebeamer/repository/tmp
# Only if RMI - Discovery is configured
- /vol//home/appuser/codebeamer/repository/config/cache/peerDiscovery
要设置 RMI 缓存同步,请确保正确设置以下属性:
hostname
这是必需项,因为 RMI 会将 RMI 存根与此域名进行绑定。
CB_RMI_CACHE_HOSTNAME/CB_RMI_CACHE_INSTANCES
Codebeamer 将使用这些名称来设置 RMI 通信。
JVM_OPTIONS
应将 Java 虚拟机设置为使用 IPv4 而不是 IPv6,RMI 也需要获悉主机名。
这对您有帮助吗?