启动并验证hive
验证并启动mysql
mysql -uroot -p123456
启动并验证hadoop
start-all.sh
jps
连接hiveserver2
手动启动:
/export/server/apache-hive-3.1.2-bin/bin/hive --service metastore &
/export/server/apache-hive-3.1.2-bin/bin/hive --service hiveserver2 &
写脚本启动:
- 进入环境变量目录:
cd /bin - 新建脚本文件:
vim hiveserver
echo =========== metastore ============
nohup /export/server/apache-hive-3.1.2-bin/bin/hive --service metastore &
yes | command
echo =========== hiveserver2 ==========
nohup /export/server/apache-hive-3.1.2-bin/bin/hive --service hiveserver2 &
yes | command
yes | command
yes | command
n=1
until lsof -i:10000
do
echo "监听连接中-----$n s";
n=$((n+1));
sleep 1;
done
echo '启动成功'
- 激活脚本
chmod 777 hiveserver - 使用脚本:
启动hive
hive
- 检查是否可以正常使用:
show databases;