Documentation ¶
Index ¶
- Variables
- func AddLine(sshClient *SSHClient, context, confFile, logKey string, ...) bool
- func AppendMultiLine(sshClient *SSHClient, oldValue, newValue, file, logKey string, ...) bool
- func CD(sshClient *SSHClient, dir, logKey string, paasResult *result.ResultBean) bool
- func ChMod(sshClient *SSHClient, fileName, mod, logKey string, ...) bool
- func CheckBeforeDeploy(serv *proto.PaasService, etcdNodeArr []map[string]interface{}, logKey string, ...) bool
- func CheckInstanceDeployed(instId, logKey string, paasResult *result.ResultBean) bool
- func CheckInstanceNotDeployed(instId, logKey string, paasResult *result.ResultBean) bool
- func CheckPortDown(sshClient *SSHClient, cmpt, instId, port, logKey string, ...) bool
- func CheckPortUp(sshClient *SSHClient, cmpt, instId, port, logKey string, ...) bool
- func CheckPortUpPredeploy(sshClient *SSHClient, port, logKey string, paasResult *result.ResultBean) bool
- func CheckPortsUp(sshClient *SSHClient, cmpt, instId string, ports []string, logKey string, ...) bool
- func CheckPortsUpPredeploy(sshClient *SSHClient, ports []string, logKey string, ...) bool
- func ConnectSSH(sshClient *SSHClient, logKey string, paasResult *result.ResultBean) bool
- func CreateFile(sshClient *SSHClient, fileName, fileContent, logKey string, ...) bool
- func CreateShell(sshClient *SSHClient, fileName, shell, logKey string, ...) bool
- func DeployEtcdNode(etcdNode map[string]interface{}, ...) bool
- func DeployGrafana(grafana map[string]interface{}, version, logKey, magicKey string, ...) bool
- func DeployZookeeper(zk map[string]interface{}, idx int, ...) bool
- func Dos2Unix(sshClient *SSHClient, fileName, logKey string, paasResult *result.ResultBean) bool
- func ExecSimpleCmd(sshClient *SSHClient, cmd, logKey string, paasResult *result.ResultBean) bool
- func FetchAndExtractTgzDeployFile(sshClient *SSHClient, fileId int, subPath, version, logKey string, ...) bool
- func FetchAndExtractZipDeployFile(sshClient *SSHClient, fileId int, subPath, oldName, version, logKey string, ...) bool
- func FetchFile(sshClient *SSHClient, fileId int, logKey string, paasResult *result.ResultBean) bool
- func GetCmptById(servInstID, instID string, cmptID int, paasResult *result.ResultBean) *proto.PaasMetaCmpt
- func GetDeployFile(fileId int, logKey string, paasResult *result.ResultBean) *proto.PaasDeployFile
- func GetEtcdFullAddr(etcdNodeArr []map[string]interface{}) string
- func GetEtcdLongAddr(etcdNodeArr []map[string]interface{}) string
- func GetEtcdShortAddr(etcdNodeArr []map[string]interface{}) string
- func GetInstance(instID string, logKey string, paasResult *result.ResultBean) (*proto.PaasInstance, bool)
- func GetRealPort(item map[string]interface{}) string
- func GetRealPortAsInt(item map[string]interface{}) int
- func GetRedisClusterNode(sshClient *SSHClient, cmd, logKey string, paasResult *result.ResultBean) bool
- func GetService(instID string, logKey string, paasResult *result.ResultBean) (*proto.PaasService, bool)
- func GetServiceTopo(servInstID, logKey string, paasResult *result.ResultBean) bool
- func GetServiceVersion(servInstID, instID string) string
- func GetSpecifiedBrokerArr(vbrokerArr []map[string]interface{}, instID string) []map[string]interface{}
- func GetSpecifiedClickHouseItem(jsonArr []map[string]interface{}, instID string) (map[string]interface{}, string)
- func GetSpecifiedItem(jsonArr []map[string]interface{}, instID string) map[string]interface{}
- func GetSpecifiedRocketMQBroker(vbrokerArr []map[string]interface{}, instID string) map[string]interface{}
- func GetSpecifiedVBrokerId(vbrokerArr []map[string]interface{}, instID string) string
- func GetStoreId(sshClient *SSHClient, pdIp, pdClientPort, ip, port, logKey string, ...) (int, bool)
- func GetVersion(servInstId, containerInstId, instId string) string
- func GetVersionedFileName(fileId int, version, logKey string, paasResult *result.ResultBean) string
- func GetZKAddress(zkArr []map[string]interface{}) string
- func GetZKShortAddress(zkArr []map[string]interface{}) string
- func GetZkCluster(zkArr []map[string]interface{}) string
- func InitRedisCluster(sshClient *SSHClient, initCmd, logKey string, paasResult *result.ResultBean) bool
- func IsDirExistInCurrPath(sshClient *SSHClient, fileDir, logKey string, paasResult *result.ResultBean) (bool, error)
- func IsFileExist(sshClient *SSHClient, fileName string, isDir bool, logKey string, ...) bool
- func IsInstanceDeployed(logKey string, inst *proto.PaasInstance, paasResult *result.ResultBean) bool
- func IsInstanceNotDeployed(logKey string, inst *proto.PaasInstance, paasResult *result.ResultBean) bool
- func IsPreEmbadded(instId string) bool
- func IsProcExist(sshClient *SSHClient, identify, logKey string, paasResult *result.ResultBean) bool
- func IsSameSSH(instID, nextInstID string) bool
- func IsServiceDeployed(logKey string, service *proto.PaasService, paasResult *result.ResultBean) bool
- func IsServiceNotDeployed(logKey string, service *proto.PaasService, paasResult *result.ResultBean) bool
- func JoinRedisCluster(sshClient *SSHClient, cmdJoin, logKey string, paasResult *result.ResultBean) bool
- func LoadServTopo(servInstID, logKey string, checkFlag bool, paasResult *result.ResultBean) (map[string]interface{}, string, bool)
- func LoadServTopoForIncrDeploy(servInstID, instID, logKey string, checkFlag bool, ...) (map[string]interface{}, string, bool)
- func MV(sshClient *SSHClient, newName, oldName, logKey string, ...) bool
- func MkDir(sshClient *SSHClient, dir, logKey string, paasResult *result.ResultBean) bool
- func PWD(sshClient *SSHClient, logKey string, paasResult *result.ResultBean) (string, error)
- func PdctlDeleteTikvStore(sshClient *SSHClient, pdIp, pdPort string, id int, logKey string, ...) bool
- func PdctlGetStore(sshClient *SSHClient, ip, port, logKey string, paasResult *result.ResultBean) *proto.TikvStore
- func PostDeployLog(isOk bool, servInstID, logKey, flag string)
- func PostProc(servInstID, deployFlag, logKey, magicKey string, paasResult *result.ResultBean) bool
- func RM(sshClient *SSHClient, file, logKey string, paasResult *result.ResultBean) bool
- func RedisSlaveOf(sshClient *SSHClient, slaveCmd, logKey string, paasResult *result.ResultBean) bool
- func RemoveRedisNodeFromCluster(sshClient *SSHClient, ip, redisPort, selfId, logKey string, ...) bool
- func ResetDBPwd(tidb map[string]interface{}, logKey string, paasResult *result.ResultBean) bool
- func ReshardingRedisSlot(sshClient *SSHClient, cmdMig, logKey string, paasResult *result.ResultBean) bool
- func SED(sshClient *SSHClient, oldValue, newValue, file, logKey string, ...) bool
- func Shutdown(sshClient *SSHClient, ...) bool
- func Startup(sshClient *SSHClient, ...) bool
- func StartupPreEmbadded(sshClient *SSHClient, instId, cmptName, logKey, magicKey string, ...) bool
- func TAR(sshClient *SSHClient, tarParams, srcFileName, desFileName, logKey string, ...) bool
- func UnZip(sshClient *SSHClient, srcFileName, desFileName, logKey string, ...) bool
- func UndeployEtcdNode(etcdNode map[string]interface{}, logKey, magicKey string, ...) bool
- func UndeployGrafana(grafana map[string]interface{}, version, logKey, magicKey string, ...) bool
- func UndeployPrometheus(prometheus map[string]interface{}, version, logKey, magicKey string, ...) bool
- func UndeployZookeeper(zk map[string]interface{}, version, logKey, magicKey string, ...) bool
- type SSHClient
- func (h *SSHClient) CheckTaosNodeOffLine(cmd, node, logKey string, paasResult *result.ResultBean) bool
- func (h *SSHClient) CheckTaosNodeOnline(cmd, node, logKey string, paasResult *result.ResultBean) bool
- func (h *SSHClient) Close()
- func (h *SSHClient) Connect() bool
- func (h *SSHClient) CreateOrDropNode(cmd, logKey string, paasResult *result.ResultBean) bool
- func (h *SSHClient) Dos2Unix(cmd string) (string, error)
- func (h *SSHClient) ExecCmd(cmd string) ([]byte, error)
- func (h *SSHClient) ExecInteractCmd(cmd string) error
- func (h *SSHClient) GeneralCommand(cmd string) (string, error)
- func (h *SSHClient) InitRedisCluster(cmd string) ([]byte, bool, error)
- func (h *SSHClient) IsFileExist(fileName string, isDir bool) (bool, error)
- func (h *SSHClient) IsPortUsed(port string) (bool, error)
- func (h *SSHClient) IsProcExist(identify, logKey string) (bool, error)
- func (h *SSHClient) JoinRedisCluster(cmd string) ([]byte, bool, error)
- func (h *SSHClient) LoginTaosShell(cmd, logKey string, paasResult *result.ResultBean) bool
- func (h *SSHClient) MigrateRedisClusterSlot(cmd, logKey string, paasResult *result.ResultBean) bool
- func (h *SSHClient) ReadRedisDeleteNode() ([]byte, error)
- func (h *SSHClient) ReadRedisInitAccept() ([]byte, error)
- func (h *SSHClient) ReadRedisInitOkOrErr() ([]byte, error)
- func (h *SSHClient) ReadRedisJoinOkOrErr() ([]byte, bool, error)
- func (h *SSHClient) ReadRedisMigrateSlot() ([]byte, error)
- func (h *SSHClient) ReadRedisReshardingOkOrErr() ([]byte, bool, error)
- func (h *SSHClient) ReadRedisSlaveOfOkOrErr() ([]byte, bool, error)
- func (h *SSHClient) ReadScpOut() ([]byte, error)
- func (h *SSHClient) ReadTaosEnd() bool
- func (h *SSHClient) ReadTaosOK() bool
- func (h *SSHClient) ReadToEof() ([]byte, error)
- func (h *SSHClient) RedisSlaveOf(cmd string) ([]byte, bool, error)
- func (h *SSHClient) RemoveFromRedisCluster(cmd, logKey string, paasResult *result.ResultBean) bool
- func (h *SSHClient) ReshardingRedisSlot(cmd string) ([]byte, bool, error)
- func (h *SSHClient) SCP(user, passwd, srcHost, sshPort, srcFile, desFile, logKey string, ...) bool
- func (h *SSHClient) Tail(file string, lines int) (string, error)
- func (h *SSHClient) Wait()
Constants ¶
This section is empty.
Variables ¶
View Source
var ( YES_NO = []byte("(yes/no)? ") YES_NO_FINGERPRINT = []byte("(yes/no/[fingerprint])? ") PASSWD = []byte("password: ") PASSWD_UPPER = []byte("Password: ") SCP_PASSWD_WRONG = []byte("Permission denied, please try again.") FILE_DIR_NOT_EXISTS = []byte("No such file or directory") REDIS_CLUSTER_INIT_ACCEPT = []byte("(type 'yes' to accept): ") REDIS_CLUSTER_INIT_OK = []byte("[OK] All 16384 slots covered.") REDIS_CLUSTER_INIT_ERR = []byte("ERR") REDIS_MOVEING_SLOT = []byte("Moving slot") REDIS_CLUSTER_DELETE_NODE = []byte(">>> Sending CLUSTER RESET SOFT to the deleted node.") REDIS_ADD_NODE_OK = []byte("[OK] New node added correctly.") REDIS_SLAVEOF_OK = []byte("OK") TAOS_SHELL = []byte("taos> ") TAOS_OK = []byte("Query OK") TAOS_DNODE_READY = "ready" TAOS_DNODE_DROPPING = "dropping" )
Functions ¶
func AddLine ¶
func AddLine(sshClient *SSHClient, context, confFile, logKey string, paasResult *result.ResultBean) bool
func AppendMultiLine ¶
func AppendMultiLine(sshClient *SSHClient, oldValue, newValue, file, logKey string, paasResult *result.ResultBean) bool
func ChMod ¶
func ChMod(sshClient *SSHClient, fileName, mod, logKey string, paasResult *result.ResultBean) bool
func CheckBeforeDeploy ¶
func CheckBeforeDeploy(serv *proto.PaasService, etcdNodeArr []map[string]interface{}, logKey string, paasResult *result.ResultBean) bool
func CheckInstanceDeployed ¶
func CheckInstanceDeployed(instId, logKey string, paasResult *result.ResultBean) bool
func CheckInstanceNotDeployed ¶
func CheckInstanceNotDeployed(instId, logKey string, paasResult *result.ResultBean) bool
func CheckPortDown ¶
func CheckPortDown(sshClient *SSHClient, cmpt, instId, port, logKey string, paasResult *result.ResultBean) bool
func CheckPortUp ¶
func CheckPortUp(sshClient *SSHClient, cmpt, instId, port, logKey string, paasResult *result.ResultBean) bool
func CheckPortUpPredeploy ¶
func CheckPortUpPredeploy(sshClient *SSHClient, port, logKey string, paasResult *result.ResultBean) bool
func CheckPortsUp ¶
func CheckPortsUpPredeploy ¶
func ConnectSSH ¶
func ConnectSSH(sshClient *SSHClient, logKey string, paasResult *result.ResultBean) bool
func CreateFile ¶
func CreateFile(sshClient *SSHClient, fileName, fileContent, logKey string, paasResult *result.ResultBean) bool
func CreateShell ¶
func CreateShell(sshClient *SSHClient, fileName, shell, logKey string, paasResult *result.ResultBean) bool
func DeployEtcdNode ¶
func DeployEtcdNode(etcdNode map[string]interface{}, etcdFullAddr, etcdContainerInstId, logKey, magicKey string, paasResult *result.ResultBean) bool
func DeployGrafana ¶
func DeployGrafana(grafana map[string]interface{}, version, logKey, magicKey string, paasResult *result.ResultBean) bool
func DeployZookeeper ¶
func Dos2Unix ¶
func Dos2Unix(sshClient *SSHClient, fileName, logKey string, paasResult *result.ResultBean) bool
func ExecSimpleCmd ¶
func ExecSimpleCmd(sshClient *SSHClient, cmd, logKey string, paasResult *result.ResultBean) bool
func GetCmptById ¶
func GetCmptById(servInstID, instID string, cmptID int, paasResult *result.ResultBean) *proto.PaasMetaCmpt
func GetDeployFile ¶
func GetDeployFile(fileId int, logKey string, paasResult *result.ResultBean) *proto.PaasDeployFile
func GetEtcdFullAddr ¶
func GetEtcdLongAddr ¶
func GetEtcdShortAddr ¶
func GetInstance ¶
func GetInstance(instID string, logKey string, paasResult *result.ResultBean) (*proto.PaasInstance, bool)
func GetRealPort ¶
func GetRealPortAsInt ¶
func GetRedisClusterNode ¶
func GetRedisClusterNode(sshClient *SSHClient, cmd, logKey string, paasResult *result.ResultBean) bool
func GetService ¶
func GetService(instID string, logKey string, paasResult *result.ResultBean) (*proto.PaasService, bool)
func GetServiceTopo ¶
func GetServiceTopo(servInstID, logKey string, paasResult *result.ResultBean) bool
func GetServiceVersion ¶
func GetSpecifiedBrokerArr ¶
func GetSpecifiedItem ¶
func GetSpecifiedVBrokerId ¶
func GetStoreId ¶
func GetVersion ¶
func GetVersionedFileName ¶
func GetVersionedFileName(fileId int, version, logKey string, paasResult *result.ResultBean) string
func GetZKAddress ¶
func GetZKShortAddress ¶
func GetZkCluster ¶
func InitRedisCluster ¶
func InitRedisCluster(sshClient *SSHClient, initCmd, logKey string, paasResult *result.ResultBean) bool
func IsDirExistInCurrPath ¶
func IsFileExist ¶
func IsInstanceDeployed ¶
func IsInstanceDeployed(logKey string, inst *proto.PaasInstance, paasResult *result.ResultBean) bool
func IsInstanceNotDeployed ¶
func IsInstanceNotDeployed(logKey string, inst *proto.PaasInstance, paasResult *result.ResultBean) bool
func IsPreEmbadded ¶
func IsProcExist ¶
func IsProcExist(sshClient *SSHClient, identify, logKey string, paasResult *result.ResultBean) bool
func IsServiceDeployed ¶
func IsServiceDeployed(logKey string, service *proto.PaasService, paasResult *result.ResultBean) bool
func IsServiceNotDeployed ¶
func IsServiceNotDeployed(logKey string, service *proto.PaasService, paasResult *result.ResultBean) bool
func JoinRedisCluster ¶
func JoinRedisCluster(sshClient *SSHClient, cmdJoin, logKey string, paasResult *result.ResultBean) bool
func LoadServTopo ¶
func MV ¶
func MV(sshClient *SSHClient, newName, oldName, logKey string, paasResult *result.ResultBean) bool
func MkDir ¶
func MkDir(sshClient *SSHClient, dir, logKey string, paasResult *result.ResultBean) bool
func PdctlDeleteTikvStore ¶
func PdctlGetStore ¶
func PostDeployLog ¶
func PostProc ¶
func PostProc(servInstID, deployFlag, logKey, magicKey string, paasResult *result.ResultBean) bool
func RedisSlaveOf ¶
func RedisSlaveOf(sshClient *SSHClient, slaveCmd, logKey string, paasResult *result.ResultBean) bool
func RemoveRedisNodeFromCluster ¶
func RemoveRedisNodeFromCluster(sshClient *SSHClient, ip, redisPort, selfId, logKey string, paasResult *result.ResultBean) bool
func ResetDBPwd ¶
func ResetDBPwd(tidb map[string]interface{}, logKey string, paasResult *result.ResultBean) bool
func ReshardingRedisSlot ¶
func ReshardingRedisSlot(sshClient *SSHClient, cmdMig, logKey string, paasResult *result.ResultBean) bool
func SED ¶
func SED(sshClient *SSHClient, oldValue, newValue, file, logKey string, paasResult *result.ResultBean) bool
func Shutdown ¶
func Shutdown(sshClient *SSHClient, instId, cmptName, stopCmd, deployDir, checkPort, deployFlag, logKey, magicKey string, paasResult *result.ResultBean) bool
func Startup ¶
func Startup(sshClient *SSHClient, instId, cmptName, startCmd, checkPort, deployFlag, logKey, magicKey string, paasResult *result.ResultBean) bool
func StartupPreEmbadded ¶
func StartupPreEmbadded(sshClient *SSHClient, instId, cmptName, logKey, magicKey string, paasResult *result.ResultBean) bool
func TAR ¶
func TAR(sshClient *SSHClient, tarParams, srcFileName, desFileName, logKey string, paasResult *result.ResultBean) bool
func UnZip ¶
func UnZip(sshClient *SSHClient, srcFileName, desFileName, logKey string, paasResult *result.ResultBean) bool
func UndeployEtcdNode ¶
func UndeployEtcdNode(etcdNode map[string]interface{}, logKey, magicKey string, paasResult *result.ResultBean) bool
func UndeployGrafana ¶
func UndeployGrafana(grafana map[string]interface{}, version, logKey, magicKey string, paasResult *result.ResultBean) bool
func UndeployPrometheus ¶
func UndeployPrometheus(prometheus map[string]interface{}, version, logKey, magicKey string, paasResult *result.ResultBean) bool
func UndeployZookeeper ¶
func UndeployZookeeper(zk map[string]interface{}, version, logKey, magicKey string, paasResult *result.ResultBean) bool
Types ¶
type SSHClient ¶
type SSHClient struct { Ip string SshPort int User string Passwd string // contains filtered or unexported fields }
func GetSshClient ¶
func NewSSHClient ¶
func NewSSHClientBySSH ¶
func (*SSHClient) CheckTaosNodeOffLine ¶
func (h *SSHClient) CheckTaosNodeOffLine(cmd, node, logKey string, paasResult *result.ResultBean) bool
func (*SSHClient) CheckTaosNodeOnline ¶
func (h *SSHClient) CheckTaosNodeOnline(cmd, node, logKey string, paasResult *result.ResultBean) bool
func (*SSHClient) CreateOrDropNode ¶
func (h *SSHClient) CreateOrDropNode(cmd, logKey string, paasResult *result.ResultBean) bool
func (*SSHClient) ExecInteractCmd ¶
需要交互式执行, 比如scp需要输入密码, 将执行与处理交互式部分分开
func (*SSHClient) InitRedisCluster ¶
func (*SSHClient) IsFileExist ¶
func (*SSHClient) IsProcExist ¶
func (*SSHClient) JoinRedisCluster ¶
func (*SSHClient) LoginTaosShell ¶
func (h *SSHClient) LoginTaosShell(cmd, logKey string, paasResult *result.ResultBean) bool
func (*SSHClient) MigrateRedisClusterSlot ¶
func (h *SSHClient) MigrateRedisClusterSlot(cmd, logKey string, paasResult *result.ResultBean) bool
func (*SSHClient) ReadRedisDeleteNode ¶
func (*SSHClient) ReadRedisInitAccept ¶
func (*SSHClient) ReadRedisInitOkOrErr ¶
func (*SSHClient) ReadRedisJoinOkOrErr ¶
func (*SSHClient) ReadRedisMigrateSlot ¶
func (*SSHClient) ReadRedisReshardingOkOrErr ¶
func (*SSHClient) ReadRedisSlaveOfOkOrErr ¶
func (*SSHClient) ReadScpOut ¶
func (*SSHClient) ReadTaosEnd ¶
func (*SSHClient) ReadTaosOK ¶
func (*SSHClient) RemoveFromRedisCluster ¶
func (h *SSHClient) RemoveFromRedisCluster(cmd, logKey string, paasResult *result.ResultBean) bool
func (*SSHClient) ReshardingRedisSlot ¶
Click to show internal directories.
Click to hide internal directories.