AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-320759

cuongnv23's questions

Martin Hope
cuongnv23
Asked: 2015-12-12 00:13:02 +0800 CST

使用 imapsync 工具迁移数千名用户的 IMAP 邮箱的最佳实践

  • 2

我打算将 IMAP 邮箱从 Exchange 2013 迁移到拥有超过 10k 用户的 Cyrus。我计划imapsync用作此工具。

[root@centos65]# imapsync --version
1.644

我正在测试 5 个用户和总共 134 封邮件(大多数是纯文本 + 一个 9MB 附件)。

首先,我尝试使用以下命令:

while read user pwd1 pwd2
do
    /usr/bin/imapsync \
    --host1 exchange_svr \
    --password1 "$pwd1" --user1 $user@domain \
    --authmech1 "PLAIN" \
    --host2 cyrus_svr --user2  $user@domain \
    --ssl1 --subscribeall \
    --authmech2 "PLAIN" \
    --password2 "$pwd2"
done < input

完成时间为1min 57sec。

使用一些选项希望加快速度:

  ...
  /usr/bin/imapsync \
--nofoldersizes --nofoldersizesatend --buffersize 49152000 --usecache --idatefromheader \ ## <-- add these options
--host1 exchange_svr \
  ...

完成时间1min 49sec,并没有快多少。

我的输入文件:

[email protected]   pwd1   pwd2
[email protected]   pwd1   pwd2
[email protected]   pwd1   pwd2
[email protected]   pwd1   pwd2
[email protected]   pwd1   pwd2

我已经测试了运行多个脚本,每个脚本将处理一些文件夹(使用--excludeor --include)但不是真的更快(实际上它花了 2 分钟)。

你们有任何最佳实践来与这么多用户/邮箱一起使用这个工具吗?有什么建议让我做得更好吗?

linux
  • 1 个回答
  • 5054 Views
Martin Hope
cuongnv23
Asked: 2015-11-29 05:22:10 +0800 CST

无法使用 Corosync/Pacemaker 启动 PostgreSQL 复制资源

  • 2

我正在使用 Corosync/Pacemaker 的 HA 在两台服务器(CentOS 6.5)上设置 PostgreSQL 复制。

我的软件信息:

postgresql91-9.1.19-1PGDG.rhel6.x86_64
postgresql91-server-9.1.19-1PGDG.rhel6.x86_64
postgresql91-libs-9.1.19-1PGDG.rhel6.x86_64
postgresql91-contrib-9.1.19-1PGDG.rhel6.x86_64
postgresql91-devel-9.1.19-1PGDG.rhel6.x86_64


corosynclib-1.4.7-2.el6.x86_64
corosync-1.4.7-2.el6.x86_64

pacemaker-cli-1.1.12-8.el6_7.2.x86_64
pacemaker-1.1.12-8.el6_7.2.x86_64
pacemaker-cluster-libs-1.1.12-8.el6_7.2.x86_64
pacemaker-libs-1.1.12-8.el6_7.2.x86_64

resource-agents-3.9.5-24.el6_7.1.x86_64

复制正在工作,从主服务器我可以看到从服务器连接:

-bash-4.1$ psql -c "select client_addr,sync_state from pg_stat_replication;" client_addr | sync_state -------------+------------ 172.16.1.10 | async (1 row)

而且我还确认在主服务器上创建的数据被复制到从服务器。

这是我的crm configure show:

node master                                                                  
node slave

primitive PSQL pgsql \
    params restart_on_promote=true pgctl="/usr/pgsql-9.1/bin/pg_ctl" psql="/usr/pgsql-9.1/bin/psql" pgdata="/var/lib/pgsql/9.1/data" node_list="master slave" repuser=rep rep_mode=sync restore_command="cp /var/lib/pgsql/pg_archive/%f %p" primary_conninfo_opt="keepalives_idle=60 keepalives_interval=5 keepalives_count=5" master_ip=172.16.1.100 archive_cleanup_command="/usr/pgsql-9.1/bin/pg_archivecleanup /var/lib/pgsql/pg_archive/ %r"
primitive RepIP IPaddr2 \
    params ip=172.16.1.100 nic=eth2 cidr_netmask=24 \
    op monitor interval=30s
primitive VirtualIP IPaddr2 \
    params ip=10.0.0.100 cidr_netmask=24 \
    op monitor interval=30s
group psql-ha VirtualIP RepIP \
    meta target-role=Started
property cib-bootstrap-options: \
    dc-version=1.1.11-97629de \
    cluster-infrastructure="classic openais (with plugin)" \
    expected-quorum-votes=2 \
    stonith-enabled=false \
    no-quorum-policy=ignore

但资源PSQL无法启动。我的crm status:

Last updated: Sat Nov 28 13:09:47 2015
Last change: Sat Nov 28 12:50:21 2015
Stack: classic openais (with plugin)
Current DC: master - partition with quorum
Version: 1.1.11-97629de
2 Nodes configured, 2 expected votes
3 Resources configured


Online: [ master slave ]

 Resource Group: psql-ha
     VirtualIP  (ocf::heartbeat:IPaddr2):   Started master 
     RepIP  (ocf::heartbeat:IPaddr2):   Started master 

Failed actions:
    PSQL_start_0 on slave 'not configured' (6): call=60, status=complete, last-rc-change='Sat Nov 28 12:50:21 2015', queued=0ms, exec=53ms

登录时出现错误/var/log/messages:

11 月 28 日 12:50:21 从属 pgsql(PSQL)[3387]:错误:复制(rep_mode=async 或 sync)需要主/从配置。

谁能为我解释为什么我会收到这个错误?

谢谢。

更新:

(主机名称更改为 node1/node2)

通过@gf_ 的配置解决了问题。

注意:忘记我的旧配置,我在这个部署模型中只使用一个虚拟 IP。

当前状态:

[root@node1 ~]# crm_mon -Af -1
Last updated: Wed Dec  2 05:13:56 2015
Last change: Wed Dec  2 05:10:06 2015
Stack: classic openais (with plugin)
Current DC: node2 - partition with quorum
Version: 1.1.11-97629de
2 Nodes configured, 2 expected votes
3 Resources configured


Online: [ node1 node2 ]

 VirtualIP  (ocf::heartbeat:IPaddr2):   Started node2 
 Master/Slave Set: msPSQL [PSQL]
     Masters: [ node2 ]
     Slaves: [ node1 ]

Node Attributes:
* Node node1:
    + PSQL-data-status                  : STREAMING|SYNC
    + PSQL-status                       : HS:sync   
    + master-PSQL                       : 100       
* Node node2:
    + PSQL-data-status                  : LATEST    
    + PSQL-master-baseline              : 000000000E000078
    + PSQL-status                       : PRI       
    + master-PSQL                       : 1000      

Migration summary:
* Node node1: 
* Node node2: 

工作配置:

node node1 \
    attributes PSQL-data-status="STREAMING|SYNC"
node node2 \
    attributes PSQL-data-status=LATEST
primitive PSQL pgsql \
    params restart_on_promote=false pgctl="/usr/pgsql-9.1/bin/pg_ctl" psql="/usr/pgsql-9.1/bin/psql" pgdata="/var/lib/pgsql/9.1/data" node_list="node1 node2" repuser=replicate rep_mode=sync restore_command="cp /var/lib/pgsql/pg_archive/%f %p" primary_conninfo_opt="keepalives_idle=60 keepalives_interval=5 keepalives_count=5" master_ip=10.0.0.100 archive_cleanup_command="/usr/pgsql-9.1/bin/pg_archivecleanup /var/lib/pgsql/pg_archive/ %r" \
    op start timeout=60s interval=0s on-fail=restart \
    op monitor timeout=60s interval=4s on-fail=restart \
    op monitor timeout=60s interval=3s on-fail=restart role=Master \
    op promote timeout=60s interval=0s on-fail=restart \
    op demote timeout=60s interval=0s on-fail=stop \
    op stop timeout=60s interval=0s on-fail=block \
    op notify timeout=60s interval=0s
primitive VirtualIP IPaddr2 \
    params ip=10.0.0.100 nic=eth1 cidr_netmask=24 \
    op monitor interval=30s
ms msPSQL PSQL \
    meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 target-role=Started notify=true
colocation rsc_colocation-1 inf: VirtualIP msPSQL:Master
order rsc_order-1 0: msPSQL:promote VirtualIP:start symmetrical=false
order rsc_order-2 0: msPSQL:promote VirtualIP:stop symmetrical=false
property cib-bootstrap-options: \
    dc-version=1.1.11-97629de \
    cluster-infrastructure="classic openais (with plugin)" \
    expected-quorum-votes=2 \
    no-quorum-policy=ignore \
    stonith-enabled=false \
    last-lrm-refresh=1449033003
rsc_defaults rsc-options: \
    resource-stickiness=100
postgresql
  • 1 个回答
  • 3840 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve