叢集規劃為7個節點,每個節點的ip、主機名和部署的元件配置設定如下:
hive安裝在desktop1上,注意:hive預設是使用derby資料庫儲存中繼資料,這裡替換為postgresql,下面會提到postgresql的安裝說明,并且需要拷貝postgres的jdbc jar檔案導hive的lib目錄下。
上傳<code>hive-0.10.0-cdh4.6.0.tar</code>到desktop1的<code>/opt</code>,并解壓縮。
這裡建立資料庫metastore并建立hiveuser使用者,其密碼為redhat。
編輯postgresql配置檔案(<code>/opt/PostgreSQL/9.1/data/pg_hba.conf</code>),修改通路權限
修改postgresql.conf
拷貝postgres的jdbc驅動到<code>/opt/hive-0.10.0-cdh4.6.0/lib</code>目錄。
注意修改下面配置檔案中postgres資料庫的密碼,注意配置<code>hive.aux.jars.path</code>,在hive內建hbase時候需要從該路徑家在hbase的一些jar檔案。
hive-site.xml檔案内容如下:
在<code>hive-site.xml</code>中配置<code>hive.aux.jars.path</code>,在環境變量中配置hadoop、mapreduce的環境變量
原因:hadoop配置檔案沒有zk
參考:https://issues.apache.org/jira/browse/HIVE-3994
## 異常4
原因:hive中沒有設定zk
原因:cloudera hadoop lib中沒有hadoop的native jar
原因:classpath沒有配置正确,檢查環境變量以及yarn的classpath