编译安装postgresql

一、PostgreSQL编译安装 PostgreSQL整个编译安装详细过程,以及如何安装pageinspect等扩展插件。 阅读详情

编译安装postgresql

一、关闭防火墙

systemctl status firewalld.service

systemctl stop firewalld.service

systemctl disable firewalld.service

setenforce 0

sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

二、配置参数

cat > /etc/sysctl.conf <<"EOF"

vm.swappiness=10

vm.zone_reclaim_mode=0

fs.aio-max-nr = 1048576

fs.file-max = 6815744

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048586

kernel.shmmax = 1288490188

kernel.shmall = 314572

kernel.shmmni = 4096

kernel.sem = 50100 64128000 50100 1280

EOF

生效 sysctl -p

cat >> /etc/security/limits.conf <<"EOF"

* soft nofile 131072

* hard nofile 131072

* soft nproc 131072

* hard nproc 131072

* soft core unlimited

* hard core unlimited

* soft memlock 50000000

* hard memlock 50000000

EOF

echo "* - nproc unlimited" > /etc/security/limits.d/90-nproc.conf

echo "session required pam_limits.so" >> /etc/pam.d/login

三、关闭THP

vi /etc/rc.local最后添加如下代码

if test -f /sys/kernel/mm/transparent_hugepage/enabled; then

echo never > /sys/kernel/mm/transparent_hugepage/enabled

fi

if test -f /sys/kernel/mm/transparent_hugepage/defrag; then

echo never > /sys/kernel/mm/transparent_hugepage/defrag

fi

执行授权

chmod +x /etc/rc.d/rc.local

echo never > /sys/kernel/mm/transparent_hugepage/enabled

echo never > /sys/kernel/mm/transparent_hugepage/defrag

cat /sys/kernel/mm/transparent_hugepage/enabled

cat /sys/kernel/mm/transparent_hugepage/defrag

四、源码安装

4-1)源码包

https://ftp.postgresql.org/pub/source/v14.4/postgresql-14.4.tar.gz

4-2)安装依赖

yum install -y cmake make gcc zlib zlib-devel gcc-c++ perl readline readline-devel  \

python36 tcl openssl ncurses-devel openldap pam flex

五、创建用户&目录

groupadd postgres

useradd postgres -g postgres

echo "postgres" | passwd --stdin postgres

chown postgres.postgres /home/postgres/.bash_profile

mkdir -p /postgresql/{pgdata,archive,scripts,backup,pg14,soft}

 chown -R postgres:postgres /postgresql

 chmod -R 775 /postgresql

六、编译安装

su - postgres

cd /postgresql/soft

 tar zxvf postgresql-14.4.tar.gz

 cd postgresql-14.4

 ./configure --prefix=/postgresql/pg14

 make -j 16 && make install

vi  ~/.bash_profile

 export PGPORT=5432

 export PGDATA=/postgresql/pgdata

 export PGHOME=/postgresql/pg14

 export LD_LIBRARY_PATH=$PGHOME/lib:$LD_LIBRARY_PATH

 export PATH=$PGHOME/bin:$PATH:.

 export PGHOST=$PGDATA

 export PGUSER=postgres

 export PGDATABASE=postgres

生效source  ~/.bash_profile

七、初始化数据库

su - postgres

 /postgresql/pg14/bin/initdb -D /postgresql/pgdata -E UTF8 --locale=en_US.utf8 -U postgres

修改参数 vi  /postgresql/pgdata/postgresql.conf 在文件最后加入就行

listen_addresses='*'

port=5432

unix_socket_directories='/postgresql1313/pgdata'

logging_collector=on

log_directory='pg_log'

log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'

log_truncate_on_rotation=on

log_destination = 'csvlog'

log_file_mode = 0600

log_rotation_age = 10d

log_rotation_size = 100MB

修改参数 vi /postgresql/pgdata/pg_hba.conf

host    all             all             0.0.0.0/0            trust

host    replication     all             0.0.0.0/0            trust

八、启动数据库

su - postgres

 pg_ctl start

 pg_ctl status

pg_ctl reload

登录pg设置登录账号

alter user postgres with password 'Hello@123';

 

Postgres 源码编译安装 基于 WSL 安装的 Debian 操作系统 源码编译安装 Postgres 阅读详情

相关推荐

OpenBSD76编译安装postgresql17

OpenBSD76编译安装postgresql17

m0_38133511的博客 1093

PostgreSQL 编译安装通用步骤

postgresql,源码编译,通用步骤

丘处机的专栏 3392

Ubuntu上编译安装PostgreSQL

Ubuntu 从源码安装编译 PostgreSQL

PythonShell 随笔 2003

【数据库】PostgreSQL源码编译安装方式与简单配置(v16.2)

Windows环境下的安装是比较简单的,只需要运行图形界面,在安装的过程中基本上只需要点选“Next”项就可以完成安装。Linux环境下PostgreSQL的安装方式则是使用相应发行版本的包管理器来进行。从发行版本安装的PostgreSQL一般不是最新版本,如果想安装最新版本的PostgreSQL,需要使用下面介绍的源码安装方法。从源码安装的编译安装过程如下。第一步,下载源代码。第二步,编译安装,过程与Linux下其他软件的编译安装过程相同,都是“三板斧”:make。

FixPng的博客 5456

FreeBSD14编译安装postgresql16

FreeBSD14编译安装postgresql16

m0_38133511的博客 1221

debain12编译安装postgresql16

debain12编译安装postgresql16

m0_38133511的博客 1604

PostgreSQL编译安装教程

注意,如果pgdata目录没有指定,则会默认使用环境变量中的PGDATA指定的目录作为数据库存放的目录,由于之前我们刚刚设置了"PGDATA=/usr/local/pgsql/data"环境变量,所以此处我们也就无需再额外指定,直接执行初始化命令即可。目录里"linux"文件就是我们要找的文件。完成以后,在"--prefix=/usr/local/pgsql"参数对应的"/usr/local/pgsql"的目录就是我们所有PostgreSQL存放的文件,这里的这个data和log文件现在是没有的。

Eucalyptus's blog 2164

告别手动归档:基于Allegro Skill的XTools一键生成Gerber与生产文件实践

本文详细介绍了基于Allegro Skill的XTools工具如何实现一键生成Gerber与生产文件,大幅提升PCB设计效率。通过自动化流程,解决了传统手动归档中的重复劳动、人为失误和标准不统一等问题,特别适合需要频繁输出生产文件的工程师。文章包含安装配置、实战操作、问题排查及进阶技巧,帮助用户快速掌握这一高效工具。

weixin_30505225的博客 460

PostgreSQL源码编译安装

本文详细介绍了PostgreSQL 17.6的源码编译安装过程。首先从官网下载源码包并解压,然后通过配置参数指定安装路径和功能支持(如OpenSSL、XML、Systemd等)。在编译过程中,系统会提示缺少各种依赖包(如gcc、ICU库、bison、flex、Perl、readline、zlib等),需要依次安装这些依赖项。最后执行make -j $(nproc) world和make install-world完成编译安装。整个过程展示了在Linux系统上从源码构建PostgreSQL所需的完整步骤和可能

Raymond的博客 838

Figma入门-自动布局

Figma原型图制作内置组件友好,自动布局类似CSS flex,通过布局网格控制对齐、分布、换行等,前端熟悉的同学易上手,参数设置基本一致。

我码玄黄的博客 2173

LangGraph实战:如何用循环机制优化你的LangChain Agent工作流

本文详细介绍了如何使用LangGraph的循环机制优化LangChain Agent工作流,解决传统AgentExecutor在强制工具调用、动态提示调整和多阶段循环中的局限性。通过状态机和显式状态图设计,LangGraph提供了更精准的流程控制能力,适用于复杂AI应用场景。

weixin_30316097的博客 486

postgresql 17编译安装详解与实战

-auth-local=authmethod 连接的本地用户指定在pg_hba.conf中使用的认证方法 这个选项为通过 Unix 域套接字连接的本地用户指定在pg_hba.conf中使用的认证方法 (local行)。此外,在具有大量WAL的数据库中,每个目录的WAL文件的绝对数量可以成为一个性能和管理问题。如果--locale-provider是内置的,那么必须指定--locale或--built –locale必须指定并设置为C或C.UTF-8。这也将是后来创建的任何数据库的默认编码,除非你覆盖它。

xudajian的专栏 2300

两轮差速机器人运动学模型

两轮差速底盘 1.1、底盘说明 两轮差速底盘由两个动力轮位于底盘左右两侧,两轮独立控制速度,通过给定不同速度实现底盘转向控制。一般会配有一到两个辅助支撑的万向轮。 主要底盘有: 1、Turtlebot; 2、扫地机器人; 3、无人仓AGV小车; 4、轮椅; 底盘主要特点: 1、控制简单、里程计计算简单。 2、只能给定X方向速度、Z轴方向角速度。 1.2、底盘运动学分析 1.2.1、底盘模型 图1.2.1 常见的两轮差速底盘模型 1.2.2、机器人本身约束方程(物理特性) 图1.2.2 a 左侧是车的两个

su_fei_ma_su的博客 3万+

Postgresql编译安装linux、postgresql参数笔记

摘要:本文详细介绍了在CentOS7系统上安装配置PostgreSQL15数据库的完整流程并提供了详细的命令行操作步骤,适合DBA参考

qq_42299196的博客 1031

ChatGPT and Claude国内使用站点

这篇博客介绍了不同的AI聊天平台和定价信息,主要对比了ChatGPT和Claude两款产品。文章列出了多个提供聊天服务的AI平台,包括RawChat、ChatGPTPlus、ChatOpens、Wildcard和2233.ai等,并提供了每个平台的网页链接和定价详情。特别关注了Claude平台,介绍了其普通账号与会员账号的不同,以及相关的定价信息。此外,还提到了一些虚拟卡定价和服务细节,为用户选择合适的AI服务提供了多种参考。

nisidjndn的博客 1万+

【入门AUTOSAR网络管理测试】CANoe测试T_WakeUp时间

随着智能电动汽车行业的快速发展,目前AUTOSAR网络管理也得到了广泛应用,AUTOSAR网络管理测试也是汽车网络测试中非常重要的环节,NM问题导致的汽车ECU不能唤醒、电瓶亏电等问题,对于新入门AUTOSAR网络管理测试的同学不清楚如何开展测试,那么本章节就主要给大家介绍网络管理中T_WakeUp时间如何测试。【入门AUTOSAR网络管理测试】AUTOSAR网络管理规范需求解读。

测试领域技术分享 2135

Oracle dblink PostgreSQL 编译安装

Oracle dblink PostgreSQL 编译安装

zzbsa99的博客 1611

基于STM32设计的物联网疫苗冷链物流监测系统

本设计基于物联网技术,开发了一套疫苗冷链物流环境监测系统。系统采用STM32F103C8T6作为主控芯片,集成SHT30温湿度传感器、震动传感器、GPS定位模块和4G通信模块,实现对运输环境的温度、湿度及震动状况的实时监测与控制。通过继电器驱动半导体制冷模块和加湿器,系统能够自动调节环境温湿度,保障疫苗运输的安全性。采集的环境数据通过MQTT协议上传至华为云物联网平台,配套开发的Android手机APP和Windows上位机软件基于Qt平台设计,支持远程实时查看环境数据和车辆定位,提升了疫苗冷链运输的智能化

862

postgresql17.5 手动编译安装

postgresql 部署安装

software_0215的专栏 768

[Dify 案例实战] 构建一个基于 Dify 的个人写作助理工具-带绑定资源

想要一个懂你风格、能帮你写文章、润色文字、生成大纲的 AI 写作助手? 本文将带你从 0 到 1,完整实现一个 基于 Dify 工作流的个人写作助理工具。 我们会利用 Dify 的 LLM 节点、变量传递、文本处理、知识库与多轮对话能力.

技术小甜甜:传播可落地技术,帮助个人和企业降低解决真实场景问题的成本 274

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

PostgreSQL编译安装

PostgreSQL编译安装 安装语言包 ### PostgreSQL 初始化过程中,会读取操作系统字符编码, ### 若程序需要使用zh_CN.utf-8字符编码,需要在PostgreSQL 初始化之前安装中文包,再初始化PostgreSQL, ### 否则未安装中文包初始化数据库,会导致数据库字符编码格式没有h_CN.utf-8字符编码格式,影响程序后期使用 # sudo apt-get...

weixin_30885111的博客 138

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

postgresql编译安装

postgresql编译安装。

weixin_45251630的博客 736

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

MacOS源码编译安装 PostgreSQL

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34239169的博客 799

(二)PostgreSQL学习:编译安装PostgreSQL

(二)PostgreSQL学习:编译安装PostgreSQL

huiyangxu blog 2221
上一篇: oracle11g dataguard部署
下一篇: RocketMQ命令使用
initialize1306
博客等级 码龄11年 3粉丝 30原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值