<!-- doc/src/sgml/installation-tips.sgml -->

 <sect1 id="installation-tips">
 <title>Tips for Installation</title>
 <para>
  This chapter gathers random tips for installing <productname>Pgpool-II</productname>.
 </para>

 <sect2 id="firewall">
  <title>Firewalls</title>
  <para>
   When <productname>Pgpool-II</productname> connects to
   other <productname>Pgpool-II</productname> servers
   or <productname>PostgreSQL</productname> servers, the target port
   must be accessible by enabling firewall management softwares.
  </para>

  <para>
   First, allow to access port that <productname>Pgpool-II</productname> use.

   In the example below, let <link linkend="guc-port">Pgpool-II listen
   port number</link> be 9999, <link linkend="guc-pcp-port">PCP listen
   port number</link> be 9898, <link linkend="guc-wd-port">watchdog
   listen port number</link> be 9000 and <link
   linkend="guc-heartbeat-port">heartbeat listen port number</link> be
   9694.  Notice that only heartbeat port uses UDP and others use TCP.

   <programlisting>
    firewall-cmd --permanent --zone=public --add-port=9999/tcp --add-port=9898/tcp --add-port=9000/tcp
    firewall-cmd --permanent --zone=public --add-port=9694/udp
    firewall-cmd --reload
   </programlisting>
  </para>

  <para>
   Here is an example for Rocky Linux/RHEL10 when access
   to <productname>PostgreSQL</productname> is required.

   <programlisting>
    firewall-cmd --permanent --zone=public --add-service=postgresql
    firewall-cmd --reload
   </programlisting>
   "postgresql" is the service name assigned
   to <productname>PostgreSQL</productname>. The list of service
   names can be obtained by:
   <programlisting>
    firewall-cmd --get-services
   </programlisting>
   Note that you can define your own service name in
   /usr/lib/firewalld/services/.
  </para>

  <para>
   If <productname>PostgreSQL</productname> is listening on 11002
   port, rather than the standard 5432 port, you can do:
   <programlisting>
    firewall-cmd --zone=public --remove-service=postgresql --permanent
    firewall-cmd --zone=public --add-port=11002/tcp --permanent
    firewall-cmd --reload
   </programlisting>
  </para>

 </sect2>

 </sect1>
