首页 > 其他分享 >dubbo

dubbo

时间:2023-01-17 17:37:14浏览次数:38  
标签:dubbo 16 35 192.168 provider root

参考说明
https://promotion.aliyun.com/ntms/act/edasdubbo.html?utm_content=se_1005011324              #阿里云微服务
https://help.aliyun.com/document_detail/99299.html?spm=5176.261987.1367952.1.6f112f4doomrxR #阿里云dubbo简介




dubbo群集安装

1.安装zookeeper.参考地址:https://www.cnblogs.com/Yuanbangchen/p/17056168.html

2:生产者示例:(两台dubbo-provider)
[root@localhost7h local]# tar xvf dubbo-demo-provider-2.1.5-assembly.tar.gz  
[root@localhost7h local]# cd dubbo-demo-provider-2.1.5/

[root@localhost7h dubbo-demo-provider-2.1.5]# cat  conf/dubbo.properties
dubbo.container=log4j,spring
dubbo.application.name=demo-provider
dubbo.application.owner=
#dubbo.registry.address=multicast://224.5.6.7:1234
dubbo.registry.address=zookeeper://192.168.80.170:2181 | zookeeper://192.168.80.180:2181 | zookeeper://192.168.80.190:2181 #zk 集群配置
#dubbo.registry.address=zookeeper://127.0.0.1:2181  #单 zk 节点配置
#dubbo.registry.address=redis://127.0.0.1:6379
#dubbo.registry.address=dubbo://127.0.0.1:9090
dubbo.monitor.protocol=registry
dubbo.protocol.name=dubbo   
dubbo.protocol.port=20880  #端口
dubbo.log4j.file=logs/dubbo-demo-provider.log
dubbo.log4j.level=WARN


#启动 provider
 [root@localhost7h local]#./bin/start.sh 
Starting the demo-provider ....


[root@localhost7h tomcat]# netstat -antlp | grep 20880
tcp        0      0 0.0.0.0:20880           0.0.0.0:*               LISTEN      41046/java   

验证 provider 日志:(两台dubbo-provider)
[root@localhost7I kafka]# tail -f  dubbo-demo-provider-2.1.5/logs/stdout.log 
[16:35:03] Hello world2175, request from consumer: /192.168.80.190:34306
[16:35:07] Hello world2177, request from consumer: /192.168.80.190:34306
[16:35:11] Hello world2179, request from consumer: /192.168.80.190:34306
[16:35:15] Hello world2181, request from consumer: /192.168.80.190:34306
[16:35:20] Hello world2183, request from consumer: /192.168.80.190:34306
[16:35:24] Hello world2185, request from consumer: /192.168.80.190:34306




3:消费者示例:
[root@localhost7J local]# tar xvf dubbo-demo-consumer-2.1.5-assembly.tar.gz 
[root@localhost7J local]# cd dubbo-demo-consumer-2.1.5/

[root@localhost7J dubbo-demo-consumer-2.1.5]# cat  conf/dubbo.properties 
dubbo.container=log4j,spring
dubbo.application.name=demo-consumer
dubbo.application.owner=
#dubbo.registry.address=multicast://224.5.6.7:1234
dubbo.registry.address=zookeeper://192.168.80.170:2181 | zookeeper://192.168.80.180:2181 | zookeeper://192.168.80.190:2181
#dubbo.registry.address=zookeeper://127.0.0.1:2181
#dubbo.registry.address=redis://127.0.0.1:6379
#dubbo.registry.address=dubbo://127.0.0.1:9090
dubbo.monitor.protocol=registry
dubbo.log4j.file=logs/dubbo-demo-consumer.log
dubbo.log4j.level=WARN



#启动consumer
[root@localhost7J local]# ./bin/start.sh 
Starting the demo-consumer ....OK!
PID: 25137
STDOUT: logs/stdout.log

验证 consumer 日志:
[root@localhost7J logs]# tail -f stdout.log 
[16:35:03] Hello world2175, response form provider: 192.168.80.180:20880
[16:35:05] Hello world2176, response form provider: 192.168.80.170:20880
[16:35:07] Hello world2177, response form provider: 192.168.80.180:20880
[16:35:09] Hello world2178, response form provider: 192.168.80.170:20880
[16:35:11] Hello world2179, response form provider: 192.168.80.180:20880
[16:35:13] Hello world2180, response form provider: 192.168.80.170:20880
[16:35:15] Hello world2181, response form provider: 192.168.80.180:20880
[16:35:18] Hello world2182, response form provider: 192.168.80.170:20880
[16:35:20] Hello world2183, response form provider: 192.168.80.180:20880


4.zoolnspector工具验证
5.部署dubbo admin管理工具:基于zookeeper发现并管理 provider和 consumer。
5.1安装tomcat
[root@localhost7h local]# tar xvf apache-tomcat-8.5.69.tar.gz
[root@localhost7h local]# ln -sv apache-tomcat-8.5.69 tomcat  
[root@localhost7h local]# cd tomcat/webapps/

5.2解压项目
[root@localhost7h webapps]# unzip  dubboadmin.war 
[root@localhost7h webapps]# ls
docs  dubboadmin  examples  host-manager  manager  ROOT

5.3修改项目配置文件
[root@localhost7h webapps]# cat  dubboadmin/WEB-INF/dubbo.properties 
#dubbo.registry.address=zookeeper://192.168.80.170:2181 | zookeeper://192.168.80.180:2181 | zookeeper://192.168.80.190:2181
dubbo.registry.address=zookeeper://192.168.80.170:2181 
dubbo.admin.root.password=root
dubbo.admin.guest.password=guest

5.4 验证 dubbo admin 界面:
http://192.168.80.170:8080/dubboadmin

 

 

 

 

 

 


 

 

 

标签:dubbo,16,35,192.168,provider,root
From: https://www.cnblogs.com/Yuanbangchen/p/17058357.html

相关文章