inux中一键启动和关闭hadoop yarn hive的Shell脚本
时间: 2023-05-29 21:04:38 浏览: 201
启动Hadoop YARN和Hive的Shell脚本:
```
#!/bin/bash
# Start Hadoop YARN and Hive
echo "Starting Hadoop YARN and Hive..."
# Start Hadoop YARN
echo "Starting Hadoop YARN..."
start-yarn.sh
# Start Hive
echo "Starting Hive..."
hive --service hiveserver2 &
echo "Hadoop YARN and Hive started successfully."
```
关闭Hadoop YARN和Hive的Shell脚本:
```
#!/bin/bash
# Stop Hadoop YARN and Hive
echo "Stopping Hadoop YARN and Hive..."
# Stop Hive
echo "Stopping Hive..."
hive --service hiveserver2 --hiveconf hive.metastore.schema.verification=false --hiveconf hive.server2.enable.doAs=false --hiveconf hive.cli.print.header=false -e "shutdown;"
# Stop Hadoop YARN
echo "Stopping Hadoop YARN..."
stop-yarn.sh
echo "Hadoop YARN and Hive stopped successfully."
```
注意:在关闭Hive之前,需要使用Hive命令关闭HiveServer2。同时,还需要添加一些额外的参数来避免出现错误。
阅读全文