1. 创建连接池
ConnectionPool.java
@Slf4j
public class ConnectionPool {
private String strictHostKeyChecking;
private Integer timeout;
/**
* ip地址
*/
private String ip = "";
/**
* 端口号
*/
private Integer port = 22;
/**
* 用户名
*/
private String username = "";
/**
* 密码
*/
private String password = "";
/**
* 每次扩容增加几个连接
*/
private int incrementalConnections = 2;
/**
* 最大连接数
*/
private int maxConnections = 10;
/**
* 最大空闲连接
*/
private int maxIdle = 4;