# Java-study3-seckilling **Repository Path**: weiranyi/java-study3-seckilling ## Basic Information - **Project Name**: Java-study3-seckilling - **Description**: 主要围绕高并发下分布式锁问题展开: 1.练习Jedis连接redis 2.通过Redisson解决分布式锁的问题 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-10-02 - **Last Updated**: 2022-10-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 高并发下的分布式锁 - 分布式锁的方案有很多 - zookeeper方式实现:高可靠性 - redis方式实现:高性能(目前分布式锁应用最多的是redis) - Redisson ```java // Redis 其实并没有对 Java 提供原生支持 // Redisson 就是用于在 Java 程序中操作 Redis 的库,它使得我们可以在程序中轻松地使用Redis // Redisson 在 java.util 中常用接口的基础上,为我们提供了一系列具有分布式特性的工具类 ``` # Nginx配置 ```bash upstream sga{ server 192.168.182.1:8080; server 192.168.182.1:8081; } server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_pass http://sga; root html; index index.html index.htm; } ``` - 启动 ```bash /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf ``` # JedisPool ```bash commons-pool commons-pool 1.6 ``` # Jedis - Jedis是Redis官方推荐的Java连接开发工具 ```bash redis.clients jedis 3.2.0 ```