java -D 配置系统属性
# 启动时加参数 -DDUBBO_IP_TO_REGISTRY= 192.168.1.1 该ip为dubbo所在服务器的公网ip即可。
java -jar myDubboRpc-api.jar -DDUBBO_IP_TO_REGISTRY= 192.168.1.1
# xjar启动
nohup ./xjar java -DDUBBO_IP_TO_REGISTRY=11.22.33.44 -XX:+UseG1GC -jar $SERVER_NAME --spring.profiles.active=$SERVER_ENV &> nohup.out &
java -Ddubbo_ip_to_registry=192.168.99.230 -jar seller.jar
dcoker文章来源:https://www.toymoban.com/news/detail-615280.html
finance-task:
image: 192.168.99.182:8082/bessky-finance-task
container_name: bessky-finance-task
restart: always
environment:
- NACOS_CONFIG_SERVERADDR
- NACOS_CONFIG_NAMESPACE
- DUBBO_IP_TO_REGISTRY
- XXL_JOB_EXECUTOR_IP
- JASYPT_ENCRYPTOR_PASSWORD
- JAVA_OPTS="-Xms4g -Xmx4g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump"
- logging.appender.ref=FILE
- logging.file=logs/debug.log
- logging.level.root=ERROR
- logging.level.com.bessky.finance=DEBUG
- xxl.job.executor.log-path=logs/job
volumes:
- ./logs/task:/logs
- ./dump/task:/dump
- ./logs/task/job:/logs/job
ports:
- 20703:20703
- 20704:20704
环境变量配置/etc/profile文章来源地址https://www.toymoban.com/news/detail-615280.html
export DUBBO_IP_TO_REGISTRY=192.168.99.11
export XXL_JOB_EXECUTOR_IP=192.168.99.11
export NACOS_CONFIG_SERVERADDR=192.168.99.57:8848
export NACOS_CONFIG_NAMESPACE=a7b74b8d-0eeb-4cbc
export JASYPT_ENCRYPTOR_PASSWORD=basdfs15
export AES_ENCRYPTOR_SEED=8740#aDxdasd211215
export SPRING_DATA_ELASTICSEARCH_CLUSTERNODES=192.168.99.59:9300
export LOGGING_APPENDER_REF=FILE
export LOGGING_FILE=logs/debug.log
export ZK_INSTANCE_IP=192.168.99.11
docker run -d \
--name dubbo-nacos-provider \
-e DUBBO_IP_TO_REGISTRY="192.168.28.130" \
-p 20880:20880 \
registry.cn-guangzhou.aliyuncs.com/zlt-test/nacos-provider:1.0-SNAPSHOT
到了这里,关于dubbo启动指定ip不使用docker虚拟网络ip的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!