[Postgres-xl-developers] Fwd: fix postgres-xl build on FreeBSD

Ramanuj Hari hari.ramanuj at gmail.com
Wed Dec 10 02:41:24 PST 2014


Hi Jov,

I have done below things:

[1] I have installed bash shell on Freebsd, and applied the patch that you
had mentioned.
[2]
-------
pgxl at Freebsd_84 /var/mps/db_pgxl/data/auto/nodes-> ssh pgxl at 10.102.103.130
"env"
SSH_CLIENT=10.102.103.130 10740 22
USER=pgxl
MAIL=/var/mail/pgxl
HOME=/home/pgxl
LOGNAME=pgxl
BLOCKSIZE=K
TERM=su
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/pgxl/bin
SHELL=/bin/sh
PWD=/usr/home/pgxl
SSH_CONNECTION=10.102.103.130 10740 10.102.103.130 22
FTP_PASSIVE_MODE=YES
pgxl at Freebsd_84 /var/mps/db_pgxl/data/auto/nodes-> ssh pgxl at 10.102.103.130
"echo $LD_LIBRARY_PATH"
/var/mps/db_pgxl/pgxl/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib:
pgxl at Freebsd_84 /var/mps/db_pgxl/data/auto/nodes->

My pgxl is installed in /var/mps/db_pgxl/
I have created symbolic link to set environment working fine for bin, as
well as LD_LIBRARY_PATH
--
ln -s /var/mps/db_pgxl/bin /home/pgxl/bin
ln -s /var/mps/db_pgxl/lib /var/mps/db_pgxl/pgxl/lib
----

My .profile has below entry:
---
pgxl at Freebsd_84 /var/mps/db_pgxl/data/auto/nodes-> cat ~/.profile

# remove /usr/games if you want
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:$HOME/bin;
export PATH

# set ENV to a file invoked each time sh is started for interactive use.
ENV=$HOME/.shrc; export ENV

if [ -x /usr/games/fortune ] ; then /usr/games/fortune freebsd-tips ; fi

# Copied from 10.102.103.84
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

#added for pgxl
export PS1="$USER@`/bin/hostname -s` \\w-> "
export PGDATA=/var/mps/db_pgxl/pgxl/coordinator/pg_root
export LANG=en_US.utf8
export PGHOME=/var/mps/db_pgxl/pgxl
export
LD_LIBRARY_PATH=$PGHOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib:$LD_LIBRARY_PATH
export DATE=`date +"%Y%m%d%H%M"`
export PATH=$PGHOME/bin:$PATH:.
export MANPATH=$PGHOME/share/man:$MANPATH
export PGHOST=$PGDATA
export PGPORT=11921
#export PGUSER=postgres
export PGUSER=pgxl
#export PGDATABASE=mpstest
export PGDATABASE=postgres

export PGXC_CTL_HOME=/var/mps/db_pgxl/pgxl/pgxc_ctl_home
pgxl at Freebsd_84 /var/mps/db_pgxl/data/auto/nodes->
-----

And .bashrc has below entry:
---
pgxl at Freebsd_84 /var/mps/db_pgxl/data/auto/nodes-> cat ~/.bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

export
PATH=$PATH:/var/tmp/:/var/mps/db_pgxl/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/pgxl/bin:.
alias pgc1='psql -h 127.0.0.1 -p 11921 -U pgxl -w postgres'
alias pgd1='psql -h 127.0.0.1 -p 12921 -U pgxl -w postgres'
alias pgxl1='cd /var/mps/db_pgxl/data/auto/nodes '
alias psl1='ps -ax | grep pgxl'
alias tp1='tail -f /var/mps/db_pgxl/data/auto/nodes/coord/pg_log/*
/var/mps/db_pgxl/data/auto/nodes/dn_master/pg_log/* '
alias pgp1='tail -f /var/mps/db_pgxl/data/auto/nodes/pgpool/pgpool.log'
pgxl at Freebsd_84 /var/mps/db_pgxl/data/auto/nodes->
-----

My pgxc_ctl is started, and able to start gtm, coordinator, datanode, but
somehow co-ordinator is not able to execute direct on datanode. It says
below error, and init all fails in last configuration command:

----init all last few line output---------------
datanode_cmd.c:init_datanode_master(222) Done.
datanode_cmd.c:start_datanode_master_all(355) Starting all the datanode
masters.
datanode_cmd.c:start_datanode_master(396) Starting datanode master
datanode1.
do_shell.c:dump_cmdList(700) *** cmdList Dump
*******************************
allocated = 2, used = 1
do_shell.c:dump_cmdList(710) === CMD: 0 ===
do_shell.c:dump_cmdList(714)    --- CMD-EL: 0:host="10.102.103.130",
command="pg_ctl start -Z datanode -D
/var/mps/db_pgxl/data/auto/nodes/dn_master -o -i", localStdin="NULL",
localStdout="NULL"
do_shell.c:doCmdEl(336) Remote command: "pg_ctl start -Z datanode -D
/var/mps/db_pgxl/data/auto/nodes/dn_master -o -i", actual: "ssh
pgxl at 10.102.103.130 "( pg_ctl start -Z datanode -D
/var/mps/db_pgxl/data/auto/nodes/dn_master -o -i ) >
/tmp/Freebsd_84_STDOUT_4799_31 2>&1" < /dev/null > /dev/null 2>&1"
datanode_cmd.c:start_datanode_master(403) Done.
do_shell.c:dump_cmdList(700) *** cmdList Dump
*******************************
allocated = 2, used = 1
do_shell.c:dump_cmdList(710) === CMD: 0 ===
do_shell.c:dump_cmdList(714)    --- CMD-EL: 0:host="NULL", command="psql -p
11921 -h 10.102.103.130 -a postgres pgxl", localStdin="/tmp/STDIN_4799_32",
localStdout="NULL"
ALTER NODE coord1 WITH (HOST='10.102.103.130', PORT=11921);
CREATE NODE datanode1 WITH (TYPE='datanode', HOST='10.102.103.130',
PORT=12921, PRIMARY, PREFERRED);
do_shell.c:dump_cmdList(724)    ----------
do_shell.c:doCmdEl(358) Local command: "psql -p 11921 -h 10.102.103.130 -a
postgres pgxl", actual: "( psql -p 11921 -h 10.102.103.130 -a postgres pgxl
) > /tmp/STDOUT_4799_33 2>&1 < /tmp/STDIN_4799_32"
ALTER NODE coord1 WITH (HOST='10.102.103.130', PORT=11921);
ALTER NODE
CREATE NODE datanode1 WITH (TYPE='datanode', HOST='10.102.103.130',
PORT=12921, PRIMARY, PREFERRED);
CREATE NODE
coord_cmd.c:configure_nodes(391) Done.
do_shell.c:dump_cmdList(700) *** cmdList Dump
*******************************
allocated = 2, used = 1
do_shell.c:dump_cmdList(710) === CMD: 0 ===
do_shell.c:dump_cmdList(714)    --- CMD-EL: 0:host="NULL", command="psql -p
11921 -h 10.102.103.130 -a postgres pgxl", localStdin="/tmp/STDIN_4799_34",
localStdout="NULL"
EXECUTE DIRECT ON (datanode1) 'CREATE NODE coord1 WITH
(TYPE=''coordinator'', HOST=''10.102.103.130'', PORT=11921)';
EXECUTE DIRECT ON (datanode1) 'ALTER NODE datanode1 WITH
(TYPE=''datanode'', HOST=''10.102.103.130'', PORT=12921, PRIMARY,
PREFERRED)';
do_shell.c:dump_cmdList(724)    ----------
do_shell.c:doCmdEl(358) Local command: "psql -p 11921 -h 10.102.103.130 -a
postgres pgxl", actual: "( psql -p 11921 -h 10.102.103.130 -a postgres pgxl
) > /tmp/STDOUT_4799_35 2>&1 < /tmp/STDIN_4799_34"
EXECUTE DIRECT ON (datanode1) 'CREATE NODE coord1 WITH
(TYPE=''coordinator'', HOST=''10.102.103.130'', PORT=11921)';
connection to server was lost
coord_cmd.c:configure_datanodes(414) Done.
PGXC$
----


Thanks,
Ramanuj


On Wed, Dec 10, 2014 at 3:54 PM, Jov <amutu at amutu.com> wrote:

> let's talk on the list.
>
> Jov
> blog: http:amutu.com/blog <http://amutu.com/blog>
>
> ---------- Forwarded message ----------
> From: Jov <amutu at amutu.com>
> Date: 2014-12-10 18:22 GMT+08:00
> Subject: Re: [Postgres-xl-developers] fix postgres-xl build on FreeBSD
> To: Ramanuj Hari <hari.ramanuj at gmail.com>
>
>
> have you test with the patch above?I install pgxl with pgxc_ctl.
> I run PG-XL on FreeBSD with some more patch.The patch above can only make
> pgxc_ctl install and init cluster,but when you run SQL,there will be
> problem.I have solve the problem,and wait for the above patch accepting and
> then will submit the other patch.
>
> for install and init pgxl,there are 2 problems for FreeBSD user to solve:
> 1.install the bash shell and apply the above patch.
> 2.set remote env for ssh.you should add a file named environment in the ~/.ssh
> dir with PATH set to pgxl bin dir.
>
> Jov
> blog: http:amutu.com/blog <http://amutu.com/blog>
>
> 2014-12-10 17:56 GMT+08:00 Ramanuj Hari <hari.ramanuj at gmail.com>:
>
>> Hi Jov,
>>
>> I am also trying to run on FreeBSD r10. But got into issue.
>>
>> ----
>> do_shell.c:dump_cmdList(713) *** cmdList Dump
>> *******************************
>> allocated = 2, used = 1
>> do_shell.c:dump_cmdList(723) === CMD: 0 ===
>> do_shell.c:dump_cmdList(727)    --- CMD-EL: 0:host="NULL", command="psql
>> -p 11921 -h 10.102.103.135 -a postgres pgxl",
>> localStdin="/tmp/STDIN_48989_34", localStdout="NULL"
>> EXECUTE DIRECT ON (datanode1) 'CREATE NODE coord1 WITH
>> (TYPE=''coordinator'', HOST=''10.102.103.135'', PORT=11921)';
>> EXECUTE DIRECT ON (datanode1) 'ALTER NODE datanode1 WITH
>> (TYPE=''datanode'', HOST=''10.102.103.135'', PORT=12921, PRIMARY,
>> PREFERRED)';
>> EXECUTE DIRECT ON (datanode1) 'SELECT pgxc_pool_reload()';
>> do_shell.c:dump_cmdList(737)    ----------
>> do_shell.c:doCmdEl(360) Local command: "psql -p 11921 -h 10.102.103.135
>> -a postgres pgxl", actual: "( psql -p 11921 -h 10.102.103.135 -a postgres
>> pgxl ) > /tmp/STDOUT_48989_35 2>&1 < /tmp/STDIN_48989_34"
>> EXECUTE DIRECT ON (datanode1) 'CREATE NODE coord1 WITH
>> (TYPE=''coordinator'', HOST=''10.102.103.135'', PORT=11921)';
>> ERROR:  Could not begin transaction on Datanodes
>> EXECUTE DIRECT ON (datanode1) 'ALTER NODE datanode1 WITH
>> (TYPE=''datanode'', HOST=''10.102.103.135'', PORT=12921, PRIMARY,
>> PREFERRED)';
>> ERROR:  Could not begin transaction on Datanodes
>> EXECUTE DIRECT ON (datanode1) 'SELECT pgxc_pool_reload()';
>> ERROR:  Could not begin transaction on data node.
>> coord_cmd.c:configure_datanodes(416) Done.
>> PGXC$
>> -----
>>
>> Could you please help how did you try, whether it is pgxc_ctl or manual
>> configuration.
>>
>> Thanks,
>> Ramanuj
>>
>>
>> On Wed, Oct 15, 2014 at 7:21 AM, Jov <amutu at amutu.com> wrote:
>>
>>> v2 change:
>>> replace "#!/bin/bash" with "#!/usr/bin/env bash" in these files:
>>> contrib/pgxc_ctl/pgxc_ctl.bash
>>> contrib/pgxc_ctl/pgxc_ctl_bash.c
>>> contrib/pgxc_ctl/pgxc_ctl_bash.org
>>> contrib/pgxc_ctl/pgxc_ctl_bash_2
>>> contrib/pgxc_ctl/pgxc_ctl_conf_part
>>>
>>> I am success to setup and init pgxl cluster after this patch on FreeBSD
>>> r10 amd64
>>>
>>> Jov
>>> blog: http:amutu.com/blog <http://amutu.com/blog>
>>>
>>> 2014-10-15 5:52 GMT+08:00 Jov <amutu at amutu.com>:
>>>
>>>> Thanks.I find some runtime problem when running pgxc_ctl,I will submit
>>>> a updated patch later.
>>>> 2014年10月15日 4:52 AM于 "Mason Sharp" <msharp at translattice.com>写道:
>>>>
>>>> Hi Jov,
>>>>>
>>>>> Will try to take a closer look soon.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Mason
>>>>>
>>>>> On Mon, Oct 13, 2014 at 2:50 AM, Jov <amutu at amutu.com> wrote:
>>>>>
>>>>>> any idea?
>>>>>>
>>>>>> Jov
>>>>>> blog: http:amutu.com/blog <http://amutu.com/blog>
>>>>>>
>>>>>> 2014-10-11 17:41 GMT+08:00 赵伟 <amutu at amutu.com>:
>>>>>>
>>>>>>> when build pgxl on FreeBSD,there are 3 problems:
>>>>>>> 1."WEXITSTATUS(status) " macro can't be resolve when compile
>>>>>>> src/gtm/gtm_ctl/gtm_ctl.c ,caused by lacking of sys/wait.h header.
>>>>>>>
>>>>>>> 2.type "pid_t" undefined when compile
>>>>>>> contrib/pgxc_ctl/utils.h,caused by lacking of sys/types.h header
>>>>>>>
>>>>>>> 3.contrib/pgxc_ctl/make_signature bash can't be running bacause of
>>>>>>> it think the bash is installed at /bin/bash,which is not true on
>>>>>>> FreeBSD.replace with "#!/usr/bin/env bash" solve the problem.
>>>>>>>
>>>>>>> patch attached.
>>>>>>>
>>>>>>> thanks,
>>>>>>> Jov
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
>>>>>>> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS
>>>>>>> Reports
>>>>>>> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
>>>>>>> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>>>>>>> http://p.sf.net/sfu/Zoho
>>>>>>> _______________________________________________
>>>>>>> Postgres-xl-developers mailing list
>>>>>>> Postgres-xl-developers at lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/postgres-xl-developers
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
>>>>>> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS
>>>>>> Reports
>>>>>> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
>>>>>> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>>>>>> http://p.sf.net/sfu/Zoho
>>>>>> _______________________________________________
>>>>>> Postgres-xl-developers mailing list
>>>>>> Postgres-xl-developers at lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/postgres-xl-developers
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Mason Sharp
>>>>>
>>>>> TransLattice - http://www.translattice.com
>>>>> Clustered and Distributed Database Solutions
>>>>>
>>>>>
>>>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Comprehensive Server Monitoring with Site24x7.
>>> Monitor 10 servers for $9/Month.
>>> Get alerted through email, SMS, voice calls or mobile push notifications.
>>> Take corrective actions from your mobile device.
>>> http://p.sf.net/sfu/Zoho
>>> _______________________________________________
>>> Postgres-xl-developers mailing list
>>> Postgres-xl-developers at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/postgres-xl-developers
>>>
>>>
>>
>
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> Postgres-xl-developers mailing list
> Postgres-xl-developers at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/postgres-xl-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.postgres-xl.org/private.cgi/postgres-xl-developers-postgres-xl.org/attachments/20141210/2d938e4c/attachment.htm>


More information about the Postgres-xl-developers mailing list