查看Nginx 源码,将Nginx IP选择算法变为Java: package com.csst.msm; public class Test { /** * @param args */ public static void main(String[] args) { int hash =89;//初始值 int serverNum =2;//服务器个数 int addrlen=3;//IPV4 只计算前3个字节 int p; int[] addr = new int[]{192,168,10