2016-05-16 51 views
0

在Centos7.1上構建incubator-hawq後,我嘗試初始化它。但低於發生錯誤:Hawq初始化失敗 - initdb需要「postgres」

20160516:18:10:43:002036 hawqinit.sh:host-172-16-0-105:hawqadmin-[INFO]:-Loading hawq_toolkit... 
ALTER ROLE 
20160516:18:10:44:001766 hawq_init:host-172-16-0-105:hawqadmin-[INFO]:-20160516:18:10:43:002036 hawqinit.sh:host-172-16-0-105:hawqadmin-[INFO]:-Loading hawq_toolkit... 
20160516:18:10:44:001766 hawq_init:host-172-16-0-105:hawqadmin-[INFO]:-Master init successfully 
20160516:18:10:44:001766 hawq_init:host-172-16-0-105:hawqadmin-[INFO]:-Init segments in list: ['hawq-master'] 
20160516:18:10:44:001766 hawq_init:host-172-16-0-105:hawqadmin-[DEBUG]:-Start to init segment on node 'hawq-master' 
20160516:18:10:44:001766 hawq_init:host-172-16-0-105:hawqadmin-[INFO]:-Total segment number is: 1 
fgets failure: Success 
The program "postgres" is needed by initdb but was either not found in the same directory as "/usr/hawq/bin/initdb" or failed unexpectedly. 
Check your installation; "postgres -V" may have more information. 
20160516:18:10:45:002318 hawqinit.sh:host-172-16-0-105:hawqadmin-[ERROR]:-Postgres initdb failed 
20160516:18:10:45:002318 hawqinit.sh:host-172-16-0-105:hawqadmin-[ERROR]:-Segment init failed on host-172-16-0-105 
20160516:18:10:45:001766 hawq_init:host-172-16-0-105:hawqadmin-[INFO]:-20160516:18:10:45:002318 hawqinit.sh:host-172-16-0-105:hawqadmin-[ERROR]:-Postgres initdb failed 
20160516:18:10:45:002318 hawqinit.sh:host-172-16-0-105:hawqadmin-[ERROR]:-Segment init failed on host-172-16-0-105 
20160516:18:10:45:001766 hawq_init:host-172-16-0-105:hawqadmin-[ERROR]:-HAWQ init failed on hawq-master 
20160516:18:10:46:001766 hawq_init:host-172-16-0-105:hawqadmin-[INFO]:-0 of 1 segments init successfully 
20160516:18:10:46:001766 hawq_init:host-172-16-0-105:hawqadmin-[ERROR]:-Segments init failed, exit 

當我鍵入命令後,如下圖:

[[email protected] hawqAdminLogs]$ postgres -V 
postgres (HAWQ) 8.2.15 

有什麼建議?謝謝!

回答

0

看起來你可能已經在不同的目錄下安裝了hawq二進制文件。請檢查下面的

1.確保你擁有所有正確的道路設置

  • 檢查hawq initdb的二進制文件是否有在/ usr/hawq/bin /目錄
  • +0

    @partheesh_nair首先,什麼是正確的路徑? PATH應包含哪些內容?其次,hawq initdb二進制文件位於/ usr/hawq/bin /目錄中。 –

    1

    如果「postgres -V」有效,那意味着postgres二進制文件很好。

    在你做 「hawq初始化集羣」,請確保:

    1)$ GPHOME在greenplum_path.sh正確設置爲hawq二進制,即,在/ usr/hawq的目錄,你的情況

    2)源$ GPHOME/greenplum_path.sh

    3)檢查是否在initdb和Postgres二進制是在$ GPHOME/bin中

    1

    從你上述粘貼的錯誤,2個可能的原因:

    (1)調用的二進制文件postgres不是/usr/hawq/bin/postgres,您可以使用which postgres來檢查路徑。

    (2)postgres的依賴庫可能是錯誤的。您可以使用ldd for linux或otool for mac打印所有相關的lib路徑,並檢查它們。

    此外,如果init hawq出現任何錯誤,請檢查登錄~/hawqAdminLogs/,您可能會發現具體的錯誤信息。

    希望它能幫助你找出根本原因。

    0
    1. 確保你已經successed編譯hawq並安裝它們
    2. 檢查的Postgres是在initdb的
    3. 同一目錄。如果有超過1級的Postgres在你的電腦,確保Postgres的的路徑(與initdb相同的目錄)在你的PATH中。
    1

    最近我在初始化羣集時遇到了同樣的錯誤。
    Postgres -V顯示正確的版本,which postgres顯示/usr/local/hawq/bin/postgres,路徑已經設置,仍然面臨以上錯誤。
    最後通過將LD_LIBRARY_PATH設置爲/usr/local/hawq/lib/並通過.bashrc文件獲得。