接前篇:http://www.cnblogs.com/gaojian/p/3196244.html

简单的Slony-I设置实例

如何删除slony相关的内容呢。

我再另外找一台机器,安装slony,也安装postgresql(这个是为防止万一而已)

编写脚本:

[postgres@pg100 ~]$ cat remove.sh
#!/bin/sh CLUSTERNAME=testdb3_cluster
MASTERDBNAME=testdb3
SLAVEDBNAME=testdb3
MASTERHOST=192.168.10.102
SLAVEHOST=192.168.10.101
REPLICATIONUSER=postgres /usr/local/slony/bin/slonik <<_EOF_
#--
# define the namespace the replication system
# uses in our example it is slony_example
#--
cluster name = $CLUSTERNAME; #--
# admin conninfo's are used by slonik to connect to
# the nodes one for eachnode on each side of the cluster,
# the syntax is that of PQconnectdb in
# the C-API
# --
node admin conninfo = 'dbname=$MASTERDBNAME \
host=$MASTERHOST user=$REPLICATIONUSER';
node admin conninfo = 'dbname=$SLAVEDBNAME \
host=$SLAVEHOST user=$REPLICATIONUSER'; uninstall node (id = );
uninstall node (id = );
_EOF_
[postgres@pg100 ~]$

然后运行:

[postgres@pg100 ~]$ sh remove.sh
<stdin>:: NOTICE: Slony-I: Please drop schema "_testdb3_cluster"
<stdin>:: NOTICE: drop cascades to other objects
DETAIL: drop cascades to table _testdb3_cluster.sl_node
drop cascades to table _testdb3_cluster.sl_nodelock
drop cascades to table _testdb3_cluster.sl_set
drop cascades to table _testdb3_cluster.sl_setsync
drop cascades to table _testdb3_cluster.sl_table
drop cascades to table _testdb3_cluster.sl_sequence
drop cascades to table _testdb3_cluster.sl_path
drop cascades to table _testdb3_cluster.sl_listen
drop cascades to table _testdb3_cluster.sl_subscribe
drop cascades to table _testdb3_cluster.sl_event
drop cascades to table _testdb3_cluster.sl_confirm
drop cascades to table _testdb3_cluster.sl_seqlog
drop cascades to function _testdb3_cluster.sequencelastvalue(text)
drop cascades to table _testdb3_cluster.sl_log_1
drop cascades to table _testdb3_cluster.sl_log_2
drop cascades to table _testdb3_cluster.sl_registry
drop cascades to view _testdb3_cluster.sl_seqlastvalue
drop cascades to sequence _testdb3_cluster.sl_local_node_id
drop cascades to sequence _testdb3_cluster.sl_event_seq
drop cascades to sequence _testdb3_cluster.sl_action_seq
drop cascades to sequence _testdb3_cluster.sl_log_status
drop cascades to table _testdb3_cluster.sl_config_lock
drop cascades to table _testdb3_cluster.sl_event_lock
drop cascades to table _testdb3_cluster.sl_archive_counter
drop cascades to table _testdb3_cluster.sl_components
drop cascades to type _testdb3_cluster.vactables
drop cascades to function _testdb3_cluster.createevent(name,text)
drop cascades to function _testdb3_cluster.createevent(name,text,text)
drop cascades to function _testdb3_cluster.createevent(name,text,text,text)
drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text)
drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text)
drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text,text)
drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text,text,text)
drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text,text,text,text)
drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text,text,text,text,text)
drop cascades to function _testdb3_cluster.denyaccess()
drop cascades to trigger _testdb3_cluster_denyaccess on table t1
drop cascades to function _testdb3_cluster.lockedset()
drop cascades to function _testdb3_cluster.getlocalnodeid(name)
drop cascades to function _testdb3_cluster.getmoduleversion()
drop cascades to function _testdb3_cluster.resetsession()
drop cascades to function _testdb3_cluster.checkmoduleversion()
drop cascades to function _testdb3_cluster.decode_tgargs(bytea)
drop cascades to function _testdb3_cluster.logtrigger()
drop cascades to trigger _testdb3_cluster_logtrigger on table t1
drop cascades to function _testdb3_cluster.terminatenodeconnections(integer)
drop cascades to function _testdb3_cluster.killbackend(integer,text)
drop cascades to function _testdb3_cluster.seqtrack(integer,bigint)
drop cascades to function _testdb3_cluster.slon_quote_brute(text)
drop cascades to function _testdb3_cluster.slon_quote_input(text)
drop cascades to function _testdb3_cluster.slonyversionmajor()
drop cascades to function _testdb3_cluster.slonyversionminor()
drop cascades to function _testdb3_cluster.slonyversionpatchlevel()
drop cascades to function _testdb3_cluster.slonyversion()
drop cascades to function _testdb3_cluster.registry_set_int4(text,integer)
drop cascades to function _testdb3_cluster.registry_get_int4(text,integer)
drop cascades to function _testdb3_cluster.registry_set_text(text,text)
drop cascades to function _testdb3_cluster.registry_get_text(text,text)
drop cascades to function _testdb3_cluster.registry_set_timestamp(text,timestamp with time zone)
drop cascades to function _testdb3_cluster.registry_get_timestamp(text,timestamp with time zone)
drop cascades to function _testdb3_cluster.cleanupnodelock()
drop cascades to function _testdb3_cluster.registernodeconnection(integer)
drop cascades to function _testdb3_cluster.initializelocalnode(integer,text)
drop cascades to function _testdb3_cluster.storenode(integer,text)
drop cascades to function _testdb3_cluster.storenode_int(integer,text)
drop cascades to function _testdb3_cluster.enablenode(integer)
drop cascades to function _testdb3_cluster.enablenode_int(integer)
drop cascades to function _testdb3_cluster.disablenode(integer)
drop cascades to function _testdb3_cluster.disablenode_int(integer)
drop cascades to function _testdb3_cluster.dropnode(integer)
drop cascades to function _testdb3_cluster.dropnode_int(integer)
drop cascades to function _testdb3_cluster.failednode(integer,integer)
drop cascades to function _testdb3_cluster.failednode2(integer,integer,integer,bigint,bigint)
drop cascades to function _testdb3_cluster.failoverset_int(integer,integer,integer,bigint)
drop cascades to function _testdb3_cluster.uninstallnode()
drop cascades to function _testdb3_cluster.clonenodeprepare(integer,integer,text)
drop cascades to function _testdb3_cluster.clonenodeprepare_int(integer,integer,text)
drop cascades to function _testdb3_cluster.clonenodefinish(integer,integer)
drop cascades to function _testdb3_cluster.storepath(integer,integer,text,integer)
drop cascades to function _testdb3_cluster.storepath_int(integer,integer,text,integer)
drop cascades to function _testdb3_cluster.droppath(integer,integer)
drop cascades to function _testdb3_cluster.droppath_int(integer,integer)
drop cascades to function _testdb3_cluster.storelisten(integer,integer,integer)
drop cascades to function _testdb3_cluster.storelisten_int(integer,integer,integer)
drop cascades to function _testdb3_cluster.droplisten(integer,integer,integer)
drop cascades to function _testdb3_cluster.droplisten_int(integer,integer,integer)
drop cascades to function _testdb3_cluster.storeset(integer,text)
drop cascades to function _testdb3_cluster.storeset_int(integer,integer,text)
drop cascades to function _testdb3_cluster.lockset(integer)
drop cascades to function _testdb3_cluster.unlockset(integer)
drop cascades to function _testdb3_cluster.moveset(integer,integer)
drop cascades to function _testdb3_cluster.moveset_int(integer,integer,integer,bigint)
drop cascades to function _testdb3_cluster.dropset(integer)
drop cascades to function _testdb3_cluster.dropset_int(integer)
drop cascades to function _testdb3_cluster.mergeset(integer,integer)
drop cascades to function _testdb3_cluster.issubscriptioninprogress(integer)
drop cascades to function _testdb3_cluster.mergeset_int(integer,integer)
drop cascades to function _testdb3_cluster.setaddtable(integer,integer,text,name,text)
drop cascades to function _testdb3_cluster.setaddtable_int(integer,integer,text,name,text)
drop cascades to function _testdb3_cluster.setdroptable(integer)
and other objects (see server log for list)
<stdin>:: NOTICE: Slony-I: Please drop schema "_testdb3_cluster"
<stdin>:: NOTICE: drop cascades to other objects
DETAIL: drop cascades to table _testdb3_cluster.sl_node
drop cascades to table _testdb3_cluster.sl_nodelock
drop cascades to table _testdb3_cluster.sl_set
drop cascades to table _testdb3_cluster.sl_setsync
drop cascades to table _testdb3_cluster.sl_table
drop cascades to table _testdb3_cluster.sl_sequence
drop cascades to table _testdb3_cluster.sl_path
drop cascades to table _testdb3_cluster.sl_listen
drop cascades to table _testdb3_cluster.sl_subscribe
drop cascades to table _testdb3_cluster.sl_event
drop cascades to table _testdb3_cluster.sl_confirm
drop cascades to table _testdb3_cluster.sl_seqlog
drop cascades to function _testdb3_cluster.sequencelastvalue(text)
drop cascades to table _testdb3_cluster.sl_log_1
drop cascades to table _testdb3_cluster.sl_log_2
drop cascades to table _testdb3_cluster.sl_registry
drop cascades to view _testdb3_cluster.sl_seqlastvalue
drop cascades to sequence _testdb3_cluster.sl_local_node_id
drop cascades to sequence _testdb3_cluster.sl_event_seq
drop cascades to sequence _testdb3_cluster.sl_action_seq
drop cascades to sequence _testdb3_cluster.sl_log_status
drop cascades to table _testdb3_cluster.sl_config_lock
drop cascades to table _testdb3_cluster.sl_event_lock
drop cascades to table _testdb3_cluster.sl_archive_counter
drop cascades to table _testdb3_cluster.sl_components
drop cascades to type _testdb3_cluster.vactables
drop cascades to function _testdb3_cluster.createevent(name,text)
drop cascades to function _testdb3_cluster.createevent(name,text,text)
drop cascades to function _testdb3_cluster.createevent(name,text,text,text)
drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text)
drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text)
drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text,text)
drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text,text,text)
drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text,text,text,text)
drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text,text,text,text,text)
drop cascades to function _testdb3_cluster.denyaccess()
drop cascades to trigger _testdb3_cluster_denyaccess on table t1
drop cascades to function _testdb3_cluster.lockedset()
drop cascades to function _testdb3_cluster.getlocalnodeid(name)
drop cascades to function _testdb3_cluster.getmoduleversion()
drop cascades to function _testdb3_cluster.resetsession()
drop cascades to function _testdb3_cluster.checkmoduleversion()
drop cascades to function _testdb3_cluster.decode_tgargs(bytea)
drop cascades to function _testdb3_cluster.logtrigger()
drop cascades to trigger _testdb3_cluster_logtrigger on table t1
drop cascades to function _testdb3_cluster.terminatenodeconnections(integer)
drop cascades to function _testdb3_cluster.killbackend(integer,text)
drop cascades to function _testdb3_cluster.seqtrack(integer,bigint)
drop cascades to function _testdb3_cluster.slon_quote_brute(text)
drop cascades to function _testdb3_cluster.slon_quote_input(text)
drop cascades to function _testdb3_cluster.slonyversionmajor()
drop cascades to function _testdb3_cluster.slonyversionminor()
drop cascades to function _testdb3_cluster.slonyversionpatchlevel()
drop cascades to function _testdb3_cluster.slonyversion()
drop cascades to function _testdb3_cluster.registry_set_int4(text,integer)
drop cascades to function _testdb3_cluster.registry_get_int4(text,integer)
drop cascades to function _testdb3_cluster.registry_set_text(text,text)
drop cascades to function _testdb3_cluster.registry_get_text(text,text)
drop cascades to function _testdb3_cluster.registry_set_timestamp(text,timestamp with time zone)
drop cascades to function _testdb3_cluster.registry_get_timestamp(text,timestamp with time zone)
drop cascades to function _testdb3_cluster.cleanupnodelock()
drop cascades to function _testdb3_cluster.registernodeconnection(integer)
drop cascades to function _testdb3_cluster.initializelocalnode(integer,text)
drop cascades to function _testdb3_cluster.storenode(integer,text)
drop cascades to function _testdb3_cluster.storenode_int(integer,text)
drop cascades to function _testdb3_cluster.enablenode(integer)
drop cascades to function _testdb3_cluster.enablenode_int(integer)
drop cascades to function _testdb3_cluster.disablenode(integer)
drop cascades to function _testdb3_cluster.disablenode_int(integer)
drop cascades to function _testdb3_cluster.dropnode(integer)
drop cascades to function _testdb3_cluster.dropnode_int(integer)
drop cascades to function _testdb3_cluster.failednode(integer,integer)
drop cascades to function _testdb3_cluster.failednode2(integer,integer,integer,bigint,bigint)
drop cascades to function _testdb3_cluster.failoverset_int(integer,integer,integer,bigint)
drop cascades to function _testdb3_cluster.uninstallnode()
drop cascades to function _testdb3_cluster.clonenodeprepare(integer,integer,text)
drop cascades to function _testdb3_cluster.clonenodeprepare_int(integer,integer,text)
drop cascades to function _testdb3_cluster.clonenodefinish(integer,integer)
drop cascades to function _testdb3_cluster.storepath(integer,integer,text,integer)
drop cascades to function _testdb3_cluster.storepath_int(integer,integer,text,integer)
drop cascades to function _testdb3_cluster.droppath(integer,integer)
drop cascades to function _testdb3_cluster.droppath_int(integer,integer)
drop cascades to function _testdb3_cluster.storelisten(integer,integer,integer)
drop cascades to function _testdb3_cluster.storelisten_int(integer,integer,integer)
drop cascades to function _testdb3_cluster.droplisten(integer,integer,integer)
drop cascades to function _testdb3_cluster.droplisten_int(integer,integer,integer)
drop cascades to function _testdb3_cluster.storeset(integer,text)
drop cascades to function _testdb3_cluster.storeset_int(integer,integer,text)
drop cascades to function _testdb3_cluster.lockset(integer)
drop cascades to function _testdb3_cluster.unlockset(integer)
drop cascades to function _testdb3_cluster.moveset(integer,integer)
drop cascades to function _testdb3_cluster.moveset_int(integer,integer,integer,bigint)
drop cascades to function _testdb3_cluster.dropset(integer)
drop cascades to function _testdb3_cluster.dropset_int(integer)
drop cascades to function _testdb3_cluster.mergeset(integer,integer)
drop cascades to function _testdb3_cluster.issubscriptioninprogress(integer)
drop cascades to function _testdb3_cluster.mergeset_int(integer,integer)
drop cascades to function _testdb3_cluster.setaddtable(integer,integer,text,name,text)
drop cascades to function _testdb3_cluster.setaddtable_int(integer,integer,text,name,text)
drop cascades to function _testdb3_cluster.setdroptable(integer)
and other objects (see server log for list)
[postgres@pg100 ~]$

删除成功。

Slony-I的删除:的更多相关文章

  1. PostgreSQL Replication之第十章 配置Slony(6)

    10.6 执行故障切换 一旦您学会了如何复制表并将它们添加到集合中,是时候学习故障转移了.基本上,我们可以在两个两种类型的故障转移之间做出区分: • 计划内故障转移 • 计划外故障转移和崩溃 在本节, ...

  2. PostgreSQL Replication之第十章 配置Slony(5)

    10.5 给复制添加表和管理的问题 一旦我们增加了此表到系统中,我们可以将它添加到复制设置.这样做有点复杂.首先,我们必须创建我们自己的新表集合并把这个和我们已经有的表合并.因此,过一段时间,我们将有 ...

  3. PostgreSQL逻辑复制之slony篇

    Slony是PostgreSQL领域中最广泛的复制解决方案之一.它不仅是最古老的复制实现之一,它也是一个拥有最广泛的外部工具支持的工具,比如pgAdmin3.多年来,Slony是在PostgreSQL ...

  4. "无法删除数据库,因为该数据库当前正在使用"问题解决

    异常处理汇总-数据库系列  http://www.cnblogs.com/dunitian/p/4522990.html 以前刚学数据库的时候比较苦恼这个问题,今天删除的时候又看见了,正好一起记录一下 ...

  5. php批量删除

    php批量删除可以实现多条或者全部数据一起删除 新建php文件 显示数据库中内容: <table width="100%" border="1" cell ...

  6. linux centos中添加删除修改环境变量,设置java环境变量

    前言 安装完软件必要添加环境变量.指令很少,然而长时间不写就会不自信:我写的对吗?于是百度开始,于是发现又是各有千秋.好吧,好记星不如烂笔头.当然,最重要的是,百度出来的都他妈的是如何添加环境变量,只 ...

  7. ASP.NET MVC一次删除多笔记录

    批量删除数据记录,如下面的截屏: 先选中想删除的记录,然后点一下删除铵钮,系统将把选中的记录一次性删除.在此,Insus.NET不想每删除一笔记录连接一次数据库. 因此需要把选择的记录一次上传至服务器 ...

  8. 如何区别数据库删除语句drop与delete与truncate?

    1.delete:删除数据表中的行(可以删除某一行,也可以在不删除数据表的情况下删除所有行) 删除某一行:delete from 数据表名称 where 列名称=值: 删除所有行:delete*fro ...

  9. sql 删除表中的重复记录

    嗯,遇见了表中存在重复的记录的问题,直接写sql删除时最快的,才不要慢慢的复制到excel表中慢慢的人工找呢.哼. 如下sql,找出重复的记录,和重复记录中ID值最小的记录(表中ID为自增长) sel ...

随机推荐

  1. [Everyday Mathematics]20150302

    $$\bex |p|<\frac{1}{2}\ra \int_0^\infty \sex{\frac{x^p-x^{-p}}{1-x}}^2\rd x =2(1-2p\pi \cot 2p\pi ...

  2. 【C++】非原创|统计代码覆盖率(一:C++)

    也是转别人的,因为我c++好菜好菜啊... http://blog.chinaunix.net/uid-23741326-id-3316943.html c++跟C基本是一样的,统计覆盖率,需要生成g ...

  3. [转]linux之date命令

    转自:http://www.cnblogs.com/peida/archive/2012/12/13/2815687.html 在linux环境中,不管是编程还是其他维护,时间是必不可少的,也经常会用 ...

  4. 使用Thrift RPC编写程序(服务端和客户端)

    1. Thrift类介绍 Thrift代码包(位于thrift-0.6.1/lib/cpp/src)有以下几个目录: concurrency:并发和时钟管理方面的库processor:Processo ...

  5. 前N个自然数的随机置换

    来自:[数据结构与算法分析——C语言描述]练习2.7 问题描述:假设需要生成前N个自然数的一个随机置换.例如,{4,1,2,5,2}和{3,1,4,2,5}就是合法的置换,但{5,4,1,2,1}却不 ...

  6. LINQ标准查询操作符(五)

    十二.相等操作符 如果两个序列的对应元素相等且这两个序列具有相同数量的元素,则视这两个序列相等. SequenceEqual方法通过并行地枚举两个数据源并比较相应元素来判断两个序列是否相等.如果两个序 ...

  7. HTTP Status 500 - Servlet.init() for servlet htmlWebConfig threw exception

    HTTP Status 500 - Servlet.init() for servlet htmlWebConfig threw exception

  8. Hadoop概念学习系列之hadoop生态系统闲谈(二十五)

    分层次讲解 最底层平台 ------->hdfs  yarn  mapreduce spark 应用层-------->hbase  hive   pig   sparkSQL    nu ...

  9. 2d网络游戏的延迟补偿(Lag compensation with networked 2D games)

    http://gamedev.stackexchange.com/questions/6645/lag-compensation-with-networked-2d-games ——————————— ...

  10. 记拿到鹅厂前端开发暑期实习offer的经历

    #想起来时的路 在真正拿到腾讯实习offer之前,也是看过不少人的面经,心生向往.很早在入前端坑之前,我就想着大四的时候有机会要尝试去腾讯里实习. 大一入门语言就是C++,这让我很无奈,所以我很快的就 ...