• backup-rsync主机配置


    1.1 backup主机配置
    1.1.1 安装rsync服务
    1.安装rsync

    [root@backup ~]# yum install rsync -y

    2.配置rsync

    [root@backup ~]# vi /etc/rsyncd.conf

    uid = www
    gid = www
    port = 873
    fake super = yes
    use chroot = no
    max connections = 200
    timeout = 600
    ignore errors
    read only = false
    list = false
    hosts allow = 172.16.1.0/24
    hosts deny = 0.0.0.0/32
    auth users = rsync_backup
    secrets file = /etc/rsync.password
    log file = /var/log/rsyncd.log
    #####################################
    [backup]
    comment = welcome to backup!
    path = /backup
    
    [nfs]
    path = /data/www

    #创建rsync运行程序用户(设置为www用户是为了做NFS系统做准备)

    [root@backup ~]# groupadd -g 666 www

    [root@backup ~]# useradd -u 666 -g www www

    [root@backup ~]# id www

    uid=666(www) gid=666(www) groups=666(www)

    #建立虚拟账户对应的用户名与密码(用于客户端连接的账户和密码)

    [root@backup ~]# echo 'rsync_backup:123456' >/etc/rsync.password

    [root@backup ~]# cat /etc/rsync.password

    rsync_backup:123456

    [root@backup-41 ~]# chmod 600 /etc/rsync.password

    #创建仓库目录,授权属主和属组

    [root@backup ~]# mkdir /backup

    [root@backup ~]# chown -R www.www /backup

    [root@backup ~]# mkdir /data/www -p

    [root@backup ~]# chown -R www.www /data/www/

    3.启动服务及加入自启动

    [root@backup ~]# systemctl start rsyncd

    [root@backup ~]# systemctl enable rsyncd

    Created symlink from /etc/systemd/system/multi-user.target.wants/rsyncd.service to /usr/lib/systemd/system/rsyncd.service.

    #检查开机自启动

    [root@backup ~]# systemctl is-enabled rsyncd

    enabled

    #检查服务状态

    [root@backup ~]# systemctl status rsyncd

    ● rsyncd.service - fast remote file copy program daemon

    Loaded: loaded (/usr/lib/systemd/system/rsyncd.service; enabled; vendor preset: disabled)

    Active: active (running) since Sat 2018-07-28 01:03:28 CST; 16s ago

    Main PID: 1084 (rsync)

    CGroup: /system.slice/rsyncd.service

    └─1084 /usr/bin/rsync --daemon --no-detach

    Jul 28 01:03:28 backup systemd[1]: Started fast remote file copy program daemon.

    Jul 28 01:03:28 backup systemd[1]: Starting fast remote file copy program daemon...

    Jul 28 01:03:28 backup rsyncd[1084]: params.c:Parameter() - Ignoring badly formed line in config file: ignore errors

    Jul 28 01:03:28 backup rsyncd[1084]: rsyncd version 3.1.2 starting, listening on port 873

    #检查端口

    [root@backup ~]# netstat -lntp|grep 'rsync'

    tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN 1084/rsync

    tcp6 0 0 :::873 :::* LISTEN 1084/rsync

  • 相关阅读:
    Vue 组件4 动态组件
    Vue 组件3 作用域插槽
    Vue 组件 非父子组件通信
    vue 组件1
    单例模式--反射--防止序列化破坏单例模式
    遇到构造器中有多个可选参数时要考虑用构建器
    考虑用静态工厂方法代替构造器的场景
    转载--技术人员的发展之路
    一道lambda表达式题目
    想法跟实践的距离
  • 原文地址:https://www.cnblogs.com/wangkaiok/p/11943727.html
Copyright © 2020-2023  润新知