用beeline连接SparkSQL
2016-03-28 16:49
232 查看
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
http://www.tuicool.com/articles/7BbiArR
http://blog.zhaishidan.cn/2015/05/15/jie-jue-beelinelian-jie-hiveserver2zhi-xing-sqlbao-cuo-de-wen-ti/
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/
相关文章推荐
- 转:通过API获取和创建 Oracle GL Account Code Combination ID’s (CCID’s)的几种方法汇总
- Sqlite全面学习(二)
- MySQL备份学习
- redis主从配置
- SQL SERVER 2000数据库置疑处理
- 表的复制——sql语句
- MongoDB基本命令
- Sqlite全面学习(一)
- Mysql支持的数据类型(总结)
- Sql查询死锁的方法
- 安装配置PLSQL Developer
- Redis3.0安装 for win10
- MySQL允许远程访问的设置
- sql约束
- 数据库-T-SQL 语句-简单查询
- Sql--运算符优先级
- MySQL系列:事务机制
- 关于Mongodb的一些小问题
- MySQL远程访问权限,允许远程连接
- 数据库设计原则