# redis实现分布式锁 **Repository Path**: yun_quan_admin/wig-demo ## Basic Information - **Project Name**: redis实现分布式锁 - **Description**: redis实现的分布式锁的案例 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 5 - **Created**: 2021-04-13 - **Last Updated**: 2021-04-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 戴着假发的程序员-分布式锁 #### 介绍 使用redis实现的分布式案例。 具体的锁工具类在:com.st.lock.util.RedisLock类中。 #### 项目结构说明 ![输入图片说明](https://images.gitee.com/uploads/images/2020/1210/171805_2c9a7a77_1964272.png "屏幕截图.png") #### 安装教程 1. 创建数据库 2. 创建数据表 ```sql SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for lock_test -- ---------------------------- DROP TABLE IF EXISTS `lock_test`; CREATE TABLE `lock_test` ( `num` bigint(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of lock_test -- ---------------------------- INSERT INTO `lock_test` VALUES ('0'); ``` 3. 配置nginx反向代理 ```tex upstream locktest{ server 127.0.0.1:9090; server 127.0.0.1:9091; server 127.0.0.1:9092; } server{ listen 888; server_name localhost; location / { proxy_pass http://locktest; index index.html index.htm; } } ``` #### 使用说明 1. 安装jmeter 2. 测试