Centos6.4和Centos5.8混合实例(五)

Centos6.4和Centos5.8混合实例:


服务器系统


角色


IP


CentOS-64-121-server1


NFS服务器端


192.168.1.121


CentOS-5.8-119-client


NFS客户端


192.168.1.119

共享CentOS-64-121-server1中/data/bbs目录,使192.168.1.1 IP段所有主机都可以访问

Centos6.4配置服务端:

首先创建实验环境目录

[[email protected] ~]# mkdir /data/bbs –p
[[email protected] bbs]# chown -Rnfsnobody.nfsnobody /data/bbs
[[email protected] bbs]# ls -ld /data/bbs
drwxr-xr-x. 2 nfsnobody nfsnobody 4096 Jan19 17:08 /data/bbs
  • 检查服务器系统信息
[[email protected] ~]# cat /etc/redhat-release
CentOS release 6.4 (Final)
[[email protected] ~]# uname -n
64server1
[[email protected] ~]# uname -r
2.6.32-358.el6.x86_64
[[email protected] ~]# uname -m
x86_64
[[email protected] ~]# uname -a
Linux 64server1 2.6.32-358.el6.x86_64 #1SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[[email protected] ~]#
 
 [[email protected] ~]# ifconfig
eth0     Link encap:Ethernet  HWaddr00:0C:29:03:A5:40 
         inet addr:192.168.1.121  Bcast:192.168.1.255  Mask:255.255.255.0
         inet6 addr: fe80::20c:29ff:fe03:a540/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST MTU:1500  Metric:1
         RX packets:163 errors:0 dropped:0 overruns:0 frame:0
         TX packets:126 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:14926 (14.5 KiB)  TXbytes:13877 (13.5 KiB)
 
lo       Link encap:Local Loopback 
         inet addr:127.0.0.1 Mask:255.0.0.0
         inet6 addr: ::1/128 Scope:Host
         UP LOOPBACK RUNNING MTU:16436  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0
         RX bytes:0 (0.0 b)  TX bytes:0 (0.0b)

分别查看服务端的相关信息,如ip,主机名等等

  • 检查NFS软件
[[email protected] ~]# rpm -aq|egrep"nfs-utils|rpcbind"
nfs-utils-1.2.3-36.el6.x86_64
nfs-utils-lib-1.1.5-6.el6.x86_64
rpcbind-0.2.0-11.el6.x86_64
  • 查看服务器的centos中5.8 portmap、6.4 rpcbind服务有没有启动和检查nfs、启动nfs
[[email protected] ~]# /etc/init.d/rpcbindstatus      
rpcbind (pid  1100) is running...
[[email protected] ~]# /etc/init.d/nfs status
rpc.svcgssd is stopped
rpc.mountd is stopped
nfsd is stopped
rpc.rquotad is stopped
[[email protected] ~]# /etc/init.d/nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Stopping RPC idmapd:                                       [  OK  ]
Starting RPC idmapd:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
[[email protected] ~]# /etc/init.d/nfsstatus   
rpc.svcgssd is stopped
rpc.mountd (pid 1606) is running...
nfsd (pid 1671 1670 1669 1668 1667 16661665 1664) is running...
rpc.rquotad (pid 1602) is running...
  • 配置NFS及portmap(Centos6.4下为rpcbind)服务开机自启动
[[email protected] ~]# echo "#NFS6.4Server start at dingjian to2014.01.19">>/etc/rc.local
[[email protected] ~]# echo "/etc/init.d/rpcbindstart" >>/etc/rc.local
[[email protected] ~]# echo"/etc/init.d/nfs start" >>/etc/rc.local      
[[email protected] ~]# tail -3 /etc/rc.local
#NFS6.4 Server start at dingjianto2014.01.19
/etc/init.d/rpcbind start
/etc/init.d/nfs start
  • 配置NFS服务
[[email protected] ~]# echo "#NFS shared/data/bbs 2014.01.19">>/etc/exports
[[email protected] ~]# echo "/data/bbs/192.168.1.1/24(rw,sync)">>/etc/exports
[[email protected] ~]# tail -2 /etc/exports
#NFS shared /data/bbs 2014.01.19
/data/bbs/ 192.168.1.1/24(rw,sync)

六、/etc/init.d/nfs reload 或exportfs -rv进行nfs重新加载

七、showmount -e localhost   show一下自己,看服务端有没有配置好

[[email protected] bbs]# showmount -elocalhost
Export list for localhost:
/data/bbs 192.168.1.1/24

Centos5.8配置客户端

  1. 检查系统环境
[[email protected] ~]# cat /etc/redhat-release
CentOS release 5.8 (Final)
[[email protected] ~]# uname -n
58client
[[email protected] ~]# uname -r
2.6.18-308.el5
[[email protected] ~]# uname -a
Linux 58client 2.6.18-308.el5 #1 SMP TueFeb 21 20:06:06 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
[[email protected] ~]# uname -m
x86_64

2.检查和启动portmap(6.4rpcbind)服务(注意无需启动NFS服务)

[[email protected] ~]# rpm -aq|grep portmap
portmap-4.0-65.2.2.1
[[email protected] ~]# /etc/init.d/portmapstatus
portmap is stopped
[[email protected] ~]# /etc/init.d/portmapstart
Starting portmap:                                         [  OK  ]
[[email protected] ~]# /etc/init.d/portmapstatus
portmap (pid 22949) is running...

3.把portmap加入开机自启动

[[email protected] ~]# echo "#NFS Clientstart at dingjian to 2014.01.19">>/etc/rc.local
[[email protected] ~]# echo"/etc/init.d/portmap start">>/etc/rc.local
[[email protected] ~]# tail -2 /etc/rc.local
#NFS Client start at dingjian to 2014.01.19
/etc/init.d/portmap start

4扫描NFS服务器的文件共享例表

[[email protected] ~]# showmount -e 192.168.1.121
Export list for 192.168.1.121:
/data/bbs 192.168.1.1/24

5.挂载NFS服务器共享目录到本地系统

[[email protected] ~]# mount -t nfs192.168.1.121:/data/bbs /mnt
[[email protected] ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3             17981340   2124724 14928464  13% /
/dev/sda1               295561     16842   263459   7% /boot
tmpfs                    60136         0    60136   0% /dev/shm
192.168.1.121:/data/bbs
                      18375552   1526656 15915456   9% /mnt

6.配置开机自动挂载NFS共享目录

[[email protected] ~]# echo "mount -t nfs192.168.1.121/data/bbs /mnt" >>/etc/rc.local
[[email protected] ~]# tail -1  /etc/rc.local
mount -t nfs 192.168.1.121/data/bbs /mnt

7.测试数据

[[email protected] ~]# cd /data/bbs
[[email protected] bbs]# touch aa
 
[[email protected] ~]# ls /mnt
aa

提示:  1.配置NFS服务端后,不用重启NFS服务,只要使用exportfs -rv或/etc/init.d/nfs reload重新加载就可以了

2.rpc主程序Centos5.8下为portmap 、Centos6.4下为rpcbind

3.NFS共享目录不要授权于777权限,可以改所属主和组为nfsnobody,因为nfsnobody权限不是很大,也不能登陆

时间: 2024-08-01 17:13:52

Centos6.4和Centos5.8混合实例(五)的相关文章

android4.0 USB Camera实例(五补充)jpg压缩

前一篇最后 我们说了一个直接将yuv转成jpg的函数 但是转换没有成功 原函数是yuv420转jpg的 研究了下发现 yuv420隔行扫描的的序列是这样的 YYYY YYYY UVUV 而yuv422的隔行扫描的序列是这样的 YU YV YU YV YU YV 所以将函数作如下修改 static int put_jpeg_yuv420p_memory(unsigned char *dest_image, unsigned char *input_image, int width, int hei

C语言库函数大全及应用实例五

原文:C语言库函数大全及应用实例五                                                 [编程资料]C语言库函数大全及应用实例五 函数名: getcurdir 功 能: 取指定驱动器的当前目录 用 法: int getcurdir(int drive, char *direc); 程序例: #i nclude #i nclude #i nclude char *current_directory(char *path) { strcpy(path, "

android4.0 USB Camera实例(五)jpg压缩

最近大部分时间都在研究usb 摄像头顺便把jpg编码也写上 下面大部分函数都是我在网上找的 然后稍微的改一点就可以使用了 不过找这些函数费了不少时间 jpg编码网上有很多说明 大致流程都是一样的 我也没深入研究这里就不说了 接前面几篇Camera的文章 这里主要同把获取到的yuv数据通过jpg压缩 以及压缩成mjpeg视频流 首先说明下摄像头获取到的数据格式是yuv422(p16) 这个是在你初始化摄像头设置pixelformat我们当初设置的是V4L2_PIX_FMT_YUYV它的实际格式就是

centos6.5 安装mysql5.6多实例(多配置文件)

********************************************************************* 安装说明: 使用镜像:     CentOS-6.5-x86_64-minimal.iso 系统 :        CentOS release 6.5 (Final)  2.6.32-431.el6.x86_64 mysql 安装目录 /usr/lcoal/mysql msyql data目录 /usr/local/mysql/data/3306 /usr

centos6.5 安装mysql5.6单实例和多实例(单配置文件)

安装mysql 创建mysql用户 useradd mysql              //已经有的不需要创建 卸载原来的mysql  rpm包 rpm -qa|grep mysql  //查询是否有相关包 yum -y remove *mysql*  //我这里用yum卸载的 关闭防火墙,关闭selinux service iptables stop    //个人习惯性关闭防火墙 sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/se

Windows Server 2016 + Exchange 2016 +Office365混合部署(五)

我们前面的文章都介绍了混合部署前的基本配置,有了前面环境的基础配置后,我们就可以开始真正的配置混合配置了: 我们首先需要在Azure Active Directory Connect工具下修改同步配置: 所以我们需要在Azure Active Directory Connect服务器上运行Azure Active Directory Connect工具向导: 我们单击配置即可 开始验证Office365配置 组织筛选,默认即可:可根据自己的需求进行修改 我们需要勾选Exchange混合部署 确认

centos6.4下yum报错实例

说明:以下所有操作均是由超级管理员完成 我一个朋友遇到这个问题,就是利用yum安装的时候报错.如图: 当时他问我的时候,我一开始以为是Python版本不兼容问题,可能是Python升级后带来的问题,所以就给他说了两种方法 1.修改yum配置文件: vim /usr/bin/yum 修改第一行 #!/usr/bin/python 改为#!/usr/bin/python2.6.6 2.升级yum 然后我朋友让我远程帮他,当我远程帮他修改这一行之后,又出现了新的问题.(此处没有截图) 找不到Pytho

PHP 继承,组合,单模式,GUID,等混合实例

<?php header("Content-type: text/html; charset=utf-8"); header('Access-Control-Allow-Origin:*'); $BiaDuak = '************';//定义变量 使用时 echo $BiaDuak; define("accessKeyId","************");//定义常量 使用时 echo accessKeyId; define(

实例五租房子

前台 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Conte