Norbert框架
Upcoming SlideShare
Loading in...5
×
 

Norbert框架

on

  • 1,472 views

 

Statistics

Views

Total Views
1,472
Views on SlideShare
1,469
Embed Views
3

Actions

Likes
3
Downloads
19
Comments
0

1 Embed 3

http://johnnychenjun.blog.163.com 3

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Norbert框架 Norbert框架 Presentation Transcript

  • Norbert 框架介绍 搭建分布式服务 陈峻 [email_address]
  • What is norbert ?
    • Norbert is a library that provides easy cluster management and workload distribution. With Norbert, you can quickly distribute a simple client/server architecture to create a highly scalable architecture capable of handling heavy traffic.
  • Norbert Features
    • Cluster management
    • 通过 zookeeper
    • Software load balance
    • 需要自己实现 ConsistentHashLoadBalancer
    • Asynchronies client/server RPC
    • 包装了 netty nio 的 server
  • What we need ?
    • Scalable
    • High performance
    • Fault tolarance
    • 应用:
    • 新鲜事分发,查询
    • 搜索的更新,查询服务
  • Compare
    • Hessian
    • 成熟,二进制流, http ,上层 nginx 负载
    • Thrift
    • 异构 rpc 多语言支持, socket ,自己实现集群管理,负载均衡
    • Norbert
    • Nio/socket ,已集成 zookeeper 管理 / 负载均衡, protobuf 序列化 效率测试: 1000thread 以下,效率差异不大;在 1000thread 以上 hessian 依赖 resin 连接数抛出异常。 Norbert 正常。
  • Norbert 框架图
  • Norbert 框架使用 -Server
    • 开发步骤:
    • 1. 初始化 networkServerConfig
    • 2. 初始化一个 NetworkServer
    • 3. Zookeeper 里添加一个 node
    • 4. 注册处理的 handler ,消息
    • 5. 绑定一个 node
  • Norbert 框架使用 -Client
    • 初始化 NetworkClientConfig
    • 通过 config 和 LoadBalancerFactory 初始化 NettyNetworkClient
    • Client 注册消息的请求
    • 发送消息请求
    • 获取异步的 response
  • Protobuf 数据消息生成
    • 定义消息的数据字段 .proto
    • 生成 java 的代码:
    • protoc --proto_path=src --java_out=build/gen src/foo.proto
    • Referrence : http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/java-generated.html
  • Q & A
    • https:// github.com/rhavyn/norbert