Hej, jeg vil forklare, hvordan man installerer postgresql 12 på Centos 7. Og hvordan man opretter en postgresql-database er forklaret nedenfor.
—————-postgresql single instace installationer————————-
repo-pakke
#yum installer centos-release-scl-rh
# yum installer llvm-toolset-7-clang
************************************************** ********************************
# yum install -y epel-release
# yum installer llvm5.0-devel
***********************postgresql-softwareinstallationer************************* *********
yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install -y postgresql12-server postgresql12-client postgresql12-contrib postgresql12-devel
mkdir /postgres/data
chown postgres:postgres /postgres/data
passwd postgres
postgres
postgres
************************************************** ****************************
su – postgres
vi .bash_profile
# Hent aliaserne og funktionerne
if [ -f ~/.bashrc ]; derefter
. ~/.bashrc
fi
# Brugerspecifikt miljø og opstartsprogrammer
PATH=$PATH:$HOME/.local/bin:$HOME/bin:$PATH:/usr/pgsql-12/bin/
eksport PGDATA=/postgres/data
eksport PGUSER=postgres
eksport PGDATABASE=postgres
eksport PGPORT=5432
eksport PGLOCALDIR=/usr/pgsql-12/share/locale
eksport PATH
************************************************** ****************************
initdb -D /postgres/data
pg_ctl status
pg_ctl stop
pg_ctl start
# DB-version:12
# OS-type:linux
# DB-type:web
# Total hukommelse (RAM):32 GB
# CPU'er antal:4
# Forbindelsesnummer:500
# Datalager:hdd
listen_addresses ='*'
port =5432
max_connections =500
shared_buffers =8GB
effective_cache_size =24GB
maintenance_work_mem =2GB
checkpoint_completion_target =0,7>wal_buffere =16MB
default_statistics_target =100
random_page_cost =4
effective_io_concurrency =2
work_mem =8388kB
min_wal_size =1GB
max_wal_size =4GB_size max_worker_processes =4
max_parallel_workers_per_gather =2
max_parallel_workers =4
max_parallel_maintenance_workers =2
pg_ctl genstart
/postgres/data/pg_hba.conf
vært alle alle **************** md5
værte alle alle **************** md5
værte alle alle *************** md5
pg_ctl genindlæs
psql
CREATE DATABASE tayfun ENCODING=’UTF-8′ LC_COLLATE =‘tr_TR.UTF-8′ LC_CTYPE=’tr_TR.UTF-8’ Skabelon0;
OPRET ROLLE testbruger PASSWORD ‘testuser123!’ SUPERBRUGER OPRETDB CREATEROLE ARV LOGIN;
tildel forbindelse på databasen tayfun til testbruger med tildelingsmulighed;
ændre database tayfun ejer til testbruger;