January 2019
M T W T F S S
« Dec    
 123456
78910111213
14151617181920
21222324252627
28293031  

Categories

WordPress Quotes

Cherish your visions and your dreams as they are the children of your soul, the blueprints of your ultimate achievements.
Napoleon Hill

Recent Comments

January 2019
M T W T F S S
« Dec    
 123456
78910111213
14151617181920
21222324252627
28293031  

Short Cuts

2012 SERVER (64)
2016 windows (9)
AIX (13)
Amazon (34)
Ansibile (19)
Apache (133)
Asterisk (2)
cassandra (2)
Centos (209)
Centos RHEL 7 (261)
chef (3)
cloud (2)
cluster (3)
Coherence (1)
DB2 (5)
DISK (25)
DNS (9)
Docker (28)
Eassy (11)
ELKS (1)
EXCHANGE (3)
Fedora (6)
ftp (5)
GIT (3)
GOD (2)
Grub (1)
Hacking (10)
Hadoop (6)
horoscope (23)
Hyper-V (10)
IIS (15)
IPTABLES (15)
JAVA (7)
JBOSS (32)
jenkins (1)
Kubernetes (2)
Ldap (5)
Linux (189)
Linux Commands (167)
Load balancer (5)
mariadb (14)
Mongodb (4)
MQ Server (24)
MYSQL (84)
Nagios (5)
NaturalOil (13)
Nginx (31)
Ngix (1)
openldap (1)
Openstack (6)
Oracle (34)
Perl (3)
Postfix (19)
Postgresql (1)
PowerShell (2)
Python (3)
qmail (36)
Redis (12)
RHCE (28)
SCALEIO (1)
Security on Centos (29)
SFTP (1)
Shell (64)
Solaris (58)
Sql Server 2012 (4)
squid (3)
SSH (10)
SSL (14)
Storage (1)
swap (3)
TIPS on Linux (28)
tomcat (60)
Uncategorized (29)
Veritas (2)
vfabric (1)
VMware (28)
Weblogic (38)
Websphere (71)
Windows (19)
Windows Software (2)
wordpress (1)
ZIMBRA (17)

WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

Who's Online

15 visitors online now
5 guests, 10 bots, 0 members

Hit Counter provided by dental implants orange county

Deploy a Distributed File System Server on CentOS 6

Distributed File Systems (DFS) are used to easily access multiple CIFS file shares, hosted on separate servers, using a single namespace on your network. The actual shares can either be hosted locally on the DFS server itself or on separate servers.

The benefit of using a single namespace for your users to access your shares is they don’t have to remember the names of each of your file servers; all shares can be accessed through one root name, regardless of where the actual file server resides. The access request will be redirected to the appropriate servers, all without the users’ knowledge.

Another benefit to using DFS, and it’s a major one, is the ability to migrate shared data from one storage platform or server to another, transparently and quickly without your users ever knowing. You simply redirect a DFS hosted share to a new CIFS share, without ever having to change the share’s name.

With standard cifs file servers, you either need to send your users to a new share path after migration or suffer downtime while flipping between the new and old file server hardware, suffering a possible lengthy outage – depending on the complexity of your shares and their permissions.

Before you Begin

This lab will be based on the following configuration.

  • One server running CentOS 6.X.
  • An Internet connection to access the the CentOS package repository.

Installing and Configuring Samba

  1. Install Samba.
    yum install samba
  2. Open Samba’s configuration file into a text editor, like VIM or Gedit.
    vi /etc/samba/smb.conf
  3. Under the [global] settings, define the following options, modifying the highlighted values to match your environment.
    [global]
     workgroup = WORKGROUP
     netbios = MY-DFS-SERVER
     host msdfs = yes

    Understanding the options we are defining:

    workgroup The name of your Windows peer-to-peer network. Microsoft’s default is WORKGROUP.
    netbios This is the single-label computer name used by a Windows on a network. Set this to the name you want your Samba server to have on the network.
    host msdfs The required parameter which tells Samba to act as a DFS host.

Set Samba Permissions for Selinux

Selinux on CentOS will block connections to Samba shares by default. We’ll need to lift this restriction to allow users to access our DFS and to grant them read/write permissions.

  1. Allow read and write permission to our samba shares:
    setsebool samba_export_all_rw yes

Create the DFS Root Directory

The DFS root directory is where you create your DFS targets – links to other CIFS shares. Targets are created by creating symbolic links to your other cifs shares, using the msdfs protocol. The shares can exist on any server. To keep things simple for this lab, we’ll create a cifs share on the DFS Root which we will create a target for.

  1. Create the directory that will host the CIFS targets:
    mkdir -p /export/dfsroot
  2. Make sure the DFS root directory is owned by Root.
    chown root:root /export/dfsroot
  3. Secure the DFS root to protect the DFS targets from changes by unauthorized users:
    chmod 755 /export/dfsroot

Create a Share to the DFS Root Directory

Next we’ll need to share the DFS root directory to allow our users to access our DFS targets from a single name-space. To do this, we’ll need to open up Samba’s configuration file and add a new share.

  1. Open Samba’s configuration file in text editor, like VIM:
    vi /etc/samba/smb.conf
  2. Near the bottom of the configuration file, create a Samba share to the DFS root by adding these lines to the bottom of the file, replacing the highlight lines to match your environment:
    [dfs]
     comment = DFS Root Share
     path = /export/dfsroot
     browsable = yes
     msdfs root = yes
     read only = no

Create a Share to be Used as a DFS Target

The DFS targets are the CIFS shares that a DFS root server will provide access to from a single name-space. These shares can be hosted on the local DFS root server or, ideally, on a separate server. To keep things simple, we’ll create our first share on the DFS root server.

  1. Prepare a directory to be shared out
    mkdir -p /export/samba/finance
  2. Define the share by opening Samba’s configuration file into a text editor, like VIM:
    vi /etc/samba/smb.conf
  3. Near the bottom of the file, configure you share so it looks similar to the following example:
    [finance]
     path = /export/samba/finance
     public = yes
     writable = yes
     browseable = yes

Add DFS Targets

Finally, it’s time to add some targets to our DFS server. The CIFS shares that we target can be on any host, Linux or Windows. To keep things simple in this tutorial, we’ll create a share on the local DFS host that we’ll use as a DFS target.

  1. Create a symbolic link to your DFS target.
    link -s msdfs:my-dfs-server\finance /export/dfsroot/finance
    Warning: The symbolic link file for the msdfs share must be lowercase. If it is not, you will get errors when trying to connect to the share.
  2. Restart the Samba’s daemon to apply our changes
    service smb restart

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

Blue Captcha Image
Refresh

*

Protected by WP Anti Spam