对传统项目架构进行拆分:


集群概念:


面向服务分布式架构:

服务层提供被注册的对象需要实现序列化接口Serializable;


配置表现层和服务层:

  依赖包:

  服务层:

 <!-- 定义dubbo服务名称,此名称可以自定义,用于监控中心监控服务关系 -->
<dubbo:application name="content-service" />
<!-- 使用dubbo通过Zookeeper协议注册服务 -->
<dubbo:registry protocol="zookeeper" address="192.168.74.132:2181" />
<!-- 用dubbo协议在20880端口暴露服务 -->
<dubbo:protocol name="dubbo" port="20881" />
<!-- 声明需要暴露的服务接口 -->
<!-- 创建需要发布对象 -->
<bean id="contentCategoryServiceImpl" class="cn.e3.content.service.impl.ContentCategoryServiceImpl"></bean>
<!-- 发布服务 -->
<dubbo:service interface="cn.e3.content.service.ContentCategoryService"
ref="contentCategoryServiceImpl" />
<!-- 发布内容对象 -->
<bean id="contentServiceImpl" class="cn.e3.content.service.impl.ContentServiceImpl"></bean>
<!-- 发布服务 -->
<dubbo:service interface="cn.e3.content.service.ContentService"
ref="contentServiceImpl" />

  表现层:

 <!-- 消费方应用名,用于计算依赖关系,不是匹配条件,不要与提供方一样 -->
<dubbo:application name="manager-web" />
<!-- 使用multicast广播注册中心暴露发现服务地址 -->
<dubbo:registry address="zookeeper://192.168.74.132:2181" />
<!-- 生成远程服务代理,可以和本地bean一样使用demoService -->
<dubbo:reference id="itemService"
interface="cn.e3.manager.service.ItemService" timeout="1000000" retries="2"/>
<!-- 商品类别服务 -->
<dubbo:reference id="itemCatService"
interface="cn.e3.manager.service.ItemCatService" timeout="1000000" retries="2"/>
<!-- 广告分类服务 -->
<dubbo:reference id="contentCategoryService"
interface="cn.e3.content.service.ContentCategoryService" timeout="1000000" retries="2"/>
<!-- 广告内容服务 -->
<dubbo:reference id="contentService"
interface="cn.e3.content.service.ContentService" timeout="1000000" retries="2"/>
<!-- 规格模板服务 -->
<dubbo:reference id="itemParamService"
interface="cn.e3.manager.service.ItemParamService" timeout="1000000" retries="2"/>
<dubbo:reference id="searchItemService"
interface="cn.e3.search.service.SearchItemService" timeout="1000000" retries="2"/>

安装zookeeper注册中心服务器:cd zookeeper/conf,mv zoo_sample.cfg zoo.cfg

配置:vim zoo.cfg

cd ./data ; vi myid (内容为各个节点server后的数字)

启动和登录:

查看节点状态:./zkServer.sh status 同时检测zookeeper是否启动成功

日志查看:cat ./zookeeper.out

查看启动:jps

查看节点信息:ls /      ls /dubbo     ls /zookeeper


Monitor 监控中心,dubbo-admin-2.5.4.war部署在linux上的tomcat即可;

访问:ip:8080/dubbo/
root root


总结:

dubbo服务治理中间件,zookeeper注册中心 安装配置的更多相关文章

  1. dubbo服务治理中间件,zookeeper注册中心

    对传统项目架构进行拆分: 集群概念: 面向服务分布式架构: 服务层提供被注册的对象需要实现序列化接口Serializable: 配置表现层和服务层: 依赖包: 服务层: <!-- 定义dubbo ...

  2. Dubbo_创建Dubbo服务并在ZooKeeper注册,然后通过Jar包执行

    一.安装ZooKeeper(略) 二.创建Dubbo服务  1.DemoService 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ...

  3. ZooKeeper注册中心安装详细步骤(单节点)

    安装 Dubbo 注册中心 Dubbo 建议使用 Zookeeper 作为服务的注册中心. 注册中心服务器(192.168.3.71)配置,安装 Zookeeper: 1. 修改操作系统的/etc/h ...

  4. @ZooKeeper注册中心安装(单节点)

    1.下载zookeeper 下载地址:https://archive.apache.org/dist/zookeeper/,这里我们使用3.4.6版本. [winner-0715@localhost ...

  5. zookeeper注册中心安装(单机版)

    下载zookeeper-3.4.9.tar.gz wget http://apache.fayea.com/zookeeper/zookeeper-3.4.9/zookeeper-3.4.9.tar. ...

  6. 使用dubbo中间件的zookeeper注册中心时报错

    在项目中搭建soa项目时,使用dubbo服务中间件时需要在虚拟机中创建一个zookeeper注册中心,在配置都没有问题的时候,如果服务端启动成功,但是消费端启动报错并且看不出据地位置时,一定要注意你的 ...

  7. dubbo实战之三:使用Zookeeper注册中心

    欢迎访问我的GitHub https://github.com/zq2599/blog_demos 内容:所有原创文章分类汇总及配套源码,涉及Java.Docker.Kubernetes.DevOPS ...

  8. Dubbo框架应用之(三)--Zookeeper注册中心、管理控制台的安装及讲解

    我是在linux下使用dubbo-2.3.3以上版本的zookeeper注册中心客户端.Zookeeper是Apache Hadoop的子项目,强度相对较好,建议生产环境使用该注册中心.Dubbo未对 ...

  9. Dubbo(二):zookeeper 注册中心

    zookeeper 注册中心 Zookeeper 是 Apacahe Hadoop 的子项目,是一个树型的目录服务,支持变更推送,适合作为 Dubbo 服务的注册中心,工业强度较高,可用于生产环境,并 ...

随机推荐

  1. ORACLE GoldenGate在Windows与AIX平台ORACLE的单向、双向数据传输配置及其测试

    第1章...... GoldenGate概述 1.1         GoldenGate技术原理 1.2         GoldenGate可靠的复制 1.3         GoldenGate ...

  2. C#获取视频文件播放长度

    下面两种方法只支持部分视频格式,一般格式mp3,wma等等支持 1.使用Shell32 添加引用,选择COM中的Microsoft Shell Controls And Automation引用 // ...

  3. get与post两种方式的优缺点

    get: get是从服务器上获取数据,post是向服务器传送数据: get传送的数据量较小,不能大于2KB.post传送的数据量较大,一般被默认为不受限制.但理论上,IIS4中最大量为80KB,IIS ...

  4. python's twenty-seventh day for me 模

    time模块: 1,计算执行代码的时间 time.time() 2,让程序停这里一段时间 time.sleep(时间(s)) 时间戳时间: import time print(time.time()) ...

  5. C#读写EXCEL(二)

    C#读写EXCEL(二) -- ::| 分类: 默认分类 | 标签: |举报 |字号大 中 小 订阅 用微信 “扫一扫” 将文章分享到朋友圈. 用易信 “扫一扫” 将文章分享到朋友圈. 下载LOFTE ...

  6. java中链表的数据(对象)位置交换

    用LinkedList类的set方法把引用 对象换了就行 ,如 import java.util.LinkedList; public class Tffdsafsdafsad { public st ...

  7. Android selector中的item的顺序

    在selector中,要将默认状态的item放在最后面,因为一旦前面的item满足匹配条件,后面的item就不会去匹配.因此,把默认状态的item放在前面的话,后面的item没有执行的机会

  8. 501. Find Mode in Binary Search Tree查找BST中的众数

    [抄题]: Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently oc ...

  9. shell动态替换变量

    可以对env指定U 或者 L,  得到U或者L下的IP地址列表, env可作为shell的参数列表传入 env=UL_ips=(x.x.x.x  y.y.y.y)U_ips=(w.w.w.w  z.z ...

  10. blockchain notes

    1. IBM blockchain platform https://www.ibm.com/blockchain/platform/ 2. 开源项目hyperledger https://hyper ...