364twefwq 发表于 2014-9-16 09:05:17

linux(glusterfs)与windows文件共享设置(续)

本帖最后由 364twefwq 于 2014-9-16 09:10 编辑

针对gluster文件系统与windows系统间利用samba服务完成对文件传递。
samba版本:4.1.1-37.el7
glusterfs版本:3.5.2-1.el7

首先安装配置glusterfs
1、下载glusterfs yum源
wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repo

2、通过yum安装glusterfs
yum install glusterfs glusterfs-server glusterfs-fuse

3、修改hosts文件
   IP 计算机名

4、注册存储计算机
gluster peer probe IP(计算机名)
Q:peer probe: failed: Probe returned with unknown errno 107
原因:gluster端口24007被拦截
M:iptables -I INPUT -p tcp --dport 24007 -j ACCEPT

5、创建gluster卷
gluster volume create NAME IP(Hostname):storepath force
注:a、这的volume类型默认为分布式(glusterfs提供多种类型的文件存储方式)
         b、force参数,如果文件系统没有指定的storepath,会自动创建,不加此参数会提示storepath不存在

6、启动gluster卷
gluster volume start NAME
详情请阅:Glusterfs介绍安装配置
其次安装配置Samba服务
1、安装samba软件;
yum install samba

2、安装samba客户端
yum install samba-client

3、配置samba
修改/etc/samba/smb.conf

a、修改global参数

server string = server uniqune name
hosts allow = ips
netbios name = host display name
workgroup = window's group
b、配置共享目录
[共享名]
comment = 共享目录说明信息
path = /data-storage path
public = yes
writeable = yes
4、创建数据存放目录
mkdir -p /data-storage path

5、设置数据目录权限
chmod 775 /data-storage path

6、创建数据目录访问用户
useradd datausr -s /sbin/false #不可以用该用户登录系统

7、添加samba用户
smbpasswd -a samba's usr
typed password of samba's usr

8、配置防火墙
a、iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
    iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 137 -j ACCEPT
    iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 138 -j ACCEPT
    iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT

b、保存防火墙配置
    service iptables save

c、重启防火墙
    service iptables restart

9、关闭enlinux
   setenforce 0

10、启动samba服务
a、smbd
b、nmbd

最后配置glusterfs与samba共享
1、将gluster创建的volume挂载到samba共享目录
mount -t glusterfs hostname(ip):/volume-name shared_path
2、更改shared_path权限
chmod 775 shared_path

注:这里提供的共享配置只能在windows访问共享目录,在Linux下访问共享目录会提示session setup failed: NT_STATUS_LOGON_FAILURE

页: [1]
查看完整版本: linux(glusterfs)与windows文件共享设置(续)