启动OushuDB有两种方式,一种是通过”hawq start cluster”命令来启动整个集群,包括master和segment。启动哪些segment是由”/hawq-install-path/etc/slaves”中包含的节点确定的。
source /usr/local/hawq/greenplum_path.sh # 设置OushuDB环境变量hawq start cluster # 启动整个OushuDB集群
另外一种方式是分别启动OushuDB master和segment。因为OushuDB master和segment是解耦合的,分别启动master和segment是可行的。
hawq start master # 启动master,指的是启动本地masterhawq start segment # 启动segment,指的是启动本地segment
重新启动或者停止OushuDB也有两种方式:
# 方式一hawq restart cluster # 重启OushuDB集群hawq stop cluster # 停止OushuDB集群# 方式二hawq restart master # 重启本机的OushuDB masterhawq restart segment # 重启本机的OushuDB segmenthawq stop master # 停止本机OushuDB masterhawq stop segment # 停止本机OushuDB segment
启动/停止Magma
OushuDB4.0 实现了单独起停Magma服务,具体命令如下:
# 方式一 OushuDB4.0 集群起停带Magma服务 [只有hawq init|start|stop cluster命令可以带--with_magma选项]hawq init cluster --with_magma # 启动OushuDB集群时,使用--with_magma选项,同时启动Magma服务, 3.X版本不支持。# 方式二 Magma服务单独起停magma start|stop|restart clustermagma start|stop|restart node
关于OushuDB hawq命令的详细用法,可以通过”hawq –help”命令得到。
changlei:build ChangLei$ hawq --help usage: hawq <command> [<object>] [options] [--version] The most commonly used hawq "commands" are: start Start hawq service. stop Stop hawq service. init Init hawq service. restart Restart hawq service. activate Activate hawq standby master as master. version Show hawq version information. config Set hawq GUC values. state Show hawq cluster status. filespace Create hawq filespaces. extract Extract table metadata into a YAML formatted file. load Load data into hawq. scp Copies files between multiple hosts at once. ssh Provides ssh access to multiple hosts at once. ssh-exkeys Exchanges SSH public keys between hosts. check Verifies and validates HAWQ settings. checkperf Verifies the baseline hardware performance of hosts. register Register parquet files generated by other system into the corrsponding table in HAWQ See 'hawq <command> help' for more information on a specific command.