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

 <sect1 id="install-rpm">
  <title>Installation from RPM</title>
   <para>
     This chapter describes the installation
     of <productname>Pgpool-II</productname> from PRM.  If you are
     going to install from the source code, please
     check <xref linkend="install-source">.
   </para>

   <sect2 id="installing-rpm">
     <title>Installing RPM</title>
   <para>
     <productname>Pgpool-II</productname> official RPMs can be
     obtained from
     <ulink url="http://www.pgpool.net/yum">http://www.pgpool.net/yum</ulink>.
   </para>

   <para>
     For RHEL and its derivatives do following once:
     <programlisting>
yum install http://www.pgpool.net/yum/rpms/3.6/redhat/rhel-7-x86_64/pgpool-II-release-3.6-1.noarch.rpm
     </programlisting>
     Then:
     <programlisting>
yum install pgpool-II-pg96
     </programlisting>

     <literal>pg96</literal> means <literal>PostgreSQL
     9.5</literal>. <productname>Pgpool-II</productname>
     needs <productname>PostgreSQL</productname>'s library and
     extensions directory. Since the directory paths are different in
     the particular <productname>PostgreSQL</productname> versions,
     You must choose appropriate RPM for
     your <productname>PostgreSQL</productname> rpm installation. We
     also assume you are
     using <ulink url="https://www.postgresql.org/download/linux/redhat/"><productname>PostgreSQL</productname>
     community rpms</ulink>.

     Optionally you can install:
     <programlisting>
yum install pgpool-II-pg96-debuginfo
     </programlisting>
     which makes it easier to retrieve debugging symbols from the core
     or the backtrace. We recommend to install it.

     There is an optional package for developers.
     <programlisting>
yum install pgpool-II-pg96-devel
     </programlisting>
     This installs header files which developers are interested in
   </para>

   <para>
     On all the <productname>PostgreSQL</productname> servers you need
     to install:
     <programlisting>
yum install pgpool-II-pg96-extensions
     </programlisting>

   </para>
   </sect2>

   <sect2 id="configure-rpm">
     <title>Configuration with RPM</title>
   <para>
     All the <productname>Pgpool-II</productname> configuration files
     live in <filename>/etc/pgpool-II</filename>. Please refer
     to <xref linkend="setting-up-pgpool-conf"> to see how to set up
     configuration files.
   </para>
   </sect2>

   <sect2 id="start-rpm">
     <title>Starting/stopping Pgpool-II</title>
     <para>
       On RHEL7/CentOS 7, do this once.

       <programlisting>
systemctl enable pgpool.service
       </programlisting>

       After this, restart the whole system or:

       <programlisting>
systemctl start pgpool.service 
       </programlisting>

       Please note that <productname>PostgreSQL</productname> servers
       must have been started before this.

       To stop <productname>Pgpool-II</productname>:
       <programlisting>
systemctl stop pgpool.service 
       </programlisting>

       After this, you can stop <productname>PostgreSQL</productname>
       servers.
     </para>
     <para>
       On RHEL6/CentOS 6, do this once.

       <programlisting>
chkconfig pgpool on
       </programlisting>

       After this, restart the whole system or:

       <programlisting>
service start pgpool
       </programlisting>

       Please note that <productname>PostgreSQL</productname> servers
       must have been started before this.

       To stop <productname>Pgpool-II</productname>:
       <programlisting>
service stop pgpool
       </programlisting>

       After this, you can stop <productname>PostgreSQL</productname>
       servers.
     </para>

   </sect2>

 </sect1>
