<div dir="ltr">Thanks! <div>I just sent my patch to <a href="mailto:pgpool-hackers@pgpool.net">pgpool-hackers@pgpool.net</a></div><div><br></div><div>Check it and see if there are any issues.</div><div>-Nirav Bhatt</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 19, 2021 at 5:53 AM Bo Peng <<a href="mailto:pengbo@sraoss.co.jp">pengbo@sraoss.co.jp</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
Sorry for late response.<br>
<br>
> Hello,<br>
> <br>
> I tried and I found the solution. I am able to ping the server2 with<br>
> virtual IP from server1 and server3.<br>
<br>
Great!<br>
<br>
> In addition to your route table suggestion, following 2 things must be done:<br>
> <br>
> 1-ip addr add command is must.<br>
> So far I was thinking AWS and ip command are mutually exclusive, but no,<br>
> it's not.<br>
> I am still unaware if arp is needed or not for pgpool to function? I am<br>
> able to use virtual IP to ping the instances without running arp.<br>
<br>
I think you don't need to setup arp on AWS.<br>
<br>
> 2-This is specific to AWS: The source-destination check for the active<br>
> network interface must be disabled.<br>
> <br>
> This is the SrcDestCheck attribute of the network interface.<br>
> When true, this allows traffic only destined to the main IP address of the<br>
> interface, and not anything else.<br>
> Network address translation is simply impossible when this ON.<br>
> So this must be turned off for the instance which is about to own the<br>
> virtual IP to become the primary.<br>
> <br>
> (I do not see any harm is keeping it OFF forever for all participating<br>
> nodes, though I would like to know if you disagree)<br>
> <br>
> The source where I got this SrcDestCheck idea is here:<br>
> <a href="http://www.scalingbits.com/book/export/html/618" rel="noreferrer" target="_blank">http://www.scalingbits.com/book/export/html/618</a><br>
> <br>
> The AWS documentation for this is here:<br>
> <a href="https://docs.aws.amazon.com/vpc/latest/userguide/VPC_NAT_Instance.html#EIP_Disable_SrcDestCheck" rel="noreferrer" target="_blank">https://docs.aws.amazon.com/vpc/latest/userguide/VPC_NAT_Instance.html#EIP_Disable_SrcDestCheck</a><br>
> <br>
> If needed, I can volunteer to update your tutorial / docs with this tiny<br>
> finding of mine (I couldn't find docs contribution guidelines so far).<br>
<br>
It would be greatly appreciated.<br>
You can send the patch to <a href="mailto:pgpool-general@pgpool.net" target="_blank">pgpool-general@pgpool.net</a> or <a href="mailto:pgpool-hackers@pgpool.net" target="_blank">pgpool-hackers@pgpool.net</a>.<br>
Thank you.<br>
<br>
> If you would rather do it yourself when you get a chance, that will be<br>
> fine, too.<br>
><br>
> Thank you so much for being with me all along, yours is truly a great open<br>
> source endeavor!<br>
> It takes grit and dedication to come up with such an ambitious open source<br>
> project and supporting it.<br>
> <br>
> -Nirav<br>
> <br>
> On Wed, Oct 13, 2021 at 7:50 PM Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" target="_blank">niravbhatt.cpp@gmail.com</a>><br>
> wrote:<br>
> <br>
> > Thanks again.<br>
> ><br>
> > I tried the routing approach described today with various values, but no<br>
> > luck yet.<br>
> ><br>
> > aws ec2 create-route --route-table-id rtb-xxxxxx  --destination-cidr-block<br>
> > <a href="http://192.168.50.50/32" rel="noreferrer" target="_blank">192.168.50.50/32</a> --instance-id <i-xxxxxxx>  --region us-east-2<br>
> ><br>
> > The route table used is attached with all 3 subnets where 3<br>
> > pgpool+postgres servers lie.<br>
> ><br>
> > The AWS create-route and replace-route is successful always, but I still<br>
> > can't ping my instance (server1 which is on i-xxxxxxx above) from server2<br>
> > and server3 with:<br>
> ><br>
> > ping 192.168.50.50<br>
> ><br>
> > I also opened my security group for all 3 servers to allow all traffic<br>
> > from <a href="http://192.168.50.50/32" rel="noreferrer" target="_blank">192.168.50.50/32</a>. But no luck.<br>
> > Where am I mistaken?<br>
> ><br>
> > On Wed, Oct 13, 2021 at 10:19 AM Bo Peng <<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>> wrote:<br>
> ><br>
> >> Hello,<br>
> >><br>
> >> > Yes I saw Elastic example already.<br>
> >> > But I don’t want to use it for cost and privacy reasons.<br>
> >> ><br>
> >> > All my servers are in separate subnets but same region.<br>
> >> ><br>
> >> > Any example script of the 3rd option of using routes with private<br>
> >> Virtual<br>
> >> > IP?<br>
> >><br>
> >> Currently we don't have a documetaion of the 3rd option.<br>
> >> We may add more docs or blogs about setting VIP on AWS in the future.<br>
> >><br>
> >> Below is a slide in Japanese.<br>
> >> You can find the setting of route tables in P.44-46.<br>
> >> I hope it could be helpful.<br>
> >><br>
> >><br>
> >> <a href="https://www.sraoss.co.jp/wp-content/uploads/files/event_seminar/material/2017/jpug_20171103_pgpool_aws.pdf" rel="noreferrer" target="_blank">https://www.sraoss.co.jp/wp-content/uploads/files/event_seminar/material/2017/jpug_20171103_pgpool_aws.pdf</a><br>
> >><br>
> >><br>
> >> > Thanks so much for the support...<br>
> >> ><br>
> >> > On Wed, 13 Oct 2021 at 5.39, Bo Peng <<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>> wrote:<br>
> >> ><br>
> >> > > Hello,<br>
> >> > ><br>
> >> > > The settings of delegate_IP, if_up_cmd,if_down_cmd and arping_cmd are<br>
> >> used<br>
> >> > > for on-premises.<br>
> >> > > If you are running your cluster on AWS, you need to configure<br>
> >> > > wd_escalation_command and wd_de_escalation_command.<br>
> >> > ><br>
> >> > > There are several ways to setup virtual IP on AWS.<br>
> >> > ><br>
> >> > > For example:<br>
> >> > > - use an elastic ip<br>
> >> > > – configure Route53<br>
> >> > > – create route tabale for a private VIP<br>
> >> > ><br>
> >> > > The following documetation is using an "elastic ip".<br>
> >> > ><br>
> >> > >   <a href="https://www.pgpool.net/docs/latest/en/html/example-aws.html" rel="noreferrer" target="_blank">https://www.pgpool.net/docs/latest/en/html/example-aws.html</a><br>
> >> > ><br>
> >> > > On Tue, 12 Oct 2021 20:26:04 +0300<br>
> >> > > Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" target="_blank">niravbhatt.cpp@gmail.com</a>> wrote:<br>
> >> > ><br>
> >> > > > Hello,<br>
> >> > > ><br>
> >> > > > Inside my AWS cloud, I have following 3 servers<br>
> >> > > ><br>
> >> > > > (all 3 can reach each other very fine using ping server1, ping<br>
> >> server2,<br>
> >> > > > ping server3 as well as IP address.):<br>
> >> > > ><br>
> >> > > > 10.192.10.10 server1<br>
> >> > > > 10.192.11.20 server2<br>
> >> > > > 10.192.12.30 server3<br>
> >> > > ><br>
> >> > > > 10.192.10.40 Virtual IP (I want this to be private, not elastic<br>
> >> which is<br>
> >> > > > public)<br>
> >> > > ><br>
> >> > > > I was testing the following  if_up_cmd command on server1:<br>
> >> > > ><br>
> >> > > > /usr/bin/sudo /sbin/ip addr add <a href="http://10.192.10.40/32" rel="noreferrer" target="_blank">10.192.10.40/32</a> dev ens5 label<br>
> >> ens5:0<br>
> >> > > ><br>
> >> > > > I could see new IP in the ifconfig result:<br>
> >> > > ><br>
> >> > > > ens5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9001<br>
> >> > > >         inet 10.192.10.10  netmask 255.255.255.0  broadcast<br>
> >> 10.192.10.255<br>
> >> > > >         inet6 fe80::4b0:29ff:fe38:3399  prefixlen 64  scopeid<br>
> >> 0x20<link><br>
> >> > > >         ether 06:b0:29:38:33:99  txqueuelen 1000  (Ethernet)<br>
> >> > > >         RX packets 67233  bytes 67464992 (67.4 MB)<br>
> >> > > >         RX errors 0  dropped 0  overruns 0  frame 0<br>
> >> > > >         TX packets 22922  bytes 5116469 (5.1 MB)<br>
> >> > > >         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0<br>
> >> > > ><br>
> >> > > > ens5:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9001<br>
> >> > > >         inet 10.192.10.40  netmask 255.255.255.255  broadcast<br>
> >> > > 10.192.10.255<br>
> >> > > >         ether 06:b0:29:38:33:99  txqueuelen 1000  (Ethernet)<br>
> >> > > ><br>
> >> > > > lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536<br>
> >> > > >         inet 127.0.0.1  netmask 255.0.0.0<br>
> >> > > >         inet6 ::1  prefixlen 128  scopeid 0x10<host><br>
> >> > > >         loop  txqueuelen 1000  (Local Loopback)<br>
> >> > > >         RX packets 39948  bytes 13976834 (13.9 MB)<br>
> >> > > >         RX errors 0  dropped 0  overruns 0  frame 0<br>
> >> > > >         TX packets 39948  bytes 13976834 (13.9 MB)<br>
> >> > > >         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0<br>
> >> > > ><br>
> >> > > > However, after running the ip addr add, I can not ping the new<br>
> >> elastic IP<br>
> >> > > > 10.192.10.40 from other servers. Only server1 has successful ping.<br>
> >> > > ><br>
> >> > > > I tried running arping past the above, but that is also failing.<br>
> >> > > ><br>
> >> > > > arping -U 10.192.10.40 -w 1 -I ens5:1<br>
> >> > > ><br>
> >> > > > I tried adding and deleting several times, with different IP<br>
> >> combinations<br>
> >> > > > also to suit different AWS subnets, but no result. Server2 and<br>
> >> server3<br>
> >> > > > can't simply reach it.<br>
> >> > > ><br>
> >> > > > My system is Ubuntu, the AMI is following, in case it helps:<br>
> >> > > > ubuntu/images/hvm-ssd/ubuntu-focal-20.04-arm64-server-20211001<br>
> >> > > ><br>
> >> > > > Thanks for the support!<br>
> >> > > > -Nirav<br>
> >> > ><br>
> >> > ><br>
> >> > > --<br>
> >> > > Bo Peng <<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>><br>
> >> > > SRA OSS, Inc. Japan<br>
> >> > > <a href="http://www.sraoss.co.jp/" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/</a><br>
> >> > ><br>
> >><br>
> >><br>
> >> --<br>
> >> Bo Peng <<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>><br>
> >> SRA OSS, Inc. Japan<br>
> >> <a href="http://www.sraoss.co.jp/" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/</a><br>
> >><br>
> ><br>
<br>
<br>
-- <br>
Bo Peng <<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>><br>
SRA OSS, Inc. Japan<br>
<a href="http://www.sraoss.co.jp/" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/</a><br>
</blockquote></div>