Git Product home page Git Product logo

distributed-lock-examples's Introduction

distributed-lock-examples

史上最全的分布式锁合辑(我们不造轮子,只需用好轮子!)

distributed-lock-examples
├── README.md
├── Screenshots
│   ├── hazelcast_management_center.png
│   ├── hazelcast_management_center_idgenerator.png
│   └── hazelcast_management_center_map.png
├── distributed-consul-lock-example
│   ├── distributed-consul-lock-example.iml
│   ├── pom.xml
│   └── src
│       └── main
│           ├── java
│           │   └── net
│           │       └── ameizi
│           │           └── distributed
│           │               └── consul
│           │                   └── example
│           │                       └── DistributedConsulLockExampleApplication.java
│           └── resources
│               └── application.properties
├── distributed-hazelcast-lock-example
│   ├── README.md
│   ├── distributed-hazelcast-lock-example.iml
│   ├── docker-compose.yaml
│   ├── hazelcast.xml
│   ├── pom.xml
│   └── src
│       ├── main
│       │   ├── java
│       │   │   └── net
│       │   │       └── ameizi
│       │   │           └── distributed
│       │   │               └── hazelcast
│       │   │                   └── example
│       │   │                       ├── DistributedHazelcastLockExampleApplication.java
│       │   │                       ├── LockController.java
│       │   │                       └── config
│       │   │                           └── HazelcastConfiguration.java
│       │   └── resources
│       │       └── application.properties
│       └── test
│           ├── java
│           │   └── net
│           │       └── ameizi
│           │           └── distributed
│           │               └── hazelcast
│           │                   └── example
│           │                       ├── FlakeIdGeneratorSample.java
│           │                       └── HazelcastClientTest.java
│           └── resources
├── distributed-redis-lock-example
│   ├── distributed-redis-lock-example.iml
│   ├── pom.xml
│   └── src
│       └── main
│           ├── java
│           │   └── net
│           │       └── ameizi
│           │           └── distributed
│           │               └── lock
│           │                   └── redis
│           │                       └── example
│           │                           └── DistributedRedisLockExampleApplication.java
│           └── resources
│               ├── application.properties
│               ├── redisson-cluster.yaml
│               ├── redisson-master-slave.yaml
│               ├── redisson-sentinel.yaml
│               └── redisson-single.yaml
├── distributed-zookeeper-lock-example
│   ├── distributed-zookeeper-lock-example.iml
│   ├── pom.xml
│   └── src
│       ├── main
│       │   ├── java
│       │   │   └── net
│       │   │       └── ameizi
│       │   │           └── distributed
│       │   │               └── lock
│       │   │                   └── zookeeper
│       │   │                       └── example
│       │   │                           ├── DistributedZookeeperLockExampleApplication.java
│       │   │                           └── config
│       │   │                               ├── ZookeeperConfig.java
│       │   │                               └── ZookeeperProperties.java
│       │   └── resources
│       │       ├── META-INF
│       │       └── application.properties
│       └── test
│           ├── java
│           │   └── net
│           │       └── ameizi
│           │           └── distributed
│           │               └── lock
│           │                   └── zookeeper
│           │                       └── example
│           │                           ├── BlockingLockTest.java
│           │                           ├── DistributedLockTest.java
│           │                           └── NonBlockingLockTest.java
│           └── resources
├── pom.xml
└── spring-integration-distributed-lock-examples
    ├── pom.xml
    ├── spring-integration-distributed-lock-examples.iml
    └── src
        └── main
            ├── java
            │   └── spring
            │       └── integration
            │           └── distributed
            │               └── lock
            │                   └── examples
            │                       ├── DistributedLockRegistryApplication.java
            │                       └── config
            │                           ├── JdbcConfiguration.java
            │                           ├── RedisLockConfiguration.java
            │                           └── ZookeeperLockConfiguration.java
            └── resources
                └── application.properties

注:为学习实验方便,示例代码中的zookeeper、redis、jdbc、hazelcast均使用本地嵌入式,实际应用应使用独立部署的服务。

  • distributed-hazelcast-lock-example(hazelcast实现分布式锁及分布式id)

修改docker-compose.yamlhazelcast.xml中宿主机的IP 地址后执行docker-compose up -d即可启动一个三个节点的hazelcast集群。

浏览地址栏访问http://localhost:8080/hazelcast-mancenter可访问hazelcast的控制台

三台子节点信息

分布式 id

map

  • distributed-redis-lock-example(redis 实现分布式锁)

  • distributed-zookeeper-lock-example(zookeeper 实现分布式锁)

  • spring-integration-distributed-lock-examples(spring-integration 实现分布式锁) 分别使用ZookeeperLockRegistry、RedisLockRegistry、JdbcLockRegistry实现分布式锁

distributed-lock-examples's People

Contributors

v5tech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.