core

package
v0.0.0-...-6b32d26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecCmd

func ExecCmd(hookF dtstruct.HookFunction, command string, args ...string) ([]string, error)

ExecCmd exec command with args

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

func GetBaseInfo(hookFs []dtstruct.HookFunction, refresh bool) (*dtstruct.BaseInfo, error)

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

GetNodeInfo get node info

func GetPort

func GetPort(hookF dtstruct.HookFunction, nodeName string) (map[string]string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL