ubuntu如何新建hive-site.xml
时间: 2023-11-10 09:06:22 浏览: 172
spark下安装hive配置文件hive-site.xml
要在Ubuntu上新建hive-site.xml文件,可以按照以下步骤进行操作:
1. 打开终端,进入Hive的conf目录:cd /usr/local/hive/conf/
2. 使用sudo命令新建hive-site.xml文件:sudo nano hive-site.xml
3. 在新建的hive-site.xml文件中添加Hive的配置信息,例如:
```
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<description>Driver class name for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hiveuser</value>
<description>username to use against metastore database</description>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>password</value>
<description>password to use against metastore database</description>
</property>
<property>
<name>hive.metastore.uris</name>
<value>thrift://localhost:9083</value>
<description>URI for client to contact metastore server</description>
</property>
</configuration>
```
4. 保存文件并退出编辑器。
完成以上步骤后,你就成功新建了hive-site.xml文件,并将Hive的配置信息添加到了该文件中。
阅读全文