Giter Site home page Giter Site logo

paxos-1's Introduction

paxos算法实现

author: 赵振佐,黄群
程序运行实例如下:
1.启动com.paxos.AppStart
假设结点有三个,分别为:192.168.0.100:10051,192.168.0.100:10052,192.168.0.100:10053

三个结点启动需要传入jvm参数,

结点1(192.168.0.100:10051)启动jvm配置:
-Dip=192.168.0.100 //当前结点ip
-Dport=10051 //当前结点port
-Dnodes=192.168.0.100:10051,192.168.0.100:10052,192.168.0.100:10053 //结点集合
-Dserver.port=8081 //web端口

结点2(192.168.0.100:10052)启动jvm配置:
-Dip=192.168.0.100 //当前结点ip
-Dport=10051 //当前结点port
-Dnodes=192.168.0.100:10051,192.168.0.100:10052,192.168.0.100:10053 //结点集合
-Dserver.port=8082 //web端口

结点3(192.168.0.100:10051)启动jvm配置:
-Dip=192.168.0.100 //当前结点ip
-Dport=10053 //当前结点port
-Dnodes=192.168.0.100:10051,192.168.0.100:10052,192.168.0.100:10053 //结点集合
-Dserver.port=8083 //web端口

2.三个结点启动后会选举出一个leader,可从管理界面查看
管理界面地址:
http://localhost:8081/getLeaderMember,
http://localhost:8082/getLeaderMember,
http://localhost:8083/getLeaderMember
分别对应上述例子三个结点的管理页

paxos-1's People

Contributors

zhaozhenzuo avatar

Watchers

James Cloos avatar Duke avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.