第一次链接云服务器操作
链接云服务器
ssh-copy-id -i ~/.ssh/id_rsa.pub root@xxxxx007
password(手动输入,第一次):
xxxxxxx
登录或者退出
以后每次登录
ssh root@xxxxx007
退出或者直接关闭
exit
安装软件
//按照下面每行一步一步来,底下是注释
wget https://ftp.postgresql.org/pub/source/v9.4.6/postgresql-9.4.6.tar.bz2
tar -jxvf postgresql-9.4.6.tar.bz2
cd postgresql-9.4.6
//wget 是一个从网络上自动下载文件的自由工具
./configure --prefix=/home/postgres/pgsql9.4.6 --with-blocksize=8 --with-wal-blocksize=8
//配置(configure)
gmake -j 32 world
gmake install-world
运行第二步后报错如下
configure: error: readline library not found
//解决:yum -y install -y readline-devel
configure: error: zlib library not found
//解决: yum install zlib-devel
配置环境变量(跟官网文档相比,有区别)
vi ~/env_pg.sh
#export PS1="$USER@\`/bin/hostname -s\`-> "
export PGPORT=1921
export PGDATA=/data01/pgdata
export LANG=en_US.utf8
export PGHOME=/home/postgres/pgsql9.4.6
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 PATH=$PGHOME/bin:$PATH:.
export MANPATH=$PGHOME/share/man:$MANPATH
export PGHOST=$PGDATA
export PGDATABASE=postgres
export PGUSER=postgres
alias rm='rm -i'
alias ll='ls -lh'
unalias vi
```
postgres@digoal-> . ./env_pg.sh
-bash: unalias: vi: not found
postgres@digoal-> psql -V
psql (PostgreSQL) 9.4.6
“`
参考文献