postgresql中装gis插件_PostgreSQL&PostGIS完全安装

本文档详细介绍了在Linux系统中安装PostgreSQL数据库及PostGIS地理信息系统插件的步骤,包括创建用户、调整系统参数、安装依赖、编译安装PostgreSQL和PostGIS、设置环境变量以及配置为系统服务。通过此教程,读者可以成功搭建具备GIS功能的数据库环境。
摘要由CSDN通过智能技术生成

检查PostGIS、PostgreSQL、GEOS、GDAL、PROJ等各软件的版本依赖关系

1. 创建postgres用户和组

# groupadd -g 101dba

# useradd-u 501 -g dba -G root -d /usr/local/pgsql postgres

2. 添加postgres用户环境变量

$ cat ~/.bash_profile

# .bash_profile

# Get the aliases and functionsif [ -f ~/.bashrc ]; then.~/.bashrcfi# User specific environment and startup programs

export PGHOME=/usr/local/pgsql

export PGDATA=/usr/local/pgsql/data

export 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

export DATE=`date +"%Y%m%d%H%M"`

export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S>"

3. 调整系统参数

# tail -n 12 /etc/sysctl.conf

vm.overcommit_memory=1vm.overcommit_ratio=90fs.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 1280kernel.shmall=5242880kernel.shmmax=12884901888#tail -n 4 /etc/security/limits.conf

postgres soft nproc8192postgres hard nproc16384postgres soft nofile4096postgres hard nofile65536

4. 安装依赖包

# yum install -y python-devel perl-ExtUtils-Embed python-devel gcc-c++ openssl-devel readline readline-devel bzip2 zlib zlib-devel openssl openssl-devel pam pam-devel libxml2 libxml2-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 unixODBC unixODBC-devel libpng12 libpng12-devel

5. 安装PostgreSQL

修改源码文件s

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值