Install on CnetOS

This document describes how to install PGroonga on CentOS.

Supported versions

Here are supported CentOS versions:

How to install on CentOS 5

You can use the following instruction to install PGroonga on CentOS 5.

Install postgresql-pgroonga package:

% sudo -H yum install -y http://yum.postgresql.org/9.6/redhat/rhel-$(rpm -qf --queryformat="%{VERSION}" /etc/redhat-release)-$(rpm -qf --queryformat="%{ARCH}" /etc/redhat-release)/pgdg-centos96-9.6-3.noarch.rpm
% wget http://packages.groonga.org/centos/groonga-release-1.2.0-1.noarch.rpm
% sudo -H yum install -y --nogpgcheck groonga-release-1.2.0-1.noarch.rpm
% sudo -H yum install -y postgresql96-pgroonga

If you want to use MeCab based tokenizer, you also need to install groonga-tokenizer-mecab package:

% sudo -H yum install -y groonga-tokenizer-mecab

Run PostgreSQL:

% sudo -H /sbin/service postgresql-9.6 initdb
% sudo -H /sbin/chkconfig postgresql-9.6 on
% sudo -H /sbin/service postgresql-9.6 start

Create a database:

% sudo -u postgres -H psql --command 'CREATE DATABASE pgroonga_test'

(Normally, you should create a user for pgroonga_test database and use the user. See GRANT USAGE ON SCHEMA pgroonga for details.)

Connect to the created database and execute CREATE EXTENSION pgroonga:

% sudo -u postgres -H psql -d pgroonga_test --command 'CREATE EXTENSION pgroonga'

That's all!

Try tutorial. You can understand more about PGroonga.

How to install on CentOS 6

You can use the following instruction to install PGroonga on CentOS 6.

Install postgresql-pgroonga package:

% sudo -H yum install -y http://yum.postgresql.org/9.6/redhat/rhel-$(rpm -qf --queryformat="%{VERSION}" /etc/redhat-release)-$(rpm -qf --queryformat="%{ARCH}" /etc/redhat-release)/pgdg-centos96-9.6-3.noarch.rpm
% sudo -H yum install -y http://packages.groonga.org/centos/groonga-release-1.2.0-1.noarch.rpm
% sudo -H yum install -y postgresql96-pgroonga

If you want to use MeCab based tokenizer, you also need to install groonga-tokenizer-mecab package:

% sudo -H yum install -y groonga-tokenizer-mecab

Run PostgreSQL:

% sudo -H /sbin/service postgresql-9.6 initdb
% sudo -H /sbin/chkconfig postgresql-9.6 on
% sudo -H /sbin/service postgresql-9.6 start

Create a database:

% sudo -u postgres -H psql --command 'CREATE DATABASE pgroonga_test'

(Normally, you should create a user for pgroonga_test database and use the user. See GRANT USAGE ON SCHEMA pgroonga for details.)

Connect to the created database and execute CREATE EXTENSION pgroonga:

% sudo -u postgres -H psql -d pgroonga_test --command 'CREATE EXTENSION pgroonga'

That's all!

Try tutorial. You can understand more about PGroonga.

How to install on CentOS 7

You can use the following instruction to install PGroonga on CentOS 7.

Install postgresql-pgroonga package:

% sudo -H yum install -y http://yum.postgresql.org/9.6/redhat/rhel-$(rpm -qf --queryformat="%{VERSION}" /etc/redhat-release)-$(rpm -qf --queryformat="%{ARCH}" /etc/redhat-release)/pgdg-centos96-9.6-3.noarch.rpm
% sudo -H yum install -y http://packages.groonga.org/centos/groonga-release-1.2.0-1.noarch.rpm
% sudo -H yum install -y epel-release
% sudo -H yum install -y postgresql96-pgroonga

If you want to use MeCab based tokenizer, you also need to install groonga-tokenizer-mecab package:

% sudo -H yum install -y groonga-tokenizer-mecab

Run PostgreSQL:

% sudo -H /usr/pgsql-9.6/bin/postgresql96-setup initdb
% sudo -H systemctl enable postgresql-9.6
% sudo -H systemctl start postgresql-9.6

Create a database:

% sudo -u postgres -H psql --command 'CREATE DATABASE pgroonga_test'

(Normally, you should create a user for pgroonga_test database and use the user. See GRANT USAGE ON SCHEMA pgroonga for details.)

Connect to the created database and execute CREATE EXTENSION pgroonga:

% sudo -u postgres -H psql -d pgroonga_test --command 'CREATE EXTENSION pgroonga'

That's all!

Try tutorial. You can understand more about PGroonga.