NFS文件共享配置

匿名 (未验证) 提交于 2019-12-02 23:32:01
      1. NFS Client 挂载卸载

卸载使用umount
# umount /usr/local/freeswitch/conf

 

 

    1. rsync文件同步配置
      1. rsync介绍

     rsync是类linux系统下的数据镜像备份工具――remote sync。一款快速增量备份工具 Remote Sync,远程同步。支持本地复制,或者与其他SSH、rsync主机同步。

      这个工具可以作为Freeswitch跨数据中心节点的配置文件的同步。

      1. rsync安装

服务端与客户端都需要安装rsync

安装命令:

yum install rsync

      1. rsync服务端配置

步骤1:生成并编辑配置文件rsyncd.conf

#touch /etc/rsyncd.conf  #生成rsync的配置文件

 

#vi /etc/rsyncd.conf   

 

具体内容如下所示(需要手动输入):

secrets file = /etc/rsyncd.secrets

read only = yes

list = yes

uid = root

gid = root  

hosts allow = 10.3.4.219  #客户端IP地址,多个以空格分开

#hosts deny = 10.4.5.0/24

use chroot = no

max connections = 10

log file = /var/log/rsyncd.log

pid file = /var/run/rsyncd.pid

lock file = /var/run/rsync.lock

charset=GBK

 

[rsyncd]  

comment = pag's directory      #自己添加说明

path = /home/test              #要同步的目录

auth users = rsync             #使用的用户

secrets file = /etc/rsyncd.secrets

 

步骤2:生成验证文件

# echo "rsync:rsync" > /etc/rsyncd.secrets  (rsync:rsync为用户和密码,格式为user:passwd)

#  chown  root:root  /etc/rsyncd.secrets

#  chmod  600  /etc/rsyncd.secrets

 

      1. rsync客户端配置

步骤1:在/etc目录下生成rsyncd.secrets文件

#echo "rsync">/etc/rsyncd.secrets

#chmod 600/etc/rsyncd.secrets

 

      1. rsync文件同步

步骤1:服务端rsync以守护进程形式启动

 

注:rsync启动的端口为 873端口,注意防火墙要打开该端口

另外最好用chkconfig将rsync设置为开机自动启动

# chkconfig --level 35 rsync on

 

步骤2:客户端用如下命令进行手工文件同步

# rsync -vzurtopg --progress rsync@10.3.4.228.::rsyncd /home/test

  --password-file=/etc/rsyncd.secrets

注:可以将上述命令写成一个脚本,然后用crontab设置定时执行,实现定时同步,比如一分钟同步一次

 

 

  1. 常见问题解决方法
    1. 用nslookup 解析域名解析不了
      1. 现象描述

出现类似如下的错误:

can't find regserver.yealink.com: Non-existent domain

      1. 原因分析

没有正确设置DNS服务器

      1. 处理方法

对于Linux:

#vi /etc/resolv.conf

添加如下内容:

nameserver    xxx.xxx.xxx.xxx  //dns服务器的IP

 

对于window:

在本地连接中将自己搭建的dns设为主dns服务器

 

转载请标明出处:NFS文件共享配置
文章来源: https://blog.csdn.net/AICCGo/article/details/90206156
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!