Chinaunix首页 | 论坛 | 博客
  • 博客访问: 378925
  • 博文数量: 165
  • 博客积分: 436
  • 博客等级: 下士
  • 技术积分: 887
  • 用 户 组: 普通用户
  • 注册时间: 2011-11-10 02:49
文章分类

全部博文(165)

文章存档

2012年(95)

2011年(70)

分类:

2011-12-01 00:15:09

    今天遇到一个问题,需要将一台网站的日志目录挂载到日志服务器上,但是这个网站的日志目录也是从NFS上挂载过来的,这样就涉及到NFS二次挂载的问题,找了些资料,发现这样是不能支持的。没有办法,只能想其他办法,用samba来挂载。
    1、先在网站服务器上用yum来安装samba服务
    2、在/etc/samba/smb.conf做如下配置
[twioo_mysql_log]
        comment = twioo_mysql_log 
        path = /PictureShare/twiooAttachments/log 
        browseable = yes
        guest ok = yes
        writable = no  ###不能写入,不能删除
        valid users = twiooAPP 
        create mask = 0664
        directory mask = 0777
    3、smbpasswd –a  twioo  ###新建samba用户,并输入密码
###-a参数一定要加,在新建samba密码之前,要在系统上新建这个账号,可以不需要密码,否则会报如下错误
  1. Failed to find entry for user oracle.
  2. Failed to modify password entry for user oracle
从windows上挂载的时候会报用户名密码错误,从linux商挂载会报如下错误
  1. mount error 13 = Permission denied
  2. Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
    4、重启service smb start服务 (ntsysv)
    5、在日志服务器上挂载
mount -t cifs -o username=twioo,password=twioo //172.31.1.108/twioo_mysql_log /twioo-log
rhel 5.0以后版本mount不再支持smbfs,只能使用cifs
    6、日志服务器和samba服务器之间需要开启以下端口通信
                       iptables -A INPUT -p udp --dport 137 -j ACCEPT
                       iptables -A INPUT -p udp --dport 138 -j ACCEPT
                       iptables -A INPUT -p tcp --dport 139 -j ACCEPT
                       iptables -A INPUT -p tcp --dport 445 -j ACCEPT
阅读(704) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~