0

After I build incubator-hawq on Centos7.1, I tried to init it. But the error below occurs:

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

When I type the command, the below shows:

[hawqadmin@host-172-16-0-105 hawqAdminLogs]$ postgres -V
postgres (HAWQ) 8.2.15

Any advice? Thanks!

louis lau
  • 161
  • 3
  • 11

5 Answers5

1

If "postgres -V" works, that means the postgres binary is good.

Before you do "hawq init cluster", please make sure:

1) $GPHOME in greenplum_path.sh is correctly set to the directory of hawq binary, i.e, /usr/hawq in your case

2) source $GPHOME/greenplum_path.sh

3) check if initdb and postgres binary is in $GPHOME/bin

huor
  • 116
  • 4
1

From the error you pasted above, 2 possible causes:

(1) The binary postgres called is not /usr/hawq/bin/postgres, You can use which postgres to check the path.

(2) The dependent lib for postgres may be wrong. You can use ldd for linux or otool for mac to print all dependent lib paths, and check them.

Moreover, if any error when init hawq, please check log in ~/hawqAdminLogs/, you may find out the specific error message.

Hope it will help you to find out the root cause.

Vasfed
  • 18,013
  • 10
  • 47
  • 53
Ming Li
  • 41
  • 2
1

Recently I faced same error while initializing cluster.
Postgres -V showed correct version, which postgres showed /usr/local/hawq/bin/postgres, also the path was already set, still faced above error.
Finally resolved by setting LD_LIBRARY_PATH to /usr/local/hawq/lib/ and sourced it via .bashrc file.

illright
  • 3,991
  • 2
  • 29
  • 54
NamrataB
  • 283
  • 2
  • 15
0

Looks like you might have installed hawq binaries in different directory . Please check the following

1.Make sure you have all the right PATH set

  1. Check hawq initdb binaries are there in /usr/hawq/bin/ directory
  • @partheesh_nair First, what's the right PATH? What should be included in PATH? Second, hawq initdb binaries are in /usr/hawq/bin/ directory. – louis lau May 17 '16 at 01:41
0
  1. make sure you have successed compile hawq and install them
  2. check postgres is in the same dir with initdb
  3. if there are more than 1 postgres in your pc, make sure the path of postgres(the same dir with initdb) is in your PATH.
Sakura
  • 1