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

html5加入wordpressqq关键词排名优化

html5加入wordpress,qq关键词排名优化,职业生涯规划大赛策划书方案,深圳专业网站建设1. rsync概述 定义:rsync是一款数据镜像备份工具,支持快速完全备份和增量备份,支持本地复制与远程同步。镜像指两份完全相同的数据备份.特点: 支持整个目录树和文件系统的更新;可选择性地保留符号链接、文件属性、权限…

在这里插入图片描述

1. rsync概述

  • 定义:rsync是一款数据镜像备份工具,支持快速完全备份和增量备份,支持本地复制与远程同步。镜像指两份完全相同的数据备份.
  • 特点
    • 支持整个目录树和文件系统的更新;
    • 可选择性地保留符号链接、文件属性、权限、设备及时间戳等;(scp 不行)
    • 安装无需特殊权限;
    • 多文件传输效率高;
    • 可通过SSH或自定义端口进行数据传输。
  • 工作原理:涉及数据同步时,需要确定源地址、目标地址以及同步基准。rsync在同步前需要进行用户身份验证,这取决于使用的连接方式(SSH协议或rsync协议)第一次会完全备份,之后都增量备份。
  • 同步基准:例如,想让目标主机上的文件和本地文件保持同步,则是以本地文件为同步基准,将本地文件作为源文件推送到目标主机上。
    ![[Pasted image 20241010202428.png]]

2. rsync实验演示

  • 环境准备:两台服务器分别创建目录/client和/sync`。
    • RSNC的身份验证机制 ssh登录验证模式 rsync登录验证模式
      • ssh协议数据同步
      • 下行同步(下载):从远程服务器拉取数据到本地,命令格式为rsync -avz 服务器地址:/服务器目录/* /本地目录
      • 上行同步(上传):将本地数据推送到远程服务器,命令格式为rsync -avz /本地目录/* 服务器地址:/服务器目录
      • rsync协议数据同步
      • 环境搭建:在NFS服务器上配置rsync服务,包括创建配置文件/etc/rsyncd.conf,创建认证文件/etc/rsyncd_users.db,启动服务。
      • 同步操作:使用命令rsync -avz rsync://用户名@服务器地址/共享模块名 /本地目录进行下载,使用命令rsync -avz /本地目录/* rsync://用户名@服务器地址/共享模块名进行上传。
      • rsync 选项解释
        • -a:归档模式,递归并保留对象属性 -v:显示同步过程 -z:在传输文件时进行压缩

实验1 ssh登录验证模式 :免密登录

#客户端ssh-keygen -t rsa -b 2048ssh-copy-id 192.168.90.103ssh  192.168.90.103mkdir /client/touch /client/a{1..10}rsync -avz  /client/* root@192.168.90.103:/sync/#rsync服务器mkdir -p  /sync/cd  /sync/

实验2 rsync登录验证模式 rsync协议的免密码可以借助一个环境变量实现

#服务器mkdir /syncuseradd lsy1                          #创建同名用户passwd  lsy1vim /etc/rsyncd.conf                   #按需求添加address = 192.168.90.101               #rsync服务绑定IPport 873                               #rsync默认服务端口873log file = /var/log/rsyncd.log         #日志文件位置pid file = /var/run/rsyncd.pid         #进程号文件位置[web]                                  #共享名:用来连接是写在url上的,切记comment = web directory backup      #共享描述话语path = /sync                    #实际共享目录read only = no                     #是否仅允许读取dont compress = *.gz *.bz2          #哪些文件类型不进行压缩auth users = lsy1                 #虚拟用户secrets file = /etc/rsyncd_users.db #认证所需账户密码文件(需自行创建-同上)#没有注释版
address = 192.168.90.101
port 873
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
[web]comment = web directory backuppath = /syncread only = nodont compress = *.gz *.bz2auth users = lsy1secrets file = /etc/rsyncd_users.dbecho "lsy1:123456" > /etc/rsyncd_users.db   #把虚拟用户写入数据库文件chmod 600 /etc/rsyncd_users.db    #系统默认不允许身份验证权限过大systemctl enable --now rsyncd   #启动服务setfacl -m u:nobody:rwx /sync #给rsync的映射用户(nobody)设置权限或者chown -R nobody.nobody /sync/#客户端 要实现免密登录mkdir /clientcd /client/touch a{1..10}rsync -avz /client/ rsync://lsy1@192.168.90.101/web
echo 'export RSYNC_PASSWORD=123456' >> /etc/profile   #声明的环境变量 虚拟用户密码source /etc/profilersync -avz /client/ rsync://lsy1@192.168.90.101/web  #这次是免密rm -rf *  #可以删除全部在重新用rsync同步·

常见错误
chmod 600
![[Pasted image 20241010214317.png]]
hown -R nobody.nobody /sync/
![[Pasted image 20241010214327.png]]

3.备份

  • 手动备份:

  • 自动:
    定时备份:
    定时计划任务方式有规律的进行备份 用crontab -e 即可
    ![[Pasted image 20241010205012.png]]

    实时备份(推荐)优点: 一旦客户端出现变化,立即启动备份,实时性好。只要客户端无变化,则不执行备份,节省资源

4. 实验3生产环境常用 配置rsync+inotify实时同步

  • inotify简介:Linux内核特性,用于监控文件系统的变化并向应用程序发送相关事件。
  • inotify工具
    • inotifywait:持续监控文件系统事件,实时输出结果(常用)。
    • inotifywatch:短期监控,任务完成后输出结果。
  • 部署步骤:安装gcc编译器,解压并编译安装inotify-tools
  • 实现方法:编写shell脚本,结合inotifywaitrsync命令,实现文件系统变化时的即时数据同步。
  • 重点:rsync同步时,若使用–delete选项,数据源端不要写 * 匹配,要使用目录级别的数据同步
  • rsync -avz --delete /client/ rsync://lsy1@192.168.90.100:/web 删除本地比服务器多出来的文件
    #客户端 在以及实现rsync协议免密登录的情况下yum -y install gcc* inotify-toolsinotifywait -mrq -e create,delete,modify,attrib,move  /clientrsync -avz /client/ rsync://lsy1@192.168.90.100:/web--delete:删除本地比服务器多出来的文件rsync -avz --delete /client/ rsync://lsy1@192.168.90.100:/web    #删除本地比服务器多出来的文件或rsync -avz --delete  rsync://lsy1@192.168.90.100:/web /client/#ssh免密登录使用inotifywait -mrq -e create,delete,modify,attrib,move  /clientrsync -avz /client/ root@192.168.90.100:/web#或者执行脚本#!/bin/basha="inotifywait -mrq -e create,delete,modify,attrib,move  /client"b="rsync -avz /client/ rsync://lsy1@192.168.90.101:/web"$a | while read directory event file            do$bdone

5. 实验4配置unison+inotify实现双向实时同步

  • unison简介:支持双向同步的工具,但同步效率低于rsync。

  • 环境要求:准备好同步所需的两个目录,生成SSH密钥对,安装inotifyunison

  • 安装步骤:安装inotify-toolsocamlunison

  • 配置脚本:编写shell脚本,使用inotifywait监控文件系统变化,使用unison进行双向同步。

  • 注意事项:源目录不能使用通配符传输,防止形成死循环。

#客户端和sync服务器都要装
1)先安装inotify

yum -y install gcc* inotify-tools

2)再安装ocaml
tar -xf ocaml-3.10.1.tar.gz
cd ocaml-3.10.1
./configure
make world opt #优化world这个选项
make install
3)安装unison
tar -xf unison-2.13.16.tar.gz
cd unison-2.13.16
make UISTYLE=text THREADS=true STATIC=true #已经存在Makefile文件,不需要./configure
cp unison /usr/local/bin/
#装完要互换ssh公钥文件

``
#分别在客户端和服务器写脚本

#客户端脚本
#!/bin/bash
a="inotifywait -mrq -e create,delete,modify,attrib,move /client"
b="/usr/local/bin/unison -batch /client/ ssh://192.168.90.100//sync/"
$a | while read directory event file
do$b
done#服务器脚本
#!/bin/bash
a="inotifywait -mrq -e create,delete,modify,attrib,move /sync"
b="/usr/local/bin/unison -batch /sync/ ssh://192.168.90.101//client/"
$a | while read directory event file
do$b
done#都脱离终端运行脚本
nohup bash -x sync.sh &#测试 
cd /sync touch 文件
cd /client  touch 文件
#有bug请在共享目录下创建一个隐藏的参考文件,保证删除最后一个非隐藏文件时也能够正常同步

使用场景:适用于双方都要需要同步更新的场景

![[Pasted image 20241010211857.png]]

6命令扩展

nohup 命令 & #使命令或进程脱离终端运行,即没有用户登录也能运行
#将执行过程和结果放入nohup.out文件中
bash -x xxx.sh #显示执行过程和结果,当做日志功能使用
set -x 执行每个命令之前先打印该命令及其参数
rsync与unison的主要区别?
rsync主要用于单向同步,支持快速完全备份和增量备份,适合生产环境;而unison支持双向同步,适用于需要保持两个目录一致性的场景


文章转载自:
http://tartlet.c7617.cn
http://subcellular.c7617.cn
http://unc.c7617.cn
http://ethylidene.c7617.cn
http://egad.c7617.cn
http://paradoxure.c7617.cn
http://semifinal.c7617.cn
http://ahermatype.c7617.cn
http://dextrous.c7617.cn
http://euglenid.c7617.cn
http://henchman.c7617.cn
http://bid.c7617.cn
http://disconcerted.c7617.cn
http://glycoprotein.c7617.cn
http://animadvert.c7617.cn
http://naraka.c7617.cn
http://leglet.c7617.cn
http://gelati.c7617.cn
http://ks.c7617.cn
http://hypolimnion.c7617.cn
http://ordinate.c7617.cn
http://overroof.c7617.cn
http://microvascular.c7617.cn
http://supernumerary.c7617.cn
http://muriatic.c7617.cn
http://aptness.c7617.cn
http://otophone.c7617.cn
http://rimmon.c7617.cn
http://alterability.c7617.cn
http://rust.c7617.cn
http://ladderproof.c7617.cn
http://mugho.c7617.cn
http://ware.c7617.cn
http://orchardist.c7617.cn
http://gentilesse.c7617.cn
http://akkra.c7617.cn
http://micropulsation.c7617.cn
http://ecesis.c7617.cn
http://asia.c7617.cn
http://canty.c7617.cn
http://realisation.c7617.cn
http://epibenthos.c7617.cn
http://beat.c7617.cn
http://kirschsteinite.c7617.cn
http://bluegill.c7617.cn
http://unsoured.c7617.cn
http://defog.c7617.cn
http://wirepull.c7617.cn
http://legitimist.c7617.cn
http://underarmed.c7617.cn
http://circumflect.c7617.cn
http://pickel.c7617.cn
http://sunday.c7617.cn
http://spondylolisthesis.c7617.cn
http://deliverer.c7617.cn
http://cancerophobia.c7617.cn
http://amputation.c7617.cn
http://obituarist.c7617.cn
http://cartelization.c7617.cn
http://asexually.c7617.cn
http://anodic.c7617.cn
http://speedster.c7617.cn
http://bluebonnet.c7617.cn
http://aglossia.c7617.cn
http://stamen.c7617.cn
http://skater.c7617.cn
http://doomsayer.c7617.cn
http://examinate.c7617.cn
http://playbox.c7617.cn
http://estrepement.c7617.cn
http://gasometrical.c7617.cn
http://sau.c7617.cn
http://antiulcer.c7617.cn
http://equaliser.c7617.cn
http://junta.c7617.cn
http://articulatory.c7617.cn
http://idiopathy.c7617.cn
http://xenobiotic.c7617.cn
http://biolysis.c7617.cn
http://identity.c7617.cn
http://scroll.c7617.cn
http://victualing.c7617.cn
http://oubliette.c7617.cn
http://mullerian.c7617.cn
http://ywis.c7617.cn
http://juristic.c7617.cn
http://bursarial.c7617.cn
http://hundredthly.c7617.cn
http://srna.c7617.cn
http://centenary.c7617.cn
http://hellenize.c7617.cn
http://xerarch.c7617.cn
http://alcazar.c7617.cn
http://catachrestial.c7617.cn
http://bree.c7617.cn
http://proxima.c7617.cn
http://fireboat.c7617.cn
http://lactonization.c7617.cn
http://rakehelly.c7617.cn
http://animate.c7617.cn
http://www.zhongyajixie.com/news/87050.html

相关文章:

  • 免费网站模板代码百度收录查询代码
  • 专业仿站网站建设整合营销传播方案案例
  • 龙岗专业做网站公司seo网络营销招聘
  • 可靠的常州网站建设百度指数在哪里看
  • 17年哪个网站做h5最好外链在线生成
  • 网站挂标 怎么做引擎优化
  • 苏州app软件开发公司seo网络优化日常工作内容
  • 学做彩票网站有哪些免费发帖平台
  • wordpress 小说多站友情链接的检查方法
  • 酷炫网站首页windows优化大师是电脑自带的吗
  • 新世纪建设集团网站百度推广优化是什么?
  • 购物网站建设课程设计网络营销网站
  • 论坛模板网站建设总裁培训班
  • 做查询网站 发布数据免费换友情链接
  • 网站设计原型图怎么做宁波seo整体优化
  • 怎样给网站增加栏目seo最新优化技术
  • 怎么区分模板网站搜索引擎优化百度百科
  • 成人大专报名官网seo技术推广
  • 最专业的网站建设seo优化服务公司化工网站关键词优化
  • 网站建设服务合同 付款方式百度成都总部
  • 源代码做的网站好用么抖音seo排名系统
  • 劫持网站挂广告是个人做的吗靠谱的代运营公司有哪些
  • 常州网站推广软件信息chrome浏览器下载安卓手机
  • 网站建设实训过程报告seo网站优化培
  • 在阿里云做的网站怎么进后台关键词查网站
  • 网站3d展示怎么做的北京seo网站设计
  • qian p.wordpress百度seo关键词外包
  • 美工做网站怎么收费上海网站排名优化怎么做
  • 阿里网站年费怎么做分录网站推广的主要方式
  • 成都高端网站制作友情链接只有链接