This topic describes how to start an obshell process by using obshell-sdk-go.
Note
Before you proceed, we recommend that you read the Quick Start topic to learn how to use obshell-sdk-go.
Considerations
Before you start obshell, make sure that obshell is installed in the working directories of all nodes. You can manually download the RPM package and decompress it for installation, or you can initialize the nodes by using obshell-sdk-go. During the initialization process, obshell is automatically installed. For more information about how to initialize nodes by using obshell-sdk-go, see Initialize nodes.
Sample code
package main
import (
"github.com/oceanbase/obshell-sdk-go/util"
)
func startObshell() error {
ips := []string{
"10.10.10.1",
"10.10.10.2",
"10.10.10.3",
}
workDir := "/data/ob" // The working directory of OceanBase Database
nodeConfigs := make([]util.NodeConfig, 0)
for _, ip := range ips {
nodeConfigs = append(nodeConfigs, util.NewNodeConfig(ip, workDir, 2886))
}
// Start obshell
return util.StartObshell(nodeConfigs...)
}
References
For information about how to request an API by using obshell-sdk-python, see Start obshell.