假设我的hive安装在hadoop102节点的/opt/module/hive目录中,请给我写出在其他节点上的一键启动hivesever2的shell脚本
时间: 2023-05-28 16:07:59 浏览: 85
#!/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"
假设我的hive安装在hadoop102节点的/opt/module/hive目录中,请给我写出在其他节点上的一键启动和关闭hive和hivesever2的shell脚本
启动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免密登录。
阅读全文
相关推荐
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)