Postgresql&postgis Fully installed

Source: Internet
Author: User
Tags bz2 postgresql psql readline openldap postgis

1. Create Postgres Users and Groups

101501 -G dba-g root-d/usr/local/pgsql Postgres

2. Add Postgres User Environment variables

cat ~/. bash_profile#. bash_profile# Get the aliases and functionsifthen     ~/. BASHRCfi# User specific environment and startup Programsexport Pghome=/usr/local/ pgsqlexport PGDATA=/usr/local/pgsql/dataexport PATH= $PGHOME/bin: $PATH: $HOME/bin
Export ld_library_path= $PGHOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib: $LD _library_ PATH

3. Adjusting system parameters

#Tail-N A/etc/sysctl.confvm.overcommit_memory=1Vm.overcommit_ratio= -Fs.aio-max-nr=1048576FS.file-max=7672460Net.ipv4.ip_local_port_range=9000 65500Net.core.rmem_default=262144Net.core.rmem_max=4194304Net.core.wmem_default=262144Net.core.wmem_max=1048586Kernel.sem=50100 64128000 50100  theKernel.shmall=5242880Kernel.shmmax=12884901888# Tail-N4/etc/security/Limits.confpostgres Soft Nproc8192Postgres Hard Nproc16384Postgres Soft Nofile4096Postgres Hard Nofile65536

4. Install Python

wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgztar -zxf python-2.7.  - . tgz# CD Python-2.7.  - # . /configure--enable-make doinstall/usr/local /bin/python--2.7.  -

5. Installing dependent Packages

Yum Install Perl gcc-c++ openssl-devel readline readline-devel zlib zlib-devel OpenSSL openssl-devel Pam Pam-devel libxml2 libxml 2-devel libxslt libxslt-devel openldap openldap-devel libgeos-dev libproj-dev libgdal-dev xsltproc docbook-xsl Docbook-xml ImageMagick Libmagickcore-dev Dblatex tcl Tcl-devel

6. Installing PostgreSQL

$wgetHttps//ftp.postgresql.org/pub/source/v9.5.7/postgresql-9.5.7.tar.bz2$Tar-JXF postgresql-9.5.7.Tar. bz2$ CD PostgreSQL-9.5.7$ ./configure-prefix=/usr/local/pgsql--with-Perl--WITH-TCL--with-openssl--with-pam--with-libxml--with-libxslt--with-wal-segsize= +$  Make$  Make Install$ CD Contrib/$  Make&& Make Install$ mkdir/usr/local/pgsql/{data,arch}$sudo Echo "su-postgres-c ' pg_ctl start-d/usr/local/pgsql/data '">>/etc/rc.local$/usr/local/pgsql/bin/initdb-d/usr/local/pgsql/data/$ Cat/usr/local/pgsql/data/postgresql.conf |grep-V"^$"|grep-V"^#"listen_addresses='*'# What IP address (es) to listen On;port=5432# (change requires restart) max_connections= -# (change requires restart) Shared_buffers=2048MB # min 128kblogging_collector=On # Enable capturing of stderr and Csvloglog_directory='Pg_log'# directory where log files are written,log_filename='Postgresql-%y-%m-%d_%h%m%s.log'# logfilename pattern,$Cat/usr/local/pgsql/data/pg_hba.conf |grep-V"^$"|grep-V"^#"Local all Trusthost all127.0.0.1/ +Trusthost All0.0.0.0/0md5host All::1/ -trust$ pg_ctl Start-W$ psql Psql (9.5.7) Type" Help"  forHelp.postgres=#Selectversion (); Version----------------------------------------------------------------------------------------------------------PostgreSQL9.5.7On X86_64-pc-linux-gnu, compiled byGCC(GCC)4.4.7 20120313(Red Hat4.4.7- -), --bit (1Row

Postgresql&postgis Fully installed

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.