hive配置
hive本身的配置还是很简单的,关键在于需要一些前提条件。
1)hadoop必须配置成伪分布模式或者集群模式
2)必须启动hadoop
hive的数据仓库路径不是本机文件系统路径,而是hdfs的路径
<property> <name>hive.metastore.warehouse.dir</name> <value>/home/hadoop/hive/warehouse</value> <description>location of default database for the warehouse</description></property>
create table visit_record(code string, created_at string, phone string, ip string) row format delimited fields terminated by ' ';
load data local inpath '/home/hadoop/hive.txt' into table visit_record;
<property> <name>hive.metastore.local</name> <value>true</value></property><property> <name>javax.jdo.option.ConnectionURL</name> <value> jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true </value></property><property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.jdbc.Driver</value></property><property> <name>javax.jdo.option.ConnectionUserName</name> <value>这里是mysql的用户名</value></property><property> <name>javax.jdo.option.ConnectionPassword</name> <value>这里是mysql的密码</value></property>