Simple configuration of Samba/NFS servers on RHEL6.4

Source: Internet
Author: User

Recently, I tried to build a NAS on RHEL6.4. The XFS file system is used at the underlying layer to provide samba and NFS Protocol sharing. Here I will record the main steps.

 

Environment: RHEL6.4, IP: 192.168.50.117

 

1. Disable firewall and SELinux
View SELINUX status:
# Sestatus
Disable SELinux:
# Vim/etc/selinux/config
SELINUX = "" ==> SELINUX = disabled
# Setenforce 0

View the Firewall Status:
Chkconfig -- list iptables
Disable Firewall:
# Chkconfig iptables off
Service iptables stop


2. Format/dev/sdc as an xfs file system.
# Mkfs. xfs-f/dev/sdc
The default format parameter is used here. More parameters can be man mkfs. xfs.


3. mount the xfs File System
# Cd/usr/lolcal/ldNAS
# Mkdir share1
# Chmod 777-R share1
# Mount-t xfs/dev/sdc/usr/local/ldNAS/share1


4. Enable automatic mounting of the file system upon startup
# Vim/etc/fstab
Add a row at the end
/Dev/sdc/usr/local/ldNAS/share1 xfs defaults 0 0


5. Configure samba
RHEL6 samba has been installed and started. You can use the command # service smb status to view the status.
1) modify the samba configuration file
# Vim/etc/samba/smb. conf
Add the following content:
[Share1]
Comment = 0
Path =/usr/local/ldNAS/share1
Browseable = yes
Public = yes
Writable = yes
Guest OK = yes

2) Restart samba
# Service smb restart
Then the client should be able to map // 192.168.50.117/share1 and read and write files normally.


6. Configure NFS
NFS is installed by default in RHEL 6.4.
# Rpm-qa | grep nfs
You do not need to install portmap.

1). Modify the NFS configuration file
# Vim/etc/exports
Add:
/Usr/local/ldNAS/share1 * (rw, sync, root_squash)
2) restart the nfs service.
# Service nfs restart
3) mount the linux Client
# Mount 100.0.7.117:/usr/local/ldNAS/share1/mnt/nfs1
Uninstall
# Umount/mnt/nfs1
Add "mount 100.0.7.117:/usr/local/ldNAS/share1/mnt/nfs1" to/etc/rc. local to enable automatic mounting upon startup.


Others:
Showmount-e 100.0.7.117 view the export status

Ps: the default parameters are used during the mkfs and mount processes. However, the performance is acceptable based on the test results.

The performance of the NAS system will be analyzed and optimized based on the business characteristics in the future.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.