@@ -0,0 +1,836 @@
+package org.loadbalance;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * @author shijingui on 2018/1/6%0A */%0Apublic class HashLoadBalance %7B%0A%0A%0A    static List%3CString%3E serverIpList = new ArrayList%3C%3E();%0A%0A    static %7B%0A        serverIpList.add(%22192.168.1.100%22);%0A        serverIpList.add(%22192.168.1.101%22);%0A        serverIpList.add(%22192.168.1.102%22);%0A        serverIpList.add(%22192.168.1.103%22);%0A        serverIpList.add(%22192.168.1.104%22);%0A%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        String remoteIp = %22abc.com%22;%0A%0A        for (int i = 0; i %3C 100; i++) %7B%0A            System.out.println(getIp(remoteIp));%0A        %7D%0A%0A    %7D%0A%0A%0A    static String getIp(String remoteIp) %7B%0A%0A        int hashCode = %22dfafd%22.hashCode();%0A        int serverPost = hashCode %25 serverIpList.size();%0A        return serverIpList.get(serverPost);%0A    %7D%0A%0A%7D%0A

add hash load balance