Centos5上部署udev
首先来简要的介绍下什么是udev,udev是Linux kernel 2.6系列的通用内核设备管理器,以守护进程的方式运行于Linux系统,并监听在新设备初始化或设备从系统中移除时,内核(通过netlink socket)所发出的uevent;简单点讲就是当有多块磁盘的时候,可以用udev来固定磁盘对应的设备名;之前在部署11g rac的时候都偏好使用asmlib,在最近一次的部署中asmlib出现了问题,而又没有时间去排错,因而采用udev部署,故而简单记录下udev的配置过程!
一:模拟共享盘阵,这里采用先划分lvm,再通过iscsi共享的方式来模拟
- [root@db1 ~]# pvcreate /dev/sdb
- Physical volume "/dev/sdb" successfully created
- [root@db1 ~]# vgcreate data /dev/sdb
- /dev/hdc: open failed: Read-only file system
- /dev/cdrom: open failed: Read-only file system
- Attempt to close device '/dev/cdrom' which is not open.
- Volume group "data" successfully created
- [root@db1 ~]# lvcreate -n crs1 -L 2G data
- Logical volume "crs1" created
- [root@db1 ~]# lvcreate -n crs2 -L 2G data
- Logical volume "crs2" created
- [root@db1 ~]# lvcreate -n crs3 -L 2G data
- Logical volume "crs3" created
- [root@db1 ~]# lvcreate -n data -L 10G data
- Logical volume "data" created
- [root@db1 ~]# lvcreate -n fra -L 10G data
- Logical volume "fra" created
- [root@db1 ~]# lvs
- LV VG Attr LSize Origin Snap% Move Log Copy% Convert
- crs1 data -wi-a- 2.00G
- crs2 data -wi-a- 2.00G
- crs3 data -wi-a- 2.00G
- data data -wi-a- 10.00G
- fra data -wi-a- 10.00G
- [root@db1 ~]# service tgtd start
- Starting SCSI target daemon: [ OK ]
- [root@db1 ~]# cat iscsi.sh
- tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.2012-07-04.com.yang.rac:crs1
- tgtadm --lld iscsi --op new --mode target --tid 2 -T iqn.2012-07-04.com.yang.rac:crs2
- tgtadm --lld iscsi --op new --mode target --tid 3 -T iqn.2012-07-04.com.yang.rac:crs3
- tgtadm --lld iscsi --op new --mode target --tid 4 -T iqn.2012-07-04.com.yang.rac:data
- tgtadm --lld iscsi --op new --mode target --tid 5 -T iqn.2012-07-04.com.yang.rac:fra
- tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/data/crs1
- tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 2 -b /dev/data/crs2
- tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 3 -b /dev/data/crs3
- tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 4 -b /dev/data/data
- tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 5 -b /dev/data/fra
- tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
- tgtadm --lld iscsi --op bind --mode target --tid 2 -I ALL
- tgtadm --lld iscsi --op bind --mode target --tid 3 -I ALL
- tgtadm --lld iscsi --op bind --mode target --tid 4 -I ALL
- tgtadm --lld iscsi --op bind --mode target --tid 5 -I ALL
- [root@db1 ~]# tgtadm --lld iscsi -o show -m target
- [root@db1 ~]# sh iscsi.sh
- [root@db1 ~]# tgtadm --lld iscsi -o show -m target
- Target 1: iqn.2012-07-04.com.yang.rac:crs1
- System information:
- Driver: iscsi
- State: ready
- I_T nexus information:
- LUN information:
- LUN: 0
- Type: controller
- SCSI ID: deadbeaf1:0
- SCSI SN: beaf10
- Size: 0 MB
- Online: Yes
- Removable media: No
- Backing store: No backing store
- LUN: 1
- Type: disk
- SCSI ID: deadbeaf1:1
- SCSI SN: beaf11
- Size: 2147 MB
- Online: Yes
- Removable media: No
- Backing store: /dev/data/crs1
- LUN: 2
- Type: disk
- SCSI ID: deadbeaf1:2
- SCSI SN: beaf12
- Size: 2147 MB
- Online: Yes
- Removable media: No
- Backing store: /dev/data/crs2
- LUN: 3
- Type: disk
- SCSI ID: deadbeaf1:3
- SCSI SN: beaf13
- Size: 2147 MB
- Online: Yes
- Removable media: No
- Backing store: /dev/data/crs3
- LUN: 4
- Type: disk
- SCSI ID: deadbeaf1:4
- SCSI SN: beaf14
- Size: 10737 MB
- Online: Yes
- Removable media: No
- Backing store: /dev/data/data
- LUN: 5
- Type: disk
- SCSI ID: deadbeaf1:5
- SCSI SN: beaf15
- Size: 10737 MB
- Online: Yes
- Removable media: No
- Backing store: /dev/data/fra
- Account information:
- ACL information:
- ALL
- Target 2: iqn.2012-07-04.com.yang.rac:crs2
- System information:
- Driver: iscsi
- State: ready
- I_T nexus information:
- LUN information:
- LUN: 0
- Type: controller
- SCSI ID: deadbeaf2:0
- SCSI SN: beaf20
- Size: 0 MB
- Online: Yes
- Removable media: No
- Backing store: No backing store
- Account information:
- ACL information:
- Target 3: iqn.2012-07-04.com.yang.rac:crs3
- System information:
- Driver: iscsi
- State: ready
- I_T nexus information:
- LUN information:
- LUN: 0
- Type: controller
- SCSI ID: deadbeaf3:0
- SCSI SN: beaf30
- Size: 0 MB
- Online: Yes
- Removable media: No
- Backing store: No backing store
- Account information:
- ACL information:
- Target 4: iqn.2012-07-04.com.yang.rac:data
- System information:
- Driver: iscsi
- State: ready
- I_T nexus information:
- LUN information:
- LUN: 0
- Type: controller
- SCSI ID: deadbeaf4:0
- SCSI SN: beaf40
- Size: 0 MB
- Online: Yes
- Removable media: No
- Backing store: No backing store
- Account information:
- ACL information:
- Target 5: iqn.2012-07-04.com.yang.rac:fra
- System information:
- Driver: iscsi
- State: ready
- I_T nexus information:
- LUN information:
- LUN: 0
- Type: controller
- SCSI ID: deadbeaf5:0
- SCSI SN: beaf50
- Size: 0 MB
- Online: Yes
- Removable media: No
- Backing store: No backing store
- Account information:
- ACL information:
二:在客户端上挂载前面模拟出的共享磁盘阵列
- [root@db2 ~]# iscsiadm --mode discovery --type sendtargets --portal 192.168.123.10
- 192.168.123.10:3260,1 iqn.2012-07-04.com.yang.rac:fra
- 192.168.123.10:3260,1 iqn.2012-07-04.com.yang.rac:crs1
- 192.168.123.10:3260,1 iqn.2012-07-04.com.yang.rac:crs3
- 192.168.123.10:3260,1 iqn.2012-07-04.com.yang.rac:data
- 192.168.123.10:3260,1 iqn.2012-07-04.com.yang.rac:crs2
- [root@db2 ~]# iscsiadm --mode node --targetname iqn.2012-07-04.com.yang.rac:crs1 --portal 192.168.123.10 --login
- [root@db2 ~]# iscsiadm --mode node --targetname iqn.2012-07-04.com.yang.rac:crs2 --portal 192.168.123.10 --login
- [root@db2 ~]# iscsiadm --mode node --targetname iqn.2012-07-04.com.yang.rac:crs3 --portal 192.168.123.10 --login
- [root@db2 ~]# iscsiadm --mode node --targetname iqn.2012-07-04.com.yang.rac:data --portal 192.168.123.10 --login
- [root@db2 ~]# iscsiadm --mode node --targetname iqn.2012-07-04.com.yang.rac:fra --portal 192.168.123.10 --login
- [root@db2 ~]# fdisk -l
- Disk /dev/sda: 85.8 GB, 85899345920 bytes
- 255 heads, 63 sectors/track, 10443 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Device Boot Start End Blocks Id System
- /dev/sda1 * 1 13 104391 83 Linux
- /dev/sda2 14 523 4096575 82 Linux swap / Solaris
- /dev/sda3 524 10443 79682400 83 Linux
- Disk /dev/sdb: 2147 MB, 2147483648 bytes
- 67 heads, 62 sectors/track, 1009 cylinders
- Units = cylinders of 4154 * 512 = 2126848 bytes
- Disk /dev/sdb doesn't contain a valid partition table
- Disk /dev/sdc: 2147 MB, 2147483648 bytes
- 67 heads, 62 sectors/track, 1009 cylinders
- Units = cylinders of 4154 * 512 = 2126848 bytes
- Disk /dev/sdc doesn't contain a valid partition table
- Disk /dev/sdd: 2147 MB, 2147483648 bytes
- 67 heads, 62 sectors/track, 1009 cylinders
- Units = cylinders of 4154 * 512 = 2126848 bytes
- Disk /dev/sdd doesn't contain a valid partition table
- Disk /dev/sde: 10.7 GB, 10737418240 bytes
- 64 heads, 32 sectors/track, 10240 cylinders
- Units = cylinders of 2048 * 512 = 1048576 bytes
- Disk /dev/sde doesn't contain a valid partition table
- Disk /dev/sdf: 10.7 GB, 10737418240 bytes
- 64 heads, 32 sectors/track, 10240 cylinders
- Units = cylinders of 2048 * 512 = 1048576 bytes
- Disk /dev/sdf doesn't contain a valid partition table
三:开始配置udev
- [root@db2 ~]# uname -r //在本例中操作系统的版本位centos5.4 64bit
- 2.6.18-164.el5
- [root@db2 ~]# lsb_release -a
- LSB Version: :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
- Distributor ID: CentOS
- Description: CentOS release 5.4 (Final)
- Release: 5.4
- Codename: Final
- [root@db2 ~]# rpm -qa |grep udev
- udev-095-14.21.el5
- [root@db2 ~]# ps -ef |grep udev
- root 4646 1 0 10:14 ? 00:00:00 /sbin/udevd -d
- root 6023 3039 0 10:32 pts/0 00:00:00 grep udev
- [root@db2 ~]# grep -v ^# /etc/udev/udev.conf |grep -v ^$
- udev_log="err"
- [root@db2 ~]# scsi_id -g -u -s /block/sdb
- S_beaf11
- [root@db2 ~]# scsi_id -g -u -s /block/sdc
- S_beaf12
- [root@db2 ~]# scsi_id -g -u -s /block/sdd
- S_beaf13
- [root@db2 ~]# scsi_id -g -u -s /block/sde
- S_beaf14
- [root@db2 ~]# scsi_id -g -u -s /block/sdf
- S_beaf15
- [root@db2 ~]# cat /etc/udev/rules.d/99-raw.rules
- KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="S_beaf11", NAME="asmdisk1", OWNER="grid",
- GROUP="asmadmin", MODE="0660"
- KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="S_beaf12", NAME="asmdisk2", OWNER="grid",
- GROUP="asmadmin", MODE="0660"
- KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="S_beaf13", NAME="asmdisk3", OWNER="grid",
- GROUP="asmadmin", MODE="0660"
- KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="S_beaf14", NAME="asmdisk4", OWNER="grid",
- GROUP="asmadmin", MODE="0660"
- KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="S_beaf15", NAME="asmdisk5", OWNER="grid",
- GROUP="asmadmin", MODE="0660"
- [root@db2 ~]# ll /dev/asm*
- ls: /dev/asm*: No such file or directory
- [root@db2 ~]# /sbin/udevcontrol reload_rules
- [root@db2 ~]# /sbin/start_udev
- Starting udev: [ OK ]
- [root@db2 ~]# ll /dev/asm*
- brw-rw---- 1 grid asmadmin 8, 16 Jul 4 12:05 /dev/asmdisk1
- brw-rw---- 1 grid asmadmin 8, 32 Jul 4 12:05 /dev/asmdisk2
- brw-rw---- 1 grid asmadmin 8, 48 Jul 4 12:05 /dev/asmdisk3
- brw-rw---- 1 grid asmadmin 8, 64 Jul 4 12:05 /dev/asmdisk4
- brw-rw---- 1 grid asmadmin 8, 80 Jul 4 12:05 /dev/asmdisk5
备注:
1:在vmware中,scsi_id -g -u -s /block/sdb默认是不会出现uuid,需要修改vmx文件,添加disk.EnableUUID参数
2:/block/sdb实际上是个不存在的路径,实际绝对路径是/sys/block/sdb,但使用scsi_id命令的时候必须用/block/sdb路径
参考:
http://diznix.com/2011/05/21/the-case-of-vmware-and-the-missing-scsi-id/
http://space.itpub.net/14184018/viewspace-701675
Centos5上部署udev相关推荐
- 云上部署oracle rac,在青云上部署oracle rac全过程
在青云上部署oracle rac全过程 发布时间:2020-08-17 03:16:10 来源:ITPUB博客 阅读:116 作者:datapeng 一 准备 1.1服务器基本信息 节点 Cpu 内存 ...
- 在树莓派3B+上部署Intel NCS2神经网络计算棒
2018.12.20日 英特尔更新了OpenVINO Toolkit R5版本.该版本添加了对树莓派的支持.作为NCS2的官方开发套件,OpenVINO在此之前只能在台式机ubuntu 16.04上使 ...
- 在 Linux 服务器上部署 oracle10gr2 数据库全过程
在 Linux 服务器上部署 oracle10gr2 数据库全过程 最近在 Linux 系统上进行 oracle 服务器的部署,对于作者这种 Linux 菜鸟来说着实不容易,很是废了一番功夫.但最后还 ...
- 在Cuda上部署量化模型
在Cuda上部署量化模型 介绍TVM自动量化.自动量化是TVM中的一种量化方式.将在ImageNet上导入一个GluonCV预先训练的模型到Relay,量化Relay模型,然后执行推理. import ...
- 用TVM在硬件平台上部署深度学习工作负载的端到端 IR 堆栈
用TVM在硬件平台上部署深度学习工作负载的端到端 IR 堆栈 深度学习已变得无处不在,不可或缺.这场革命的一部分是由可扩展的深度学习系统推动的,如滕索弗洛.MXNet.咖啡和皮托奇.大多数现有系统针对 ...
- 在Server 2003上部署IIS+PHP+MySQL配置清单
在Server 2003上部署IIS+PHP+MySQL I.安装Windows Server 2003 将光盘放入光驱中,设置BIOS,从CDROM引导加载安装程序,等待启动: 设置注册信息,名字和 ...
- Centos5上firefox的升级
Centos5上firefox的升级 默认Centos5上firefox的版本是1.5 当我们使用yum update firefox 提示到的版本还是1.5 可是我们在使用1.5版本的firefo ...
- aws fargate_我如何在AWS Fargate上部署#100DaysOfCloud Twitter Bot
aws fargate After passing my last certification, I asked myself how much time I spent studying cloud ...
- SAGEMAKER上部署需要引入sagemakder的API from sagemaker.pytorch import PyTorchModel
SAGEMAKER上部署需要引入sagemakder的API from sagemaker.pytorch import PyTorch from sagemaker.pytorch import P ...
最新文章
- CSS清除浮动大全共8种方法
- 【Python3爬虫】最新的12306爬虫
- Android socket 编程 实现消息推送(二)
- Vijos P1067Warcraft III 守望者的烦恼
- python压缩映射过滤器
- python创建数据库计算机积极拒绝、无法连接_Python3 请求网页源码 目标计算机积极拒绝,无法连接...
- 这是今年前端最常见的面试题,你都会了吗?
- 单片机 | Keli 调试程序
- 软件质量保证管理办法
- 泛微oa服务器文件,泛微oa云服务器要求
- 华为手机 图标消失_华为手机桌面图标不见了怎么办
- 【Spring Security】spring security 之初探jwt
- 下载微信支付sdk的两个方法
- 【css技巧】CSS filter的神奇用法 | 褪色|融合效果等
- 第三批更新鸿蒙系统,emui11第三批更新名单-emui11第三批更新名单介绍 - 系统家园...
- 留着以后慢慢做的计算几何(题表)
- Smartbi自定义生成报表-制作流程
- 埃斯顿机器人 王杰高_王杰高 埃斯顿机器人公司总经理--金手指奖•2018年中国国际机器人年度评选——风云人物奖申报-弗戈工业在线...
- 解决outlook 一直卡在加载配置文件界面的解决方法
- Html(快捷键!+Tab)
热门文章
- Linux-Windows-Mac-Redis安装教程
- Spring Boot开发
- raid5加热备盘_联想服务器X3650 M2 配置RAID5与热备盘图文方法
- graphics | 基础绘图系统(八)——棘状图、符号图、多边形(路径)图、Cohen-Friendly关联图、条件密度图...
- 干货丨常用JS前端开发框架有哪些?
- javascript 校验 非空_前端(js+JQuery非空校验)
- Oracle修改globalname,oracle修改global_name和service_name
- python中delete怎么用_python删除np.deletePython基础教程05 - 缩进和选择
- session很快失效_深夜,我偷听到程序员要对session下手……
- css居中最佳方案,CSS 水平、垂直居中的5种最佳方案