使用ZooKeeper實現(xiàn)Java跨JVM的分布式鎖優(yōu)化思路是什么

使用ZooKeeper實現(xiàn)Java跨JVM的分布式鎖優(yōu)化思路是什么,針對這個問題,這篇文章詳細介紹了相對應的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。

創(chuàng)新互聯(lián)主要從事成都網(wǎng)站制作、做網(wǎng)站、網(wǎng)頁設計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務。立足成都服務高邑,十多年網(wǎng)站建設經(jīng)驗,價格優(yōu)惠、服務專業(yè),歡迎來電咨詢建站服務:18982081108

問題:我們都知道在單個JVM內(nèi)部實現(xiàn)鎖的機制很方便,Java也提供了很豐富的API可以實現(xiàn),例如Synchronized關(guān)鍵字, ReentrantLock等等,但是在集群環(huán)境中,都是多個JVM協(xié)同工作,當需要一些全局鎖時就要用到上面介紹的分布式鎖了,但是這種鎖的缺點在于每次客戶端(這里說的客戶端可以理解為不同JVM當中的線程)需要獲取鎖時都需要與zook服務端交互,創(chuàng)建znode,等待著自己獲取鎖,這種網(wǎng)絡通信無疑會給服務器帶來一定的壓力,那么我們有沒有什么辦法來減少這種壓力呢?

場景:有一種很常見的場景就是更新緩存,那么我們一般的處理邏輯如下。

1、 首選根據(jù)key獲取資源,如果資源存在,用之。

2、如果不存在,則申請獲取鎖(使用共享鎖)。

3、獲取到鎖以后,再次判斷資源是否存在(防止重復更新),如果存在說明已經(jīng)有人更新了,方法退出,否則更新緩存。

4、釋放鎖。

假設現(xiàn)在有10(1-10)個線程同時執(zhí)行上訴邏輯,如果資源不存在,那么它們?nèi)繒?zhí)行第(2)步獲取鎖,在同一時刻,只會有1個線程獲取鎖,其它9個線程阻塞,等待獲取鎖。現(xiàn)在我們假設線程1獲取到鎖,開始執(zhí)行(3-4)步動作,在第(3步)當中,再次判斷資源是否存在,(肯定不存在因為它是第一個進去的),所以它負責加載資源放入緩存,然后釋放鎖, 再說其它線程(2-10)它們依次獲取到鎖,然后執(zhí)行(3,4)動作,再次判斷資源是否存在(已經(jīng)存在了,因為1號線程已經(jīng)放進去了),所以他們直接退出,釋放鎖。由此可見只有1號線程獲取鎖是有意義的,但是它們都需要與zook進行網(wǎng)絡通訊,因此會給網(wǎng)絡帶來壓力。

如果說我們有A,B 二臺服務器進行集群,這10個線程獲取鎖的請求分別來自這2臺服務器,例如(1-5)號線程來自A服務器, (6-10)號線程來自B服務器,那么它們與zk交互了10次,創(chuàng)建10個znode來申請鎖,但是如果我們進行一定的優(yōu)化,它們只要與zk交互2次就夠了,我們來把上面的邏輯改造一下。

1、 首選根據(jù)key獲取資源,如果資源存在,用之。

2、如果不存在,則申請獲取鎖(JVM進程內(nèi)的鎖)。

3、獲取到鎖(JVM進程內(nèi)的鎖),再次判斷資源是否存在,如果資源存在就退出,沒啥好所的。

4、如果資源不存在,則申請獲取鎖(分布式鎖)。

5、獲取到鎖(分布式鎖)再次判斷資源是否存在(防止重復更新),如果存在說明已經(jīng)有人更新了,方法退出,否則更新緩存。

6、釋放分布式鎖,釋放JVM進程內(nèi)的鎖。

代碼:我把實現(xiàn)邏輯都放在一起了,方便給大家演示,如果有邏輯錯誤歡迎大家留言指正。

package com.framework.code.demo.zook;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;

import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.recipes.locks.InterProcessMutex;
import org.apache.curator.retry.ExponentialBackoffRetry;

import com.framework.code.demo.zook.lock.NoFairLockDriver;

public class Main {
	
	//我們用一個static的map模擬一個第三方獨立緩存
	public static Map<String, Object> redis = new HashMap<String, Object>();
	public static final String key = "redisKey";
	
	public static void main(String[] args) throws InterruptedException {
		//創(chuàng)建倆個對象分別模擬2個進程
		RedisProcess processA = new RedisProcess();
		RedisProcess processB = new RedisProcess();
		
		//每個進程別分用50個線程并發(fā)請求
		ExecutorService service = Executors.newFixedThreadPool(100);
		for (int i = 0; i < 50; i++) {
			service.execute(processA);
			service.execute(processB);
		}
		
		service.shutdown();
		service.awaitTermination(30, TimeUnit.SECONDS);
	}
	
	public static class RedisProcess implements Runnable {
		CuratorFramework client;
		//ZK分布式鎖
		InterProcessMutex distributedLock;
		//JVM內(nèi)部鎖
		ReentrantLock jvmLock;
		
		public RedisProcess() {
			client = CuratorFrameworkFactory.newClient("192.168.1.18:2181", 
					new ExponentialBackoffRetry(1000,3));
			client.start();
			distributedLock = new InterProcessMutex(client,"/mylock", new NoFairLockDriver());
			jvmLock = new ReentrantLock();
		}

		@Override
		public void run() {
			//(1)首先判斷緩存內(nèi)資源是否存在
			if(redis.get(key) == null) {
				try {
					
					//這里延時1000毫秒的目的是防止線程過快的更新資源,那么其它線程在步驟(1)處就返回true了.
					Thread.sleep(1000);
					
					//獲取JVM鎖(同一進程內(nèi)有效)
					jvmLock.lock();
					
					//(2)再次判斷資源是否已經(jīng)存在
					if(redis.get(key) == null) {
						System.out.println("線程:" + Thread.currentThread() + "獲取到JVM鎖,redis.get(key)為空, 準備獲取ZK鎖");
						
						//這里延時500毫秒的目的是防止線程過快更新資源,其它線程在步驟(2)就返回true了。
						Thread.sleep(500);
						try {
							//獲取zk分布式鎖
							distributedLock.acquire();
							System.out.println("線程:" + Thread.currentThread() + "獲取到JVM鎖,redis.get(key)為空, 獲取到了ZK鎖");

							//再次判斷,如果為空這時可以更新資源
							if(redis.get(key) == null) {
								redis.put(key, Thread.currentThread() + "更新了緩存");
								System.out.println("線程:" + Thread.currentThread() + "更新了緩存");
							} else {
								System.out.println("線程:" + Thread.currentThread() + "當前資源已經(jīng)存在,不需要更新");
							}
						} catch (Exception e) {
							e.printStackTrace();
						} finally {
							//釋放ZK鎖
							try {
								distributedLock.release();
							} catch (Exception e) {
								e.printStackTrace();
							}
						}
					} else {
						System.out.println("線程:" + Thread.currentThread() + "獲取到JVM鎖,redis.get(key)不為空," + redis.get(key));
					}
				} catch (InterruptedException e) {
					e.printStackTrace();
				} finally {
					//釋放JVM鎖
					jvmLock.unlock();
				}
			} else {
				System.out.println(redis.get(key));
			}
		}
	}

}



線程:Thread[pool-5-thread-2,5,main]獲取到JVM鎖,redis.get(key)為空, 準備獲取ZK鎖
線程:Thread[pool-5-thread-3,5,main]獲取到JVM鎖,redis.get(key)為空, 準備獲取ZK鎖
線程:Thread[pool-5-thread-3,5,main]獲取到JVM鎖,redis.get(key)為空, 獲取到了ZK鎖
線程:Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-7,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-1,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-5,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-9,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-23,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-19,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-11,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-31,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-35,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-15,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-27,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-25,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-33,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-37,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-13,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-17,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-2,5,main]獲取到JVM鎖,redis.get(key)為空, 獲取到了ZK鎖
線程:Thread[pool-5-thread-2,5,main]當前資源已經(jīng)存在,不需要更新
線程:Thread[pool-5-thread-21,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-29,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-55,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-59,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-41,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-67,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-39,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-43,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-57,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-47,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-51,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-63,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-8,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-69,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-4,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-6,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-10,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-22,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-16,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-20,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-45,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-24,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-32,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-36,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-49,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-28,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-12,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-14,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-26,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-53,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-18,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-61,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-30,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-65,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-34,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-97,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-40,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-91,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-64,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-42,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-46,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-50,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-87,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-85,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-44,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-75,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-48,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-71,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-77,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-52,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-99,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-93,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-56,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-60,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-95,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-89,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-81,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-73,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-68,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-58,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-62,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-66,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-38,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-54,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-94,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-83,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-96,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-79,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-92,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-90,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-80,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-82,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-72,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-78,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-100,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-70,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-88,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-84,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-98,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-86,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-76,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存
線程:Thread[pool-5-thread-74,5,main]獲取到JVM鎖,redis.get(key)不為空,Thread[pool-5-thread-3,5,main]更新了緩存

我們通過觀察日志,發(fā)現(xiàn)只有2個次需要獲取分布式鎖,其它的都被JVM鎖給阻擋在外面了,在這種情況下可以大大的提高鎖的性能。

關(guān)于 使用ZooKeeper實現(xiàn)Java跨JVM的分布式鎖優(yōu)化思路是什么問題的解答就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道了解更多相關(guān)知識。

本文標題:使用ZooKeeper實現(xiàn)Java跨JVM的分布式鎖優(yōu)化思路是什么
網(wǎng)頁路徑:http://muchs.cn/article8/gcesip.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供營銷型網(wǎng)站建設、企業(yè)網(wǎng)站制作、企業(yè)建站、ChatGPT、搜索引擎優(yōu)化網(wǎng)站設計

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站建設