原创 搭建heartbeat高可用

1:準備階段兩臺服務器一主一從我這裏採用了yum的方式進行安裝,如想使用rpm安裝,請自行下載rpm包安裝epel拓展源國外的速度是在是太慢,我這裏選擇了阿里的拓展源,PS  感謝馬雲。[root@tudou ~]# rm -rf /etc

原创 ConcurrentHashMap putIfAbsent和的put區別

putIfAbsent:        當key不存在的時候調用put方法將key存入進map        當key存在的時候相當於return map.get(key)  public static void main(String[]