国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

openEuler 22.03 LTS 上源碼安裝 PostgreSQL 15

這篇具有很好參考價(jià)值的文章主要介紹了openEuler 22.03 LTS 上源碼安裝 PostgreSQL 15。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

安裝PostgreSQL 15

1 安裝必要的依賴(lài)

#yum install -y readline-devel zlib-devel gcc

2、下載源碼

# wget https://ftp.postgresql.org/pub/source/v15.6/postgresql-15.6.tar.gz
# tar -xzvf postgresql-15.6.tar.gz

3 配置

# cd postgresql-15.6/
# ./configure

4 編譯安裝

# ./configure
# make
# make install

5 創(chuàng)建用戶(hù)和用戶(hù)組

# groupadd postgres
# useradd -g postgres postgres
# passwd postgres
更改用戶(hù) postgres 的密碼 。
新的密碼: 
重新輸入新的密碼: 
passwd:所有的身份驗(yàn)證令牌已經(jīng)成功更新。

6 初始化數(shù)據(jù)庫(kù)

6.1 創(chuàng)建數(shù)據(jù)目錄

# mkdir /usr/local/pgsql/data
# chown postgres /usr/local/pgsql/data

6.2 切換到 postgres 操作系統(tǒng)用戶(hù)

# su - postgres

6.3 初始化數(shù)據(jù)庫(kù)

[postgres@localhost ~]$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "zh_CN.UTF-8".
The default database encoding has accordingly been set to "UTF8".
initdb: could not find suitable text search configuration for locale "zh_CN.UTF-8"
The default text search configuration will be set to "simple".

Data page checksums are disabled.

fixing permissions on existing directory /usr/local/pgsql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Asia/Shanghai
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start

6.4 啟動(dòng)數(shù)據(jù)庫(kù)

[postgres@localhost ~]$ /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
waiting for server to start.... done
server started
[postgres@localhost ~]$ 

把 start 改為 stop 就是停止。

7 安裝后的操作系統(tǒng)配置

7.1 以管理員的身份配置/etc/profile

在/etc/profile.d 目錄下新增 postgresql.sh 文件,內(nèi)容如下

[root@localhost profile.d]# cat postgresql.sh 
export PATH=$PATH:/usr/local/pgsql/bin

7.2 設(shè)置開(kāi)機(jī)自動(dòng)啟動(dòng)

(1)創(chuàng)建啟動(dòng)文件

在/usr/lib/systemd/system 下創(chuàng)建文件 postgresql.service,內(nèi)容如下:

# vim postgresql.service
[Unit]
Description=PostgreSQL database server
After=network.target
[Service]
Type=forking

User=postgres
Group=postgres
OOMScoreAdjust=-1000
Environment=PGDATA=/usr/local/pgsql/data
Environment=PGPORT=5432

ExecStart=/usr/local/pgsql/bin/pg_ctl start -D ${PGDATA} -l ${PGDATA}/logfile -s -o "-p ${PGPORT}" -w -t 300 
ExecStop=/usr/local/pgsql/bin/pg_ctl stop -D ${PGDATA} -l ${PGDATA}/logfile -s -m fast
ExecReload=/usr/local/pgsql/bin/pg_ctl reload -D ${PGDATA} -l ${PGDATA}/logfile -s

TimeoutSec=300

[Install]
WantedBy=multi-user.target

(2)設(shè)置自動(dòng)啟動(dòng)

# chmod a+x postgresql.service 
# systemctl enable postgresql.service
# systemctl start postgresql.service

7.3 設(shè)置遠(yuǎn)程訪問(wèn)

PostgreSQL安裝后,默認(rèn)是只接受本地機(jī)器連接訪問(wèn)。如果想在其他主機(jī)上訪問(wèn)PostgreSQL數(shù)據(jù)庫(kù)服務(wù)器,就需要進(jìn)行相應(yīng)的配置。以下是我配置遠(yuǎn)程連接PostgreSQL數(shù)據(jù)庫(kù)方式:

(1)pg_hba.conf 配置PostgreSQL數(shù)據(jù)庫(kù)的訪問(wèn)權(quán)限

修改配置文件:(PostgreSQL安裝路徑下的data,也是安裝時(shí)data的默認(rèn)路徑)data目錄下的 pg_hba.conf 和 postgresql.conf。

# cd /usr/local/pgsql/data
# vim pg_hba.conf

找到“# IPv4 local connections:“后,回車(chē)另起一行,添加參數(shù)行如下,保存。
?host all all 0.0.0.0/0 trust?
其中0.0.0.0/0表示運(yùn)行任意ip地址訪問(wèn)

?openEuler 22.03 LTS 上源碼安裝 PostgreSQL 15,服務(wù)器,openEuler,postgresql,postgresql 15,openEuler 22,linux,服務(wù)器?

(2)postgresql.conf 配置PostgreSQL數(shù)據(jù)庫(kù)服務(wù)器的相應(yīng)的參數(shù)

找到“l(fā)isten_addresses“參數(shù)后,設(shè)置listen_addresses = ‘*’,保存。

# vim postgresql.conf

?openEuler 22.03 LTS 上源碼安裝 PostgreSQL 15,服務(wù)器,openEuler,postgresql,postgresql 15,openEuler 22,linux,服務(wù)器?

設(shè)置好后重啟服務(wù)即可被遠(yuǎn)程連接。

8 問(wèn)題

8.1 遠(yuǎn)程連接失敗解決方案

一般服務(wù)器端防火窗入站規(guī)則打開(kāi)后,如果外部物理機(jī)遠(yuǎn)程連接失敗。 建議在服務(wù)器端安裝Navicat檢查是否能夠連接成功。如果可以連接成功,請(qǐng)?jiān)诜?wù)器進(jìn)行安全組端口開(kāi)放。

開(kāi)放端口

# systemctl start firewalld.service(開(kāi)啟防火墻)
# systemctl stop firewalld.service(關(guān)閉防火墻)
# systemctl status firewalld(查看防火墻是否開(kāi)啟)

如需要開(kāi)放80和443端口,如下:

# firewall-cmd --zone=public --permanent --add-port=80/tcp
# firewall-cmd --zone=public --permanent --add-port=443/tcp
# firewall-cmd --reload

查看所有開(kāi)啟的端口:

# firewall-cmd --list-ports

常用命令介紹:

firewall-cmd --state ##查看防火墻狀態(tài),是否是running
firewall-cmd --reload ##重新載入配置,比如添加規(guī)則之后,需要執(zhí)行此命令
firewall-cmd --get-zones ##列出支持的zone
firewall-cmd --get-services ##列出支持的服務(wù),在列表中的服務(wù)是放行的
firewall-cmd --query-service ftp ##查看ftp服務(wù)是否支持,返回yes或者no
firewall-cmd --add-service=ftp ##臨時(shí)開(kāi)放ftp服務(wù)
firewall-cmd --add-service=ftp --permanent ##永久開(kāi)放ftp服務(wù)
firewall-cmd --remove-service=ftp --permanent ##永久移除ftp服務(wù)
firewall-cmd --add-port=80/tcp --permanent ##永久添加80端口
iptables -L -n ##查看規(guī)則,這個(gè)命令是和iptables的相同的

?文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-829761.html

到了這里,關(guān)于openEuler 22.03 LTS 上源碼安裝 PostgreSQL 15的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶(hù)投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • openEuler 22.03 LTS-SP1體驗(yàn)安裝docker、防火墻配置等

    openEuler默認(rèn)采用firewall-cmd進(jìn)行管理,iptables默認(rèn)是禁用狀態(tài)。

    2024年02月16日
    瀏覽(28)
  • openEuler22.03LTS網(wǎng)卡配置

    VmWare完成安裝openEuler,修改網(wǎng)卡配置文件,重啟network報(bào)錯(cuò)service not found,因?yàn)闅W拉使用nmcli管理網(wǎng)絡(luò)。 按照centos7的經(jīng)驗(yàn),修改ifcfg配置文件,重啟network失敗,報(bào)錯(cuò)“network.service not found.” [root@localhost ]# systemctl restart network Failed to restart network.service: Unit network.service not found. 歐

    2023年04月08日
    瀏覽(24)
  • openEuler 22.03 (LTS-SP1)安裝最新版Docker(踩坑及解決方案)

    openEuler 22.03 (LTS-SP1)安裝最新版Docker(踩坑及解決方案)

    openEuler 22.03 LTS-SP1要是直接yum install docker,默認(rèn)安裝docker 是18.09.0,這個(gè)版本Docker有個(gè)bug,所以還是安裝個(gè)最新版Docker。 1、先增加docker官方倉(cāng)庫(kù) 以下作踩坑過(guò)程,請(qǐng)直接跳過(guò)查看下面的\\\"2、修改配置文件\\\" 查看一下最新版docker,然后報(bào)錯(cuò)可以發(fā)現(xiàn), 這里只有centos/7/? ?或?ce

    2024年02月13日
    瀏覽(28)
  • openEuler 22.03 LTS登錄AWS Marketplace

    openEuler 22.03 LTS登錄AWS Marketplace

    openEuler 22.03 LTS鏡像正式登錄AWS Marketplace ,目前在亞太及歐洲15個(gè)Region開(kāi)放使用,后續(xù)將開(kāi)放更多版本和區(qū)域,openEuler 22.03 LTS AMI(Amazon Machine Images)由openEuler社區(qū)提供支持。 點(diǎn)擊查看具體使用指導(dǎo):https://www.openeuler.org/zh/blog/20230711-AMIs/AMIs.html

    2024年02月16日
    瀏覽(33)
  • OpenEuler22.03源碼編譯安裝nginx1.24.0

    操作系統(tǒng)版本:OpenEuler22.03 SP2 LTS Nginx版本:1.24.0 安裝位置:/app/nginx Selinux配置:關(guān)閉或設(shè)置為permissive 修改nginx運(yùn)行用戶(hù)為root: 設(shè)置nginx開(kāi)機(jī)自啟: nginx.service內(nèi)容: [Unit] Description=nginx After=network.target [Service] Type=forking ExecStart=/app/nginx/sbin/nginx -c /app/nginx/conf/nginx.conf ExecReloa

    2024年02月04日
    瀏覽(25)
  • 《全網(wǎng)唯一》解決華為OpenEuler 22.03LTS重啟后,docker丟失自定義網(wǎng)絡(luò),docker-compose報(bào)錯(cuò): network not found

    如果你在華為OpenEuler 22.03LTS系統(tǒng)中 使用yum或者dnf安裝docker,docker network create 創(chuàng)建的網(wǎng)絡(luò),然后重啟宿主機(jī),會(huì)發(fā)現(xiàn)之前的網(wǎng)絡(luò)全都不見(jiàn)了 或者docker-compse創(chuàng)建一組容器,重啟宿主機(jī)會(huì)發(fā)現(xiàn)docker-compose無(wú)法啟動(dòng),報(bào)錯(cuò)找不到網(wǎng)絡(luò) 如果只是想解決以上問(wèn)題,不關(guān)心處理過(guò)程,請(qǐng)直

    2024年02月10日
    瀏覽(31)
  • OpenEuler22.03安裝最新版本Docker

    OpenEuler22.03安裝最新版本Docker

    操作系統(tǒng)環(huán)境如下: 操作系統(tǒng):OpenEuler 22.03 LTS 安裝方式:最小化安裝 在操作系統(tǒng)安裝完畢如果直接采用dnf或者yum方式安裝docker: 報(bào)如下錯(cuò)誤: 產(chǎn)生該問(wèn)題的原因是openeuler操作系統(tǒng)自帶的軟件源不全。默認(rèn)源安裝的docker是18.x版本,無(wú)法安裝docker最新版本,安裝18.x版本可以通

    2024年02月03日
    瀏覽(26)
  • openEuler22.03中安裝docker

    由于docker-ce沒(méi)有單獨(dú)針對(duì)openEuler的鏡像,所以我們可以用CentOS的。 1.若系統(tǒng)之前安裝過(guò)docker,需要先卸載之后再安裝 2.下載docker-ce的repo文件 3.將repo中官方地址替換為華為開(kāi)源鏡像,下載速度烏龜變兔子 4.repo中用$releasever變量代替當(dāng)前系統(tǒng)的版本號(hào),該變量在CentOS中有效,但

    2024年02月12日
    瀏覽(29)
  • openEuler22.03制作openstack平臺(tái)使用的鏡像

    openEuler22.03制作openstack平臺(tái)使用的鏡像

    第一章 openEuler22.03制作openstack平臺(tái)使用的鏡像 使用openEuler22.03的iso制作openstack平臺(tái)使用的云主機(jī)鏡像。 使用的鏡像:openEuler-22.03-LTS-SP1-x86_64-dvd.iso 使用的工具:virt-manager 首先將網(wǎng)卡類(lèi)型,硬盤(pán)類(lèi)型修改為Virtio類(lèi)型 只保留一個(gè)跟目錄分區(qū)即可 總體上制作方式一致,直接使用云

    2024年02月07日
    瀏覽(27)
  • 使用openeuler 22.03替代CentOS 7.9,建立虛擬機(jī)詳細(xì)步驟

    使用openeuler 22.03替代CentOS 7.9,建立虛擬機(jī)詳細(xì)步驟

    進(jìn)入瀏覽器搜索網(wǎng)址下載openeuler 22.03鏡像文件 https://mirrors.huaweicloud.com/openeuler/openEuler-22.03-LTS-SP3/ISO/x86_64/openEuler-22.03-LTS-SP3-x86_64-dvd.iso 打開(kāi)VMware Workstation新建一個(gè)虛擬機(jī): ? ? ? ? 自定義虛擬機(jī)位置 ? ? ? ? ? ? ? ? ? ? 加入下載好的openeuler鏡像文件 ? ? ? ? ? 使用root用戶(hù)

    2024年02月19日
    瀏覽(32)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包