hive命令行
-
hive --help
--config hive配置文件路径 --service hive 服务 --auxpath 添加jar包(多个jar包用:分割)
-
hive --service help
Service List: beeline cli help hiveburninclient hiveserver2 hiveserver hwi jar lineage metastore metatool orcfiledump rcfilecat schemaTool version Parameters parsed: --auxpath : Auxillary jars --config : Hive configuration directory --service : Starts specific service/component. cli is default Parameters used: HADOOP_HOME or HADOOP_PREFIX : Hadoop install directory HIVE_OPT : Hive options For help on a particular service: ./hive --service serviceName --help Debug help: ./hive --debug --help
-
hive --service cli(相当于直接执行hive) 具体服务
hive --service cli --help (相当于直接执行hive -h) -e 直接执行hql语句 -v 输出hql语句 -S 屏蔽执行过程 -f 执行hql文件 -i 执行一个文件 -d 用户自定义变量 --hivevar 用户自定义变量
-
hive cli更多功能
- 直接执行shell 命令
hive> ! pwd;
- 直接执行hsdf 命令
hive> df -ls;
- 显示数据库
hive> set hive.cli.print.current.db=true;
- 显示字段名
hive> set hive.cli.print.header=true;
- 直接执行shell 命令
-
启动hive服务
启动web GUI nohup hive --service hwi > /dev/null 2>&1 & http://master:9999/hwi 启动元数据 nohup hive --service metastore > /dev/null 2>&1 & 启动远程服务接口 nohup hive --service hiveserver2 > /de