当前位置: 首页 > news >正文

友情链接购买网站欧派整装大家居装修公司加盟

友情链接购买网站,欧派整装大家居装修公司加盟,开贴纸网站要怎么做的,网站建设业务员话术前些天发现了一个巨牛的人工智能学习网站#xff0c;通俗易懂#xff0c;风趣幽默#xff0c;忍不住分享一下给大家。点击跳转到教程。进行升级版本之前请一定做好备份#xff01;查看当前版本#xff1a;[postgresnode1 ~]$ psqlpsql (9.4.4)Type help for h…前些天发现了一个巨牛的人工智能学习网站通俗易懂风趣幽默忍不住分享一下给大家。点击跳转到教程。进行升级版本之前请一定做好备份查看当前版本[postgresnode1 ~]$ psqlpsql (9.4.4)Type help for help.postgres# select version();version--------------------------------------------------------------------------------------------------------------PostgreSQL 9.4.4 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4), 64-bit(1 row)$PGDATA/opt/pg9.4.4//data/opt/pg9.6.2//data升级至9.6.2安装新版本[rootnode1 upload]# mkdir -p /opt/pg9.6.2//data[rootnode1 upload]# tar -zxvf postgresql-9.6.2.tar.gz./configure --prefix/opt/pg9.6.2/--with-pgport5433  \  【建议在此处直接更改了端口】--with-perl --with-python --with-tcl  \  --with-openssl  --without-ldap  \   --with-libxml  --with-libxslt    \  --enable-thread-safety    \  --with-wal-blocksize64   \  --with-blocksize32 \  --with-wal-segsize64 \  -enable-dtrace  \  --enable-debug   makemake install[postgresnode1 ~]$ /opt/pg9.6.2/bin/initdb -D /opt/pg9.6.2/data/--encodingutf8   -U postgres  【可以指定字符集和用户】如果安装的时候没有更改端口的话则此时应该vim postgresql.confport 5433log_destination stderrlogging_collector onlog_directory pg_log[postgresnode1 data]$ /opt/pg9.6.2/bin/pg_ctl -D /opt/pg9.6.2/data/ start[postgresnode1 data]$ /opt/pg9.6.2/bin/pg_ctl -D /opt/pg9.6.2/data/ statuspg_ctl: server is running (PID: 12720)/opt/pg9.6.2/bin/postgres -D /opt/pg9.6.2/data[postgresnode1 data]$ exitlogout[rootnode1 postgresql-9.6.2]# netstat -lntp | grep postgrestcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 2271/postgrestcp 0 0 127.0.0.1:5433 0.0.0.0:* LISTEN 12720/postgrestcp 0 0 :::5432 :::* LISTEN 2271/postgrestcp 0 0 ::1:5433 :::* LISTEN 12720/postgres至此新库安装启动成功关闭两个库[postgresnode1 ~]$ /opt/pg9.6.2/bin/pg_ctl -D /opt/pg9.6.2/data/ stop[postgresnode1 ~]$ /opt/pg9.4.4/bin/pg_ctl -D /opt/pg9.4.4/data/ stop升级前的检测[postgresnode1 bin]$ /opt/pg9.6.2/bin/pg_upgrade -c --link -b /opt/pg9.4.4/bin -B /opt/pg9.6.2/bin -d /opt/pg9.4.4/data -D /opt/pg9.6.2/data/ -p 5432 -P 5433Performing Consistency Checks-----------------------------Checking cluster versions okChecking database user is the install user okChecking database connection settings okChecking for prepared transactions okChecking for reg* system OID user data types okChecking for contrib/isn with bigint-passing mismatch okChecking for roles starting with pg_ okChecking for presence of required libraries fatalYour installation references loadable libraries that are missing from thenew installation. You can add these libraries to the new installation,or remove the functions using them from the old installation. A list ofproblem libraries is in the file:loadable_libraries.txtFailure, exiting备注 -b, -B 分别表示老版本 PG bin 目录新版本 PG bin目录 -d, -D 分别表示老版本PG 数据目录新版本 PG 数据目录 -c 表示仅检查并不会做任何更改 根据提示查看文件 loadable_libraries.txt 。cat /opt/pg9.4.4/bin/loadable_libraries.txtcould not load library $libdir/dblink:ERROR: could not access file $libdir/dblink: No such file or directorycould not load library $libdir/postgres_fdw:ERROR: could not access file $libdir/postgres_fdw: No such file or directorycould not load library $libdir/slony1_funcs:ERROR: could not access file $libdir/slony1_funcs: No such file or directory检测发现新库缺少一些旧库已经安装的工具和软件解决方案cd /upload/postgresql-9.6.2/contrib/makemake install postgres_fdwmake install dblink【这两个插件9.6.2也有且是常用的小型插件可以直接在9.6.2环境中安装】此时node1和node2的test01和test02是可以同步的即slony-i是可以正常使用的。思路可以卸载slony-i 来实现升级postgresql或者同时升级slony-i来升级postgresql。本博客使用卸载升级博主认为像slony-i这种工具由于对不同版本的postgres数据库有着不同的版本要求升级slony-i更容易出问题不如直接删除然后在新的数据库重新安装同步① 关闭守护进程slon_kill 1slon_kill 2② 卸载节点slonik_uninstall_nodes | slonik③查看安装模式master# \dnList of schemasName | Owner------------------------_replication | slonypublic | postgres(2 rows)④删除Slony安装的模式【此处应确认slon运行守护程序已经关闭】master# DROP SCHEMA _replication CASCADE;slave# DROP SCHEMA _replication CASCADE;[postgresnode1 ~]$ slonslony_show_configuration-bash: slonslony_show_configuration: command not found【检测一下配置发现已经完全卸载干净了需要注意的是slon-i并不是删除所有有关目录和文件即可删除】重新检测[postgresnode1 ~]$ /opt/pg9.6.2/bin/pg_upgrade -c --link -b /opt/pg9.4.4/bin -B /opt/pg9.6.2/bin -d /opt/pg9.4.4/data -D /opt/pg9.6.2/data/ -p 5432 -P 5433Performing Consistency Checks-----------------------------Checking cluster versions okChecking database user is the install user okChecking database connection settings okChecking for prepared transactions okChecking for reg* system OID user data types okChecking for contrib/isn with bigint-passing mismatch okChecking for roles starting with pg_ okChecking for presence of required libraries okChecking database user is the install user okChecking for prepared transactions ok*Clusters are compatible*两种升级方式:1).缺省的通过拷贝数据文件到新的data目录下拷贝的方式升级较慢但是原库还可用2).硬链接的方式升级较快但是原库不可用.一般来说是建议使用硬链接的方式来升级的这样更符合实际生产但是需要注意无论是哪种方式升级要停库且升级时间不可控这也是升级的弊端升级[postgresnode1 ~]$ /opt/pg9.6.2/bin/pg_upgrade --link -b /opt/pg9.4.4/bin -B /opt/pg9.6.2/bin -d /opt/pg9.4.4/data -D /opt/pg9.6.2/data/ -p 5432 -P 5433Performing Consistency Checks-----------------------------Checking cluster versions okChecking database user is the install user okChecking database connection settings okChecking for prepared transactions okChecking for reg* system OID user data types okChecking for contrib/isn with bigint-passing mismatch okChecking for roles starting with pg_ okCreating dump of global objects okCreating dump of database schemasokChecking for presence of required libraries okChecking database user is the install user okChecking for prepared transactions okIf pg_upgrade fails after this point, you must re-initdb thenew cluster before continuing.Performing Upgrade------------------Analyzing all rows in the new cluster okFreezing all rows on the new cluster okDeleting files from new pg_clog okCopying old pg_clog to new server okSetting next transaction ID and epoch for new cluster okDeleting files from new pg_multixact/offsets okCopying old pg_multixact/offsets to new server okDeleting files from new pg_multixact/members okCopying old pg_multixact/members to new server okSetting next multixact ID and offset for new cluster okResetting WAL archives okSetting frozenxid and minmxid counters in new cluster okRestoring global objects in the new cluster*failure*Consult the last few lines of pg_upgrade_utility.log forthe probable cause of the failure.Failure, exiting提示恢复新集群中的全局变量失败到该日志下查看并没有发现有用的信息。猜测是因为心集群无法正常启动。[postgresnode1 pg9.6.2]$ /opt/pg9.6.2/bin/initdb -D /opt/pg9.6.2/data/根据前面的提示重新初始化了新的数据库但是还是没有任何改变。[postgresnode1 ~]$ /opt/pg9.6.2/bin/psql -p5433/opt/pg9.6.2/bin/psql: symbol lookup error: /opt/pg9.6.2/bin/psql: undefined symbol: PQsetErrorContextVisibility果然问题出现在了新集群的启动上出现该问题的原因是目前状态的lib仍是指定到了旧的数据库临时定义LD_LIBRARY_PATH到新数据库[postgresnode1 pg9.6.2]$ export LD_LIBRARY_PATH/opt/pg9.6.2/lib:$HOME/lib[postgresnode1 pg9.6.2]$ /opt/pg9.6.2/bin/psql -p5433psql (9.6.2)Type help for help.postgres# \lList of databasesName | Owner | Encoding | Collate | Ctype | Access privileges--------------------------------------------------------------------------------postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | c/postgres | | | | | postgresCTc/postgrestemplate1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | c/postgres | | | | | postgresCTc/postgres(3 rows)postgres# \q[postgresnode1 pg9.6.2]$ pg_ctl startserver starting[postgresnode1 pg9.6.2]$ LOG: redirecting log output to logging collector processHINT: Future log output will appear in directory pg_log.[postgresnode1 pg9.6.2]$ psqlpsql (9.4.4)Type help for help.postgres#postgres# \q可以发现此时新旧数据库都可以登入关闭服务[postgresnode1 pg9.6.2]$ pg_ctl stop[postgresnode1 pg9.6.2]$ /opt/pg9.6.2/bin/pg_ctl -D /opt/pg9.6.2/data/ stop重新升级[postgresnode1 pg9.6.2]$ /opt/pg9.6.2/bin/pg_upgrade --link -b /opt/pg9.4.4/bin -B /opt/pg9.6.2/bin -d /opt/pg9.4.4/data -D /opt/pg9.6.2/data/ -p 5432 -P 5433Performing Consistency Checks-----------------------------Checking cluster versions okChecking database user is the install user okChecking database connection settings okChecking for prepared transactions okChecking for reg* system OID user data types okChecking for contrib/isn with bigint-passing mismatch okChecking for roles starting with pg_ okCreating dump of global objects okCreating dump of database schemasokChecking for presence of required libraries okChecking database user is the install user okChecking for prepared transactions okIf pg_upgrade fails after this point, you must re-initdb thenew cluster before continuing.Performing Upgrade------------------Analyzing all rows in the new cluster okFreezing all rows on the new cluster okDeleting files from new pg_clog okCopying old pg_clog to new server okSetting next transaction ID and epoch for new cluster okDeleting files from new pg_multixact/offsets okCopying old pg_multixact/offsets to new server okDeleting files from new pg_multixact/members okCopying old pg_multixact/members to new server okSetting next multixact ID and offset for new cluster okResetting WAL archives okSetting frozenxid and minmxid counters in new cluster okRestoring global objects in the new cluster okRestoring database schemas in the new clusterokAdding .old suffix to old global/pg_control okIf you want to start the old cluster, you will need to removethe .old suffix from /opt/pg9.4.4/data/global/pg_control.old.Because link mode was used, the old cluster cannot be safelystarted once the new cluster has been started.Linking user relation filesokSetting next OID for new cluster okSync data directory to disk okCreating script to analyze new cluster okCreating script to delete old cluster okUpgrade Complete----------------Optimizer statistics are not transferred by pg_upgrade so,once you start the new server, consider running:./analyze_new_cluster.shRunning this script will delete the old clusters data files:./delete_old_cluster.sh查看新数据库端口[postgresnode1 pg9.6.2]$ grep -i ^port /opt/pg9.6.2/data/postgresql.confport 5433 # (change requires restart)修改端口号为5432【sed -i直接修改读取的文件内容而不是输出到终端。详情请参考博主另一篇博客http://blog.csdn.net/oraclesand/article/details/68923042】[postgresnode1 pg9.6.2]$ sed -i s/5433/5432/1 /opt/pg9.6.2/data/postgresql.conf[postgresnode1 pg9.6.2]$ grep -i ^port /opt/pg9.6.2/data/postgresql.confport 5432 # (change requires restart)修改环境变量# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then. ~/.bashrcfi# User specific environment and startup programsPATH$PATH:$HOME/binexport PATH#export PGHOME/opt/pg9.4.4/export PGHOME/opt/pg9.6.2/export PGDATA$PGHOME/dataexport PATH$PGHOME/bin:$PATHexport LD_LIBRARY_PATH$PGHOME/lib#默认端口#export PGPORT5432#默认密码#export PGPASSWORD#默认字符集#export LANGen_US.utf8#PostgreSQL默认主机地址#export PGHOST127.0.0.1#默认的数据库名#export PGDATABASEpostgres#PostgreSQL的 man 手册#export MANPATH$PGHOME/share/man:$MANPATH#PostgreSQL 连接库文件#export LD_LIBRARY_PATH$PGHOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib:$LD_LIBRARY_PATH#export DATEdate %Y%m%d%H%Msource ~/.bash_profile检测升级效果查看新库是否有原有数据[postgresnode1 pg9.6.2]$ pg_ctl startserver starting[postgresnode1 pg9.6.2]$ LOG: redirecting log output to logging collector processHINT: Future log output will appear in directory pg_log.[postgresnode1 pg9.6.2]$ psqlpsql (9.6.2)Type help for help.postgres# \lList of databasesName | Owner | Encoding | Collate | Ctype | Access privileges--------------------------------------------------------------------------------master | slony | UTF8 | en_US.UTF-8 | en_US.UTF-8 |postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | c/postgres | | | | | postgresCTc/postgrestemplate1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | postgresCTc/postgres| | | | | c/postgres(4 rows)postgres# \dList of relationsSchema | Name | Type | Owner-----------------------------------------------------public | dblink_test00_view | view | postgrespublic | qqq | foreign table | postgrespublic | test01 | table | postgres(3 rows)一切正常执行脚本[postgresnode1 pg9.6.2]$ ./analyze_new_cluster.sh这个脚本其实就一条 vacuumdb 命令收集新库统计信息This script will generate minimal optimizer statistics rapidlyso your system is usable, and then gather statistics twice morewith increasing accuracy. When it is done, your system willhave the default level of optimizer statistics.If you have used ALTER TABLE to modify the statistics target forany tables, you might want to remove them and restore them afterrunning this script because they will delay fast statistics generation.If you would like default statistics as quickly as possible, cancelthis script and run:/opt/pg9.6.2/bin/vacuumdb --all --analyze-onlyvacuumdb: processing database master: Generating minimal optimizer statistics (1 target)vacuumdb: processing database postgres: Generating minimal optimizer statistics (1 target)vacuumdb: processing database template1: Generating minimal optimizer statistics (1 target)vacuumdb: processing database master: Generating medium optimizer statistics (10 targets)vacuumdb: processing database postgres: Generating medium optimizer statistics (10 targets)vacuumdb: processing database template1: Generating medium optimizer statistics (10 targets)vacuumdb: processing database master: Generating default (full) optimizer statisticsvacuumdb: processing database postgres: Generating default (full) optimizer statisticsvacuumdb: processing database template1: Generating default (full) optimizer statistics删除旧数据库data[postgresnode1 pg9.6.2]$ cat delete_old_cluster.sh#!/bin/shrm -rf /opt/pg9.4.4/data[postgresnode1 pg9.6.2]$ ./delete_old_cluster.sh[postgresnode1 opt]$ ls pg9.4.4/ -ltotal 20drwxr-xr-x. 2 postgres postgres 4096 Mar 30 17:59 bindrwxr-xr-x. 4 postgres postgres 4096 Mar 13 12:56 includedrwxr-xr-x. 4 postgres postgres 4096 Mar 30 14:22 libdrwxr-xr-x. 4 postgres postgres 4096 Mar 28 16:54 sharedrwxrwxr-x. 3 postgres postgres 4096 Mar 30 14:46 slonylog[postgresnode1 opt]$ postgres --versionpostgres (PostgreSQL) 9.6.2至此升级完成根据需求实际修改postgresql.conf, pg_hba.conf等文件。官方参考文档http://slony.info/documentation/1.2/dropthings.html一个有趣的相同问题http://www.postgresql-archive.org/Slony-error-please-help-td5908267.html#a5908317转自https://blog.csdn.net/Oraclesand/article/details/68923078
http://www.zqtcl.cn/news/770974/

相关文章:

  • 做网站推广送什么深圳的网站建设公司流程
  • 中国网站开发的前景制作公司主页网站
  • 在线画流程图的网站购物网站的设计与实现论文
  • 淘宝客cms网站建设K12网站怎么建设
  • 专业门户网站开发浙江省湖州艺术与设计学校官网
  • 企业网站搭建价格搭建平台的另一种说法
  • 网站开发框架桂林人论坛风姿摄影
  • 吉林省建设安全信息网站网站服务器和空间有什么区别
  • 百度制作网站怎么去掉2345网址导航
  • 深圳网站建设有限公司 2019哪些建材网站可以做宣传
  • 西安阿里云网站建设一建报名资格条件
  • 聊城网站优化wordpress循环该分类子分类
  • 帮网站做关键词排名优化创造网站需要多少钱
  • 广西网站建设推荐wordpress 宣布停止
  • 专注网站制作青岛景观设计公司排名
  • 安庆做网站网站代理建设网站观澜
  • 网站开发需求收集 模板cms做门户网站
  • dw网站首页的导航怎么做有大佬给个网址吗
  • 一个网站怎么做聚合洛可可设计公司贾伟
  • 什么是优化型网站网页设计作业在线网站首页
  • 关于网站建设广告词英文案例网站
  • 有哪些可以做策划方案的网站国家域名
  • vk网站做婚介做seo排名好的网站
  • 广州企业网站建设公司苏州建网站提
  • html如何做购物网站天元建设集团有限公司法人代表
  • 教育培训机构排名seo是搜索引擎营销
  • 做奢侈品网站有哪些沧州手机建站哪家好
  • 德州网站网站建设广西房管局官网
  • 白石桥做网站公司seo顾问服务四川
  • 网站建设注册哪类商标十大网页设计公司