Documentation ¶
Overview ¶
Copyright 2021 SANGFOR TECHNOLOGIES
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func ExecCmd(hookF dtstruct.HookFunction, command string, args ...string) ([]string, error)
- func GetAllPortAndNodeName(hookF dtstruct.HookFunction) (map[string]string, error)
- func GetBaseInfo(hookFs []dtstruct.HookFunction, refresh bool) (*dtstruct.BaseInfo, error)
- func GetDataPath(hookF dtstruct.HookFunction) string
- func GetEnvVar(hookF dtstruct.HookFunction) (map[string]string, error)
- func GetNodeInfo(req *dtstruct.DatabaseInfoRequest, hookFs []dtstruct.HookFunction) (*dtstruct.NodeInfo, error)
- func GetPort(hookF dtstruct.HookFunction, nodeName string) (map[string]string, error)
- func GetStatusInfo(hookF dtstruct.HookFunction) (map[string]string, error)
- func GetVersion(hookF dtstruct.HookFunction, version *string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllPortAndNodeName ¶
func GetAllPortAndNodeName(hookF dtstruct.HookFunction) (map[string]string, error)
GetAllPortAndNodeName get port for all instance
nodeName:c-node-1 datanodePort :15400 datanodeListenIP 1:10.10.10.10 nodeName:c-node-2 datanodeListenIP 1:10.10.10.11 datanodePort :15400
func GetBaseInfo ¶
GetBaseInfo init or refresh opengauss base info
func GetDataPath ¶
func GetDataPath(hookF dtstruct.HookFunction) string
GetDataPath get opengauss data path
func GetEnvVar ¶
func GetEnvVar(hookF dtstruct.HookFunction) (map[string]string, error)
GetEnvVar get opengauss cluster name from env, demo of output for command:
GAUSS_VERSION=2.0.1 GS_CLUSTER_NAME=sangfor-opengauss-cluster
func GetNodeInfo ¶
func GetNodeInfo(req *dtstruct.DatabaseInfoRequest, hookFs []dtstruct.HookFunction) (*dtstruct.NodeInfo, error)
GetNodeInfo get node info
func GetPort ¶
GetPort get instance listen port, demo of output for command:
nodeName:c-node-1 datanodePort :15400 nodeName:c-node-2 datanodePort :15400
func GetStatusInfo ¶
func GetStatusInfo(hookF dtstruct.HookFunction) (map[string]string, error)
GetStatusInfo use gs_om tool to get local node info demo of output for command: gs_om -t status -h `hostname`
-----------------------------------------------------------------------
cluster_state : Normal redistributing : No
-----------------------------------------------------------------------
node : 1 node_name : c-node-1 instance_id : 6001 node_ip : 10.10.10.10 data_path : /opt/sangfor/db/install/data/dn type : Datanode instance_state : Normal az_name : AZ1 static_connections : 1 HA_state : Normal instance_role : Primary
-----------------------------------------------------------------------
func GetVersion ¶
func GetVersion(hookF dtstruct.HookFunction, version *string) string
GetVersion get opengauss version
Types ¶
This section is empty.