In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
##Advantages of Postgresql database 1. The most powerful open source database at present 2. Stable and reliable 3. Open source saves money 4. Wide support 5. Active Postgresql community ##pg Compared with mysql, mysql has the following disadvantages 1. The function is not strong enough 2. The performance optimization tools and measurement information are insufficient 3. The online operation function is weak--yum groupinstall-y "Development tools" yum install-y bison flex readline-devel zlib-devel--compile, The size parameter can only be specified at compile time and cannot be changed later./ configure--prefix =/opt/pg 10/--with-pgport = 1921 gmake worldgmake install--Installation complete--For ease of management, set soft connection [root@pgnode1~]#ln-s/opt/pg 10//opt/pgsql--Create pg user groupadd-g 1000 postgresusadd-g 1000-u 1000-d/home/postgres-m postgres--Create related directory [root@pgnode1~]#mkdir-p/pgdata/10/{data, backups, scripts, archive_wals}[root@pgnode1~]#chown-R postgres: postgres/pgdata/10/[root@pgnode1~]#chmod 0700/pgdata/10/data/--Initialize the data directory (postgres user)/opt/pgsql/bin/initdb-D/pgdata/10/data/-W--or/opt/pgsql/bin/pg_ctl init-D/pgdata/10/data/-o "-W"--Environment variables export LD_LIBRARY_PATH =/opt/pgsql/libexport PGHOME =/opt/pgsqlexport PGDATA =/pgdata/10/dataexport PATH =$PGHOME/bin:$PATH--Start pg_ctl-D/pgdata/10/data/start--orpostgres-D/pgdata/10/data--Test whether the database allows connections pg_isready-p 1921--Configure boot autostart [postgres@pgnode1 start-scripts]$pwd/pgbackup/postgresql-10.6/contrib/start-scripts [postgres@pgnode1 start-scripts]$ls-ltotal 16-rw-script r--r--1 1107 1107 1467 Nov 6 05: 45 freebsd-rw-r--r--1 1107 1107 3552 Nov 6 05:45 linuxdrwxrwx 2 1107 1107 4096 Nov 6 05:58 macosdrwxrwx 2 1107 1107 4096 Nov 6 05:58 osx [postgres@pgnode1 start-scripts]$--Note modify related directories [postgres@pgnode1 start-scripts]$cat linux| grep-v "#"|grep-v "^$"prefix =/opt/pgsqlPGDATA ="/pgdata/10/data" PGUSER = postgresPGLOG ="$PGDATA/log" PATH =/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/binDAEMON ="$prefix/bin/postmaster" PGCTL ="$prefix/bin/pg_ctl" cp linux/etc/init. d/postgresql-10chmod + x/etc/init. d/postgresql-10chkconfig postgresql-10 on/off--ph_hba. conf Client connection authentication, host all all 192.168.8.19/32 trust--modification requires restart or reload pg_ctl-D/pgdata/10/data reload--postgresql. conf main configuration file, resource limit, cluster, file location, etc. alter system set listen_addresses ='*';--database level alter database name set config parameter to =; alter database name reset config parameter;--session level set config parameter to; set config parameter to default;--view configuration select name, setting from pg_settings;- -If you don't need restart parameters, you can use the following command select pg_reload_conf ();--View listening ports [postgres@pgnode1 data]$netstat-nlt| grep 1921--connect [postgres@pgnode1 data]$netstat-nlt| grep 1921tcp 0 0 192.168.8.19:1921 0.0.0.0:* LISTEN [postgres@pgnode1 data]$ psql -h 192.168.8.19 -p 1921psql (10.6)Type "help" for help.postgres=# select version(); version --------------------------------------------------------------------------------------------------------- PostgreSQL 10.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16), 64-bit(1 row)postgres=#
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.