首页 > 数据库 >postgresql-安装过程

postgresql-安装过程

时间:2023-07-07 21:12:22浏览次数:38  
标签:opt core postgresql postgres 过程 export net 安装

1、初始化系统配置

# useradd -d /opt/postgres postgres
# yum groupinstall -y "Development Tools" "Legacy UNIX Compatibility" -y
# yum install -y bison flex readline* zlib-devel gcc* gmake -y
# mkdir /pgdata
# mkdir /archive
# chown postgres.postgres /pgdata/ -R
# chown postgres.postgres /archive/ -R
# vim /etc/sysctl.conf 
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.shmmni = 4096
kernel.sem = 50100 64128000 50100 1280
fs.file-max = 7672460
net.ipv4.ip_local_port_range = 9000 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576

# sysctl -p
# vim /etc/security/limits.conf 
* soft nofile 131072
* hard nofile 131072
* soft nproc 131072
* hard nproc 131072
* soft core unlimited
* hard core unlimited
* soft memlock 50000000
* hard memlock 50000000

2、安装postgresql数据库

# tar -zxvf postgresql-12.6.tar.gz 
# cd postgresql-12.6
# ./configure --prefix=/opt/postgres/ --with-pgport=1921
# gmake world
# gmake install-world
# chown postgres.postgres /opt/postgres/ -R
# su - postgres
$ vim .bash_profile 
export PGDATA=/pgdata
export PGHOME=/opt/postgres
export LD_LIBRARY_PATH=${PGHOME}/lib:${LD_LIBRARY_PATH}
export DATE=$(date +"%y%m%d%H%M")
export PATH=${PGHOME}/bin:${PATH}
export MANPATH=${PGHOME}/share/man:${MANPATH}
export PGUSER=postgres

$ source .bash_profile  
$ psql --version
## 初始化数据
$ initdb -A md5 -D ${PGDATA} -E utf8 --locale=C -W
## 启动数据库 
$ pg_ctl -D /pgdata -l logfile start

$ psql
Password for user postgres: 
psql (12.6)
Type "help" for help.

标签:opt,core,postgresql,postgres,过程,export,net,安装
From: https://www.cnblogs.com/zbc230/p/17536074.html

相关文章

  • Ubuntu23.04 anaconda安装+国内源
    anaconda安装下载官网https://repo.anaconda.com/archive/国内镜像https://mirrors.bfsu.edu.cn/anaconda/archive/https://mirrors.xjtu.edu.cn/anaconda/archive/https://mirror.bjtu.edu.cn/anaconda/archive/https://mirrors.hit.edu.cn/anaconda/archive/https:/......
  • PostgreSQL向量数据库pgvector之ivfflat实践
    前言ChatGPT、OpenAI和大型语言模型(LLM)应用的不断普及,将近似近邻搜索(ANN)的概念推向了前沿,并由于嵌入的使用,引发了人们对向量数据库的重新关注。嵌入是短语的数学表示,它将语义捕捉为数值的向量量,鉴于嵌入通常由一千多个维度组成--OpenAI的维度为1,536,因此必须开发新的技术。目前还没......
  • Linux中Postfix邮件安装配置(二)
    摘自:http://www.ywnds.com/?p=1764Postfix安装配置本套邮件系统的搭建,从如何发邮件到收邮件到认证到虚拟用户虚拟域以及反病毒和反垃圾邮件等都有详细的介绍。在搭建过程中必须的参数解释以及原理都有告诉,这样才能更好地理解邮件系统。一、卸载自带postfix 123......
  • PostgreSQL 16.2安装
    1、postgresql安装-软件包安装 1.1下载安装包,官网下载地址:https://www.postgresql.org/download/。 如果服务器有网络,可以选择yum安装。在服务器没有网络的情况下,需要先下载rpm包,我们选择这种方式。 现在最新版本是PostgreSQL16.2,2023-06-29:postgresql16-16-beta2_1......
  • MySQL存储过程带参和不带参数(转载)
    笔记:(1)存储过程的传入参数IN需求:编写存储过程,传入uid,返回该用户的unamedelimiter$$createproceduretesta(my_uidint)begindeclaremy_unamevarchar(32)default'';selectunameintomy_unamefromuserswhereuid=my_uid;selectmy_uname;end;$$delimiter......
  • 利用Docker安装Airflow
    mkdirairflowcdairflowmkdir-p./dags./logs./pluginsecho-e"AIRFLOW_UID=$(id-u)">.envwgethttps://airflow.apache.org/docs/apache-airflow/2.5.0/docker-compose.yamlsudoaptinstalldocker-composedocker-composeup在浏览器中,输入l......
  • 在MAC OS上的vscode 安装java开发环境
    在MacOS上安装vscode的java开发环境.按照vscode的官方说明安装Java相关插件,遇见下列问题并解决了.安装JDK环境安装ExtensionPackforJava 插件后,vscode会提示你安装一个java,我安装提示安装了java.后来才发现安装的是jre,并不是JDK.还是需要去oracle或者micorsoft网......
  • Debian 12安装配置Apache2.4 + PHP8.0 + MySQL5.7常见问题记录
    1.Apache2.4安装1.1浏览器访问提示502错误正常通过sudoaptinstallapache2安装,安装完成通过systemctlstatusapache2查看运行状态正常,但浏览器访问IP地址提示502错误解决:问题大概率出自服务器防火墙#查看防火墙规则列表sudoufwapplist#Web服务器相关条目#>WW......
  • AI 绘画| Stable Diffusion 最新版安装包,包含 WIN/MAC 版!
    StableDiffusion大概是时下最流行的两个项目之一,另外一个就是大名鼎鼎的ChatGPT,AI绘图现在已经是非常成熟,相信很多做设计的朋友都知道StableDiffusion,只需要描述一段文字,它就能帮你生成一张图片。今天给大家分享最新版的StableDiffusion安装包,对于想要入门折腾StableD......
  • Docker安装Nacos并以单例模式运行
    Nacos单例模式运行使用嵌入式数据库即可,这里不依赖于mysql。拉取指定版本Nacos镜像:dockerpullnacos/nacos-server:2.0.3查看镜像列表:dockerimages以单例模式启动:dockerrun-d--namenacos-p8848:8848-eMODE=standalonenacos/nacos-server:2.0.3查看容器列表......