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

香港可以做违法网站吗/seo网站推广经理

香港可以做违法网站吗,seo网站推广经理,基于o2o的旅游网站建设,网站建设组织1、搭建前准备 bucardo是PostgreSQL数据库中实现双向同步的软件,可以实现PostgreSQL数据库的双master的方案,不过bucardo中的同步都是异步的,它是通过触发器记录变化,程序是perl写的.bucardo可以实现postgresql的多主复制、主从同…

1、搭建前准备
bucardo是PostgreSQL数据库中实现双向同步的软件,可以实现PostgreSQL数据库的双master的方案,不过bucardo中的同步都是异步的,它是通过触发器记录变化,程序是perl写的.bucardo可以实现postgresql的多主复制、主从同步,甚至可以以postgresql为源库,可以和oracle、mysql、mongodb等很多数据库进行数据异步同步。

而pg原生的stream replication;虽可以同步;只能单向同步。只能是只读操作。而bucardo不支持DDL的同步; 所以说 相当于对stream replication的关系;相当于同oracle中 ogg对dg。

需要在两个节点都执行。
1.1、perl安装
由于bucardo是一个perl语言编写的程序,其依赖PG数据库的plperl语言组件,进而严格依赖perl的版本,所以这里建议安装新版本的perl。

$ tar zxvf perl-5.24.4.tar.gz
$ cd perl-5.24.4
./Configure
make
make install

进行Configure时务必不要指定-d参数,其中有2个重要选项不能采用默认配置:
Build a shared libperl.so (y/n) [n] 这里要选Y
Build a threading Perl? [n] 这里要选Y

安装完成后登陆数据库查看plperl语言组件是否能正确运行:
create language plperlu;
create language plperl;

1.2、bucardo和相关依赖包安装
依次安装test-simple、extutils-makemaker、version,DBI、DBD:Pg、DBIx-Safe:
perl Makefile.PL
make
make install

2、bucardo同步配置
先在两个节点上都建立需要同步的数据库:

createdb bctest

然后为了测试,使用pg_bench工具创建演示的表:
现在主库运行:

pg_bench -i bctest -s 100

在备库同样执行:

pg_bench -i bctest

由于备库是需要同步的表,可以先清除掉备库中表里面的数据:

truncate table pgbench_accounts;
truncate table pgbench_branches;
truncate table pgbench_history;
truncate table pgbench_tellers;

至此,实验环境就已经搭建完成,下面开始同步配置:

2.1、初始化bucardo
首先在当前操作系统用户的HOME目录下面建立文件 .bucardorc
bill@docker-> vi .bucardorc
default_email_from = myhost@myinc.com
default_email_host = mailhost.myinc.com
default_email_to = bill@mailhost.com
log_conflict_file = /home/bill/bucardo/bucardo_conflict.log
piddir = /home/bill/bucardo/run
reason_file = /home/bill/bucardo/log/bucardo.restart.reason.log
warning_file = /home/bill/bucardo/log/bucardo.warning.log
syslog_facility = LOG_LOCAL2
注:需要把对应的目录和文件先手动创建。

然后运行bucardo install命令进行初始化:
Changed database name to: bctest
Current connection settings:

  1. Host: /home/bill/pgdata
  2. Port: 1921
  3. User: bill
  4. Database: bctest
  5. PID directory: /home/bill/bucardo/run
    Enter a number to change it, P to proceed, or Q to quit: P

Attempting to create and populate the bucardo database and schema
Database creation is complete

Updated configuration setting “piddir”
Installation is now complete.
If you see errors or need help, please email bucardo-general@bucardo.org

You may want to check over the configuration variables next, by running:
bucardo show all
Change any setting by using: bucardo set foo=bar

这里的user和database需要根据前面设置的进行修改。

2.2、添加数据库信息

bill@docker-> bucardo add db db1 dbname=bctest  user=bill
Added database "db1"
bill@docker-> bucardo add db db2 dbname=bctest host=192.168.7.177 user=bill password=bill
Added database "db2"

注:这里添加db2的时候要注意需要先设置bill用户的密码。

2.3、添加表

bill@docker-> bucardo add all tables
New tables added: 4
bill@docker-> bucardo add all sequences
Sorry, no sequences were found
New sequences added: 0

如果要添加某一个表,则可以bucardo add table tablename

2.4、添加群组

bill@docker-> bucardo add relgroup relgroup1 pgbench_branches pgbench_accounts;
Created relgroup "relgroup1"
The following tables or sequences are now part of the relgroup "relgroup1":public.pgbench_accountspublic.pgbench_branches
bill@docker-> bucardo add dbgroup dbgroup1 db1:source db2:target
Created dbgroup "dbgroup1"
Added database "db1" to dbgroup "dbgroup1" as source
Added database "db2" to dbgroup "dbgroup1" as target

2.5、添加同步

bill@docker-> bucardo add sync sync1 relgroup=relgroup1 dbs=dbgroup1
Added sync "sync1"

这里注意的是;同步到表需要主键约束;不然同步是添加不了的。这个是跟触发器有关系;bucardo是建立在触发器之上的。

2.6、启动bucardo

bill@docker-> bucardo start
Checking for existing processes
Removing file "/home/bill/bucardo/run/fullstopbucardo"
Starting Bucardo

–查看状态

bill@docker-> bucardo status
PID of Bucardo MCP: 5796Name    State    Last good    Time     Last I/D    Last bad    Time  
=======+========+============+========+===========+===========+=======sync1 | Good   | 08:29:40   | 4m 52s | 0/0       | none      |     

至此就已经完成bucardo同步,需要注意bucardo无法同步DDL操作。

http://www.lbrq.cn/news/1477531.html

相关文章:

  • 网站建设策划怎么沟通/百度收录提交入口地址
  • 大连网站程序开发/百度图片搜索引擎
  • 深圳定制网站制作招聘网/网络营销推广平台有哪些
  • 名字做藏头诗的网站/网站建设需要多少钱?
  • 政府网站集约化建设十分重要/重庆百度seo整站优化
  • 学习做网站只学过c/免费发布活动的平台
  • 上海网站建设的价格低/专业软文发布平台
  • 润州网站建设/铁力seo
  • 新疆网站建设一条龙服务/seo实战培训视频
  • 没有网站做cpa/广告网站有哪些
  • 网站制作交易流程/竞价推广
  • 古镇中小企业网站建设/厦门网站设计公司
  • visual studio网站开发/西安网络推广优化培训
  • ip加端口可以做网站吗/广告策划方案怎么做
  • 海淀区社会建设工作办公室网站/保定百度首页优化
  • 诸暨网站制作有哪些公司/项目推广平台排行榜
  • 网站转移空间/网站数据统计工具
  • wordpress 商业模式/百度刷排名seo软件
  • 俄语在线网站制作/上海专业做网站
  • 怎么设网站/网络广告营销策划方案
  • 网页设计流行趋势/免费seo网站的工具
  • 网站备份数据库/培训机构排名一览表
  • 建筑网站绿地新里城/b2b平台运营模式
  • 设计做兼职的网站求推荐/营销推广公司
  • 兰州拼团网站建设/实训百度搜索引擎的总结
  • 专门做ppt的网站斧头/制作一个网站的流程有哪些
  • python 网站开发 sae/河南网站推广
  • 机械公司网站建设/百度推广没有效果怎么办
  • html展示网站源代码/百度一下百度首页官网
  • 企业网站的基本功能有哪些/网络营销前景和现状分析
  • jenkins从入门到精通-P1—九五小庞
  • 通过观看数百个外科手术视频课程来学习多模态表征|文献速递-医学影像算法文献分享
  • Ubuntu-Server-24.04-LTS版本操作系统如何关闭自动更新,并移除不必要的内核
  • 技术信任革命:区块链重构信用机制全解析
  • 8.1.1 不一样的kv存储RocksDB的使用场景
  • Python爬虫07_Requests爬取图片