Home  >  Q&A  >  body text

主从备份 - 跪求mysql 高可用主从方案

迷茫迷茫2719 days ago512

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 16:39:25

    Do you want real-time backup, or just scheduled backup?
    For scheduled backup, I recommend you to use xtracbackup, which is about this statement

    innobackupex --no-timestamp --user=${user_name} --password=${password} --host=${ip} --port=${port} --include=${j} --stream=tar ${backdir}/${i}/${j} 2>${out_log} | pigz -9 -p ${cpu_auditor} >${backdir}/${i}/${j}/${j}.tar.gz
    

    Cpu_auditor can be configured in half according to the number of server cores to avoid affecting the production environment. After the backup, you can also perform tar.gz compression mode.
    Supports hot standby and cold standby, that is, incremental backup is supported.
    The backup data files can be up to hundreds of gigabytes. . . Don’t ask me why I know, I prepared a single table of 300G last month
    The specific script is not convenient to provide, but the information can still be recommended to read,
    Portal →: http://www.cnblogs.com/Amaran. ..

    reply
    0
  • Cancelreply