@Slf4j
@Service
public class ClusterCommondService {
@Value("${cluster.pemPrivateKey}")
protected String pemPrivateKey;
@Value("${cluster.port}")
protected int port;
@Value("${cluster.user}")
protected String user;
//写在配置文件里的配置值
@Autowired
private ClusterIpUtil clusterIpUtil;
//连接的IP
private Session session = null;
private boolean bConnect = false;
//默认第一次是false,先建立连接
protected String ip;
private void initConnection() throws JSchException {
ip = clusterIpUtil.getClusterIp();
String begin = "-----BEGIN RSA PRIVATE KEY-----";
String end = "-----END RSA PRIVATE KEY-----";
String a = pemPrivateKey.replace(" ", "\n");
String privateKey &