Posted bytrepik on July 28, 2016July 28, 2016
In the first part of my series on Software Collections (SCL), I gave general information and listed thethree steps needed to get started with SCL for a number of languages. This post covers the steps for PostgreSQL and MongoDB.
Enable the SCL repositoryThe first step is to enable the SCL software repository if you haven’t already done so. As the root user run:
# subscription-manager repos --enable rhel-server-rhscl-7-rpmsNow onto installing the database software.
PostgreSQLPostgreSQL is a powerful open source, object-relational, ACID compliant, database system. PostgreSQL runs on all major operating systems.Its key features are reliability, data integrity and correctness. Recently PostgreSQL 9.5 was released as part of Red Hat Software Collections (RHSCL) 2.2. A number of earlier releases (9.2 and 9.4) are also available from RHSCL.
To install the PostgreSQL 9.5 collection, run the following command as the root user:
# yum install rh-postgresql95Now setup PostgreSQL and create the initial database. First use scl enable to add PostgreSQL to the root user’s environment, then run setup.
# scl enable rh-postgresql95 bash # postgresql-setup --initdbNow start the PostgreSQL server and enable it to start up when your system boots:
# systemctl start rh-postgresql95-postgresql # systemctl enable rh-postgresql95-postgresqlTo run psql as the postgres user, you need to use su as well as scl enable in order to setup that user’s environment.
# su - postgres -c 'scl enable rh-postgresql95 -- psql' PostgreSQL software collections as a docker formatted container imageLast but not least, you can try PostgreSQL9.5 in a docker container. On Red Hat Enterprise linux 7, you can get the image with the following commands:
$ docker pull registry.access.redhat.com/rhscl/postgresql-95-rhel7 More informationTo see what packages were installed as part of the rh-postgresql95 collection, and what others are available:
# yum list rh-postgresql95\*Note: The rh-postgresql95 collection includes the PostgreSQL server components and related client tools that match the specific server version. When building and installing client applications, it is recommended to use the the postgresql-libs package available as part of the base Red Hat Enterprise Linux system.
# yum install postgresql-libsFor more information see:
Red Hat Software Collections 2.2 Release Notes Software Collections on developers.redhat.com PostgreSQL.org the upstream,open-source community for PostgreSQL MongoDBMongoDB is a cross-platform, open-source, document database designed for ease of development and scaling. Recently MongoDB 3.2 was released as part of Red Hat Software Collections (RHSCL) 2.2. A number of earlier releases (2.4, 2.6, and 3.0) are also available from RHSCL.
To install the MongoDB 3.2 collection, run the following command as the root user:
# yum install rh-mongodb32 rh-mongodb32-mongodbNow start the mongodserver and enable it to start up when your system boots. First you will need to use scl enable to add MongoDBto the root user’s environment:
# scl enable rh-mongodb32 bash # systemctl start rh-mongodb32-mongod # systemctl enable rh-mongodb32-mongodTo start using MongoDB, use scl enable to add it to your environment and run a bash shell:
$ scl enable rh-mongodb32 bashYou can now run the mongo client:
$ mongo MongoDB 3.2software collections as a docker formatted container imageLast but not least, you can try MongoDB 3.2 in a docker container. On Red Hat Enterprise Linux 7, you can get the image with the following commands:
$ docker pull registry.access.redhat.com/rhscl/mongodb-32-rhel7 More informationThe collection rh-mongodb32 delivers version 3.2 of the MongoDB server,related client tools and mongo-java-driver to connect to MongoDB server in Java.To see what packages were installed as part of the rh-mongodb32 collection, and what others are available:
# yum list rh-mongodb32\*For more information see:
Red Hat Software Collections 2.2 Release Notes Software Collections on developers.redhat.com MongoDB.org ,the upstream,open-source community forMongoDBLinks to other parts:
Introduction part 1
JoinRed Hat Developers, a developer program for you to learn, share, and code faster and get access to Red Hat software for your development. The developer program and software are both free!
Take advantage of your Red Hat Developers membership anddownload RHEL today at no cost.