This topic describes how to start an obshell process by using obshell-sdk-python.
Note
Before you start, we recommend that you read the Quick Start topic to learn how to use obshell-sdk-python.
Considerations
Before you start obshell, make sure that obshell is installed in the working directories of all nodes. You can manually download an RPM package and decompress and install it, or you can use obshell-sdk-python to initialize the nodes. During the initialization, obshell is installed. For more information about how to initialize the nodes by using obshell-sdk-python, see Initialize nodes.
Sample code
from obshell import start_obshell, NodeConfig
def init_nodes():
ips = [
"10.10.10.1",
"10.10.10.2",
"10.10.10.3",
]
work_dir = "/data/ob" # The working directory of OceanBase Database.
nodes_config = []
for _, ip in enumerate(ips):
node = NodeConfig(ip, work_dir)
nodes_config.append(node)
# Start obshell.
start_obshell(nodes_config)
References
For more information about how to request an API by using obshell-sdk-go, see Start obshell.