假设我的hive安装在hadoop102节点的/opt/module/hive目录中,请给我写出在其他节点上的一键启动和关闭hive和hivesever2的shell脚本
时间: 2023-05-28 20:07:00 浏览: 97
启动hive和hiveserver2的脚本:
```
#!/bin/bash
ssh hadoop102 "/opt/module/hive/bin/hive --service metastore &"
ssh hadoop102 "/opt/module/hive/bin/hiveserver2 &"
echo "Hive and HiveServer2 started successfully!"
```
关闭hive和hiveserver2的脚本:
```
#!/bin/bash
ssh hadoop102 "ps -ef | grep metastore | grep -v grep | awk '{print \$2}' | xargs kill -9"
ssh hadoop102 "ps -ef | grep hiveserver2 | grep -v grep | awk '{print \$2}' | xargs kill -9"
echo "Hive and HiveServer2 stopped successfully!"
```
注:需要在其他节点上安装ssh,并且需要在hadoop102节点上配置ssh免密登录。
相关问题
假设我的hive安装在hadoop102节点的/opt/module/hive目录中,请给我写出在其他节点上的一键启动hivesever2的shell脚本
#!/bin/bash
ssh hadoop102 "/opt/module/hive/bin/hiveserver2 &"
echo "HiveServer2 started successfully on hadoop102."
假设我的hive安装在hadoop102节点的/opt/module/hive目录中,请给我写出在其他节点上的一键启动hive和hivesever2的shell脚本
#!/bin/bash
ssh hadoop102 "/opt/module/hive/bin/hive --service metastore &"
ssh hadoop102 "/opt/module/hive/bin/hiveserver2 &"
echo "Hive and Hiveserver2 started successfully"
阅读全文