nfs文件共享+netstat相关 记录
2014-04-10 14:13
316 查看
经常要创建nfs文件共享,每次都要重新找一下笔记,特记录下来方便查找:
一般linux自带有nfs应用,所以要使用时,只要启用即可,启动过程如下:
服务端:
在/etc/exports 里面加入要nfs的目录,开放可mount的对象IP,例如:
/data/test 192.168.*(rw,sync,no_root_squash)
然后启动相关进程:
service nfs start
service portmap start
客户端:
service portmap start
mount -t nfs 192.168.101.234:/data/test /data/test (mount命令)
查看已经发布出来的nfs可挂接点:
服务端:showmount -e localhost
客户端:showmount -e 服务端IP
参考页面:
http://linux.chinaunix.net/techdoc/system/2007/03/26/953339.shtml
--------------------------------------------------------------------
netstat 的一些使用方法,记录一下,不完全之处后面碰到再补充:
1、使用 netstat -nlt 查看端口使用情况
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN
2、使用 netstat -nltp 查看端口使用情况,并反应出端口使用的程序名称和进程号
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 2485/zabbix_agentd
tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN 2535/mongod
3、如果要查具体某个程序或者端口的情况,在后面加 grep 即可:
root@test03:/root#netstat -nltp|grep mysql
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 6509/mysqld
root@test03:/root#netstat -nltp|grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 6509/mysqld
4、查看端口属于哪个程序
root@test03:/root#lsof -i:3306
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
mysqld 6509 mysql 10u IPv4 15134 TCP *:mysql (LISTEN)
一般linux自带有nfs应用,所以要使用时,只要启用即可,启动过程如下:
服务端:
在/etc/exports 里面加入要nfs的目录,开放可mount的对象IP,例如:
/data/test 192.168.*(rw,sync,no_root_squash)
然后启动相关进程:
service nfs start
service portmap start
客户端:
service portmap start
mount -t nfs 192.168.101.234:/data/test /data/test (mount命令)
查看已经发布出来的nfs可挂接点:
服务端:showmount -e localhost
客户端:showmount -e 服务端IP
参考页面:
http://linux.chinaunix.net/techdoc/system/2007/03/26/953339.shtml
--------------------------------------------------------------------
netstat 的一些使用方法,记录一下,不完全之处后面碰到再补充:
1、使用 netstat -nlt 查看端口使用情况
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN
2、使用 netstat -nltp 查看端口使用情况,并反应出端口使用的程序名称和进程号
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 2485/zabbix_agentd
tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN 2535/mongod
3、如果要查具体某个程序或者端口的情况,在后面加 grep 即可:
root@test03:/root#netstat -nltp|grep mysql
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 6509/mysqld
root@test03:/root#netstat -nltp|grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 6509/mysqld
4、查看端口属于哪个程序
root@test03:/root#lsof -i:3306
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
mysqld 6509 mysql 10u IPv4 15134 TCP *:mysql (LISTEN)
相关文章推荐
- android activity之间跳转 setResult 和 StartActivityForResult
- 进程控制块PCB结构 task_struct 描述
- Ios 开发实用工具(持续更新)
- iOS-Bug: NSRunloop Mode
- 国内目前最全面的介绍——Android中的BroadCastReceiver
- Enterprise Manager 无法连接到数据库实例
- hdu 1010 Tempter of the Bone_奇偶剪枝+dfs
- JAVA笔记8-对象转型casting
- object-c 协议(Protocols)和代理(Delegation)的学习
- hadoop学习路线图【hadoop最短学习路线】
- C++中 _declspec(novtable) 的探讨
- Linux网络编程--初等网络函数介绍(TCP)
- 人在做,天在看!人生不可破的28条天规
- jQuery.extend 函数详解
- Ubuntu上安装MySQL数据库
- Linux命令:grep,报错Binary file (standard input) matches
- [Leetcode] Container With Most Water
- NYOJ--蚂蚁感冒(第五届蓝桥杯)
- 计算日期相差的天数
- 23种设计模式(14):解释器模式