This topic describes how to install the obshell RPM package on each node 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 install obshell, download the required RPM package to the local machine. You can manually download the RPM package or use obshell-sdk-go to download it. For more information about how to use obshell-sdk-go to download the RPM package, see Download the RPM package.
Sample code
func main() {
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))
}
if err := util.InstallObshell("/tmp/obshell-4.2.4.2-12024102115.el7.x86_64.rpm", nodeConfigs...); err != nil {
panic(err)
}
}
References
For more information about how to request an API by using obshell-sdk-python, see Install obshell.