用beeline连接SparkSQL
来源:互联网 发布:json文件dw打开乱码 编辑:程序博客网 时间:2024/06/08 03:42
1. 在$SPARK_HOME/conf/hive-site.xml文件中添加下面的属性
vi $SPARK_HOME/conf/hive-site.xml
<configuration>
<property>
<name>hive.metastore.uris</name>
<value>thrift://master:9083</value>
<description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.</description>
</property>
<property>
<name>hive.server2.thrift.bind.host</name>
<value>192.168.56.101</value>
<description>Bind host on which to run the HiveServer2 Thrift service.</description>
</property>
<property>
<name>hive.server2.thrift.port</name>
<value>10001</value>
<description>Port number of HiveServer2 Thrift interface when hive.server2.transport.mode is 'binary'.</description>
</property>
<property>
<name>hive.server2.thrift.min.worker.threads</name>
<value>5</value>
<description>Minimum number of Thrift worker threads</description>
</property>
<property>
<name>hive.server2.thrift.max.worker.threads</name>
<value>500</value>
<description>Maximum number of Thrift worker threads</description>
</property>
<property>
<name>hive.server2.enable.doAs</name>
<value>false</value>
</property>
</configuration>
2. 复制mysql JDBC驱动文件到$SPARK_HOME/lib/
cp mysql-connector-java-5.1.31-bin.jar $SPARK_HOME/lib/
3. 启动hive元数据存储服务
hive --service metastore > /tmp/grid/hive_metastore.log 2>&1 &
4. 启动spark thriftserver服务
$SPARK_HOME/sbin/start-thriftserver.sh --master spark://192.168.56.101:7077 --executor-memory 30g
5. 登入beeline
$SPARK_HOME/bin/beeline -u jdbc:hive2://192.168.56.101:10001/
参考:
https://spark.apache.org/docs/1.5.0/sql-programming-guide.html
vi $SPARK_HOME/conf/hive-site.xml
<configuration>
<property>
<name>hive.metastore.uris</name>
<value>thrift://master:9083</value>
<description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.</description>
</property>
<property>
<name>hive.server2.thrift.bind.host</name>
<value>192.168.56.101</value>
<description>Bind host on which to run the HiveServer2 Thrift service.</description>
</property>
<property>
<name>hive.server2.thrift.port</name>
<value>10001</value>
<description>Port number of HiveServer2 Thrift interface when hive.server2.transport.mode is 'binary'.</description>
</property>
<property>
<name>hive.server2.thrift.min.worker.threads</name>
<value>5</value>
<description>Minimum number of Thrift worker threads</description>
</property>
<property>
<name>hive.server2.thrift.max.worker.threads</name>
<value>500</value>
<description>Maximum number of Thrift worker threads</description>
</property>
<property>
<name>hive.server2.enable.doAs</name>
<value>false</value>
</property>
</configuration>
2. 复制mysql JDBC驱动文件到$SPARK_HOME/lib/
cp mysql-connector-java-5.1.31-bin.jar $SPARK_HOME/lib/
3. 启动hive元数据存储服务
hive --service metastore > /tmp/grid/hive_metastore.log 2>&1 &
4. 启动spark thriftserver服务
$SPARK_HOME/sbin/start-thriftserver.sh --master spark://192.168.56.101:7077 --executor-memory 30g
5. 登入beeline
$SPARK_HOME/bin/beeline -u jdbc:hive2://192.168.56.101:10001/
参考:
https://spark.apache.org/docs/1.5.0/sql-programming-guide.html
http://www.tuicool.com/articles/7BbiArR
http://blog.zhaishidan.cn/2015/05/15/jie-jue-beelinelian-jie-hiveserver2zhi-xing-sqlbao-cuo-de-wen-ti/
0 0
- 用beeline连接SparkSQL
- 使用beeline/jdbc 连接hive,impala,sparksql
- hive beeline连接hiveserver2
- spark-beeline连接hvie
- beeline连接hiveserver2源码分析
- beeline 命令行客户端连接hive
- hive使用beeline测试JDBC连接
- SparkSQL之连接thirftserver
- Sparksql连接mysql数据库
- Hive:使用beeline连接和在eclispe中连接
- 配置Tableau Desktop连接SparkSQL
- [spark]解决beeline连接thrift-server加载数据权限问题
- HIVE2 :beeline连接设置用户名和密码注意问题
- HIVE2 :beeline连接设置用户名和密码注意问题
- sparkSQL
- SparkSQL
- SparkSQL
- SparkSQL
- nio-Buffer
- 动态代理模式
- 初涉RxAndroid .from() .just() 以及线程操作
- 初学processing(一)
- easyUI 转为中文
- 用beeline连接SparkSQL
- 网络基础---子网掩码
- 1000行代码写小游戏(八)
- Android引入外部数据库遇到的坑
- Android系统开发教程之Android开发在虚拟机的优化
- boost 源码安装方法
- Qt中(图片)资源的使用方式
- Android Studio中安装Genymotion插件
- mac不可缺少的伴侣cleanmymac3其谁