20 2010

Centos5 连接IP-SAN

Posted by admin in 日记

首先需要确认机器上是否有:

iscsi-initiator-utils-6.2.0.871-0.12.el5_4.1

 

2:
iscsiadm –mode discovery –type sendtargets –portal 10.10.1.10 (端口默认为3260)

iscsi会自动去与 存储端沟通。在存储端,需要将相应的 LUN映射到该机器上面。

3.

iscsiadm –mode node –targetname targetname –portal 10.10.1.10 –login

也可以  /etc/init.d/iscsi restart  重启服务。

[root@localhost ~]# /etc/init.d/iscsi restart
Logging out of session [sid: 1, target: iqn.2006-08.com.huawei:oceanstor:21000022a101beea::10.10.1.10, portal: 10.10.1.10,3260]
Logout of [sid: 1, target: iqn.2006-08.com.huawei:oceanstor:21000022a101beea::10.10.1.10, portal: 10.10.1.10,3260]: successful
Stopping iSCSI daemon:
iscsid dead but pid file exists
[  OK  ]off network shutdown. Starting iSCSI daemon: [  OK  ]
[  OK  ]
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2006-08.com.huawei:oceanstor:21000022a101beea::10.10.1.10, portal: 10.10.1.10,3260]
Login to [iface: default, target: iqn.2006-08.com.huawei:oceanstor:21000022a101beea::10.10.1.10, portal: 10.10.1.10,3260]: successful
[  OK  ]
[root@localhost ~]# 

 

 

4.然后就是分区了。

 

 

 

 

 

 

 

 

 

 

 

 

 

以下为备用资料

——————————–

 

 

 

1.1 连接ISCSI

操作系统:麒麟linux(2.6.18-1.std)

Iscsi包: iscsi-initiator-utils-6.2.0.742-0.5.el5.i386.rpm(Open-iSCS提供http://www.open-iscsi.org/)

注意:以下操作仅针对以上版本内核和iscsi包

并且仅保证可用,不保证最优。

www.ixdba.net

1.1.1 安装rpm包

将iscsi包cp到本地盘,并在该包所在的目录下运行命令

[root@linux ~]# rpm –ivh iscsi-initiator-utils-6.2.0.742-0.5.el5.i386.rpm

运行此命令后,会生成一个目录/etc/iscsi,该目录下有两个文件:

Initiatorname.iscsi和iscsid.conf

1.1.2 启动ISCSI服务

安装完iscsi服务默认是关闭的,需要手工启动

[root@linux ~]# cd /etc/init.d

[root@linux ~]# ./iscsi start

1.1.3 搜寻盘阵

运行以下命令搜寻target,即目标端:7612i存储

[root@linux ~]#iscsiadm –mode discovery –type sendtargets –portal 192.168.1.221

以上IP即是7612i的iscsi口的IP,其它固定。

1.1.4 显示盘阵

显示存储端target name

[root@linux ~]# iscsiadm –mode node

显示结果与在7612i串口 iscsi management→iscsi node名字相同

1.1.5 登陆盘阵

target登陆

[root@linux ~]#iscsiadm –mode node –targetname targetname –portal 192.168.1.221:3260 –login

其中targetname即是步骤4中结果。(注:横杆是中杠)

(注:3,4,5实施中是在/etc/iscsi下运行,是否可以在别的路径执行,可自行测试。以上3个命令格式是从man iscsiadm查出)

1.1.6 设置自动启动盘阵服务

经过以上几步,fdisk –l就可以看到所挂接分区了,为确保重启后也能看到,再修改一下/etc/iscsi/iscsid.conf,将第5步的命令iscsiadm –mode node –targetname targetname –portal 192.168.1.221:3260 –login

[root@linux ~]# vi /etc/iscsi/iscsid.conf

iscsiadm –mode node –targetname targetname –portal 192.168.1.221:3260 –login

添加到该文件中的开始部分

*****************

# Startup settings

#***************** 这个栏下面即可。

其实这个文件大多数内容处于被注释状态,该命令添加位置应该影响不大.然后重启电脑后直接fdisk –l 依然可以看到所挂接的分区。至此iscsi所有操作完成,但挂载的分区不是linux所识别,必须使用FDISK进行磁盘分区。

1.2 设置分区

1.2.1 使用fdisk命令进行磁盘分区

fdisk是各种Linux发行版本中最常用的分区工具,是被定义为Expert级别的分区工具。我们可以通过fdisk来分区使用iscsi设备。它还包括一个二级选单,首先输入命令,然后出现问答式界面,用户通过在这个界面中输入命令参数来操作fdisk。

# fdisk /dev/hdb

运行后出现fdiak的命令提示符:

Command (m for help):

使用n命令创建一个分区,会出现选择主分区(p primary partition)还是扩展分区(l logical)的提示,通常选用主分区。然后按照提示输入分区号(Partion number(1-4):)、新分区起始的磁盘块数(First Cylinder)和分区的大小,可以是以MB为单位的数字(Last cylindet or +siza or +sizeM or +sizeK:)。例如:

[root@linux ~]#fdisk /dev/sdb

查看分区,如果是第一次操作时,显示为无。

Command (m for help):p

Disk /dev/sdb:255 heads, 63 sectors, 4427 cylinders

Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System

建立分区

Command (m for help):n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-4427, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-4427, default 4427):

Using default value 4427

保存分区信息

Command (m for help)w

The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING:If you have created or modified any DOS 6.x

partitions, please see the fdisk manual page for additional

information.

Syncing disks.

1.2.2 现在验证新分区:

[root@linux ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 4427.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help):p

Disk /dev/sdb:255 heads, 63 sectors, 4427 cylinders

Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System

/dev/sdb1 1 4427 35559846 83 Linux

Command (m for help):q

1.2.3 格式化分区

[root@localhost ~]# mkfs -t ext3 /dev/sdb1

mke2fs 1.39 (29-May-2006)

Filesystem label=OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

214761472 inodes, 429495759 blocks

21474787 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=0

13108 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,

102400000, 214990848

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 31 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.

1.2.4 设定加载点:

文件系统必须有一个挂载点,它只是一个空的目录,新文件系统在这里与系统目录树“相连”。经过以上的操作,我的 Linux服务器已经连接到 iSCSI 储存设备, 并且如同Linux 本机上面的一个 SCSI 硬盘一样。 使用的方式几乎一模一样。

假设iSCSI 主机挂载到 /cluster/raid 目录下:

[root@linux ~]# mkdir /cluster/raid

[root@linux ~]# mount /dev/sda1 /cluster/raid

[root@linux ~]# df

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/hda1 10080488 2950408 6618012 31% /

tmpfs 5036316 81172 4699312 0% /dev/shm

/dev/sda1 1914788196 27040372 1790482212 2% /cluster/raid

1.2.5 设定自动挂载:

在机器重新启动后自动加载分区,你必须在/etc/fstab中加入相应分区,但分区类型必须市”_netdev”.例如加载的分区sdb1:

[root@linux ~]# vi /etc/fstab

/dev/sdb1 /cluster/raid ext3 ­_netdev 0 0

/dev/sdc1 /data/sdc1 ext3 _netdev 0 0

/dev/sdd1 /data/sdd1 ext3 _netdev 0 0

1.2.6 查看挂载分区:

[root@localhost ~]# df -h

文件系统 容量 已用 可用 已用% 挂载点

/dev/sda1 64G 5.6G 55G 10% /

tmpfs 1.7G 0 1.7G 0% /dev/shm

/dev/sdb1 1.6T 197M 1.5T 1% /data/sdb1

/dev/sdc1 1.6T 197M 1.5T 1% /data/sdc1

收藏与分享
19 2010

Centos yum Source (163.com)

Posted by admin in 日记

[main]
cachedir=/var/cache/yum
keepcache=1
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
metadata_expire=1800
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[base]
name=centos-5 – Base
baseurl=http://mirrors.163.com/centos/5/os/i386/
# the other site: http://centos.candishosting.com.cn/centos/5/os/i386/
# you can find more site in: http://www.centos.org/modules/tinycontent/index.php?id=13
enabled=1
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#released updates
[update]
name=CentOS-5 – Updates
baseurl=http://mirror.centos.org/centos/5/updates/i386/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-5 – Addons
baseurl=http://mirror.centos.org/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-5 – Extras
baseurl=http://mirror.centos.org/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 – Plus
baseurl=http://mirror.centos.org/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#contrib – packages by Centos Users
[contrib]
name=CentOS-5 – Contrib
baseurl=http://mirror.centos.org/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#packages in testing
[testing]
name=CentOS-5 – Testing
baseurl=http://mirror.centos.org/centos/5/testing/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

收藏与分享
18 2010

超雷人!曾哥出演变形金刚3-雷布斯出品

Posted by admin in 日记

收藏与分享
18 2010

光纤通道(Fibre Channel)协议详述

Posted by admin in 电脑网络

 

    所有的这三种协议(FC-SCSI,FC-IP,FC-VI)可以备组合成一个光纤通道结构。尽管这些协议也能在FC-AL 里工作,但相应的带宽共享和仲裁消耗忽略掉了FC-IP 和FC-IP 的性能优点。

一、光纤通道基本架构

FC-4 Upper Layer Protocol:SCSI,HIPPI,SBCCS,802.2,ATM,VI,IP

FC-3 common service

FC-2 Framing Protocol /Flow Control

FC-1 Encode/Decode

FC-0 Media:Optical or copper,100MB/sec to 1.062GB/sec

描述:

FC-0:物理层,定制了不同介质,传输距离,信号机制标准,也定义了光纤和铜线接口以及电缆指标

FC-1:定义编码和解码的标准

FC-2:定义了帧、流控制、和服务质量等

FC-3:定义了常用服务,如数据加密和压缩

FC-4:协议映射层,定义了光纤通道和上层应用之间的接口,上层应用比如:串行SCSI 协议,HBA 的驱动提供了FC-4 的接口函数,FC-4 支持多协议,如:FCP-SCSI,FC-IP,FC-VI。

Read entire article.

收藏与分享
16 2010

网易的域名邮箱又重出江湖了。

Posted by admin in 日记

 

 

   http://ym.163.com

 

 

我很想注册一个,可是没有邀请码!

 

郁闷!

收藏与分享
15 2010

qemu manager安装junos快速向导

Posted by admin in CISCO, juniper

一、安装qemu manager 6.0

二、安装openvpn,低版本的openvpn在安装虚拟网卡TAP时,在vista或win7上会报驱动无法通过认证,不予以安装,此时需下载openvpn-2.1_rc15-install版本以上,即可顺利安装网卡驱动。

1、安装完成后看到网络连接内新的网卡,重命名为英文TAP0。TAP网卡负责和虚拟机通讯,虚拟机内的网卡和TAP看起来在一个交换机下。

2、将TAP0网卡设置为和本地网卡不同网段。192.168.10.31(本地网卡为192.168.0.31),掩码都是16位,网关都是192.168.0.1;(此时虚拟机如装好,可以和TAP互通,但是不通其他网络)

3、将本地连接设置为允许共享上网。此时虚拟机只要把网关设为TAP地址,即可和其他网络通讯。相当于通过虚拟机——TAP——本地连接(ICS)——外部网络。

三、qemu manager设置如下:

1、新建虚拟机,20G硬盘,linux系统。

2、网卡参数调整为557b,559e会崩溃,这是这个版本的qemu的问题;e1000没试过,据说junos8以上支持了,在vmware里可以装成功,qemu这次没试。

3、VLAN类型设置为TAP,ID填网络连接里的名称(如TAP0)

4、光盘设置为4.8-RELEASE-i386-mini.iso

5、串口设置为TCP接口,127.0.0.1,端口1007,监听不等待。

四、启动安装系统。

开机,选择第一个选项跳过——stand安装——A自动分配Q完成——stand引导——分区:按C,输入8000M,FS,挂载点/;如此完成:

ad0s1a    /    8000M

ad0s1b    SWAP    1000M

ad0s1e    /tmp    2000M

ad0s1f    /var    8800M   

Q退出——mini安装——CD/DVD安装——一路回车,设置网卡,192.168.10.37,掩码16位,网关192.168.10.31(TAP地址)——一路回车,中途设置下时区和鼠标,其他全部默认。

完成后测试ping,已经可以连接任何网络。

五、安装junos

在Freebsd 上登陆FTP服务器输入用户名和密码,模式改为binary的二进制模式,要不在junos安装时出错。

切换到Lcd /var/tmp里面,使用get jinstall-9.6 上传到/var/tmp里,bye(退出)

查看junos文件ls /var/tmp

rm /dev/wd0c                   删除/dev/wd0c目录

ln -s /dev/ad0c /dev/wd0c     
mkdir /var/etc                   在/var下创建一个etc目录

touch /var/etc/master.passwd

touch /var/etc/inetd.conf

touch /var/etc/group

进入/var/tmp目录下

cd /var/tmp

mkdir jinst-signed
cd jinst-signed
tar zxfv ../jinstall-9.6R1.13-export-signed.tgz

mkdir jinst
cd jinst
tar zxfv ../jinstall-9.6R1.13-export.tgz

mkdir pkgtools
cd pkgtools
tar zxfv ../pkgtools.tgz
cd bin
cp /usr/bin/true ./checkpic  把包中的pkgtools.tgz中的checkpic用/usr/bin/true替換掉
cd ..

tar zcfv ../pkgtools.tgz  *
cd ..
rm -rf pkgtools
tar zcfv /var/tmp/jinstall-9.6R1.13-export -olive.tgz  *    这里我把打好包的olive做了个备份,省的以后重装麻烦了

打包完成后,在/var/tmp下安装 pkg_add -f  jinstall-9.6R1.13-export -olive.tgz;

安装成功后先关闭机器#shutdown -h now

六、等待junos自动安装

1、telnet 127.0.0.1 1007;等待JUNOS安装自动完成,时间有点长。

2、安装完成后,telnet和console出现提示符,均可以操作。输入cli进入junos测试。

3、完成后shutdown -h now;耐心等待关闭,此时console无响应,但是telnet里可以看见仍在同步磁盘,不要急于关机。

收藏与分享
08 2010

IPv6 的RDNS搭建、测试成功。

Posted by admin in ipv6, 个人案例简汇, 电脑网络

    经过一段时间的摸索。终于把基于Windows Server +DNs server 的 IPV6 Rdns搭建起来了。

 

C:\>tracert -6 vs1.ghitr.com

Tracing route to vs1.ghitr.com [2001:470:1f05:819::2]
over a maximum of 30 hops:

  1   311 ms   325 ms   301 ms  2001:5c0:1000:b::5786
  2   411 ms   403 ms   399 ms  ix-0-0.224.mcore4.MTT-Montreal.ipv6.as6453.net [2001:5a0:300::5]
  3   597 ms   479 ms   795 ms  if-12-3.mcore3.MTT-Montreal.ipv6.as6453.net [2001:5a0:300:100::21]
  4   421 ms   739 ms   377 ms  POS13-0.mcore4.NYY-NewYork.ipv6.as6453.net [2001:5a0:300:100::2]
  5   615 ms   643 ms   603 ms  POS5-0.mcore4.NJY-Newark.ipv6.as6453.net [2001:5a0:f00:100::1]
  6   604 ms   585 ms   331 ms  10gigabitethernet4-2.core1.nyc4.he.net [2001:504:0:6::6939:1]
  7   384 ms   399 ms   377 ms  10gigabitethernet5-3.core1.lax1.he.net [2001:470:0:10e::1]
  8   565 ms   763 ms   679 ms  10gigabitethernet1-3.core1.pao1.ipv6.he.net [2001:470:0:34::1]
  9   613 ms   553 ms   389 ms  10gigabitethernet1-4.core1.fmt2.ipv6.he.net [2001:470:0:30::1]
10   390 ms   392 ms   405 ms  gige-gbge0.tserv3.fmt2.ipv6.he.net [2001:470:0:45::2]
11   606 ms   783 ms   577 ms  yangybcy-1-pt.tunnel.tserv3.fmt2.ipv6.he.net [2001:470:1f04:819::2]
12   588 ms   609 ms   605 ms  ipv6.server.ghitr.com [2001:470:1f05:819::2]

Trace complete.

 

 

 

收藏与分享
08 2010

So what is "IPv6", and why do I need to know about it?

Posted by admin in ipv6, 电脑网络
Tags: | Add comment

    IPv6 or IP version 6 is the next generation Internet protocol which will eventually replace the current protocol IPv4. IPv6 has a number of improvements and simplifications when compared to IPv4. The primary difference is that IPv6 uses 128 bit addresses as compared to the 32 bit addresses used with IPv4. This means that there are more available IP addresses using IPv6 than are available with IPv4 alone. For a very clear comparison, in IPv4 there is a total of 4,294,967,296 IP addresses. With IPv6, there is a total of 18,446,744,073,709,551,616 IP addresses in a single /64 allocation.

 

    To also help illustrate the sheer magnitude of available IP addresses using IPv6, you can get 65536 /64 allocations out of a single /48, and then 65536 /48 allocations out of a single /32. Many Service Providers are getting /32 allocations from their Regional Internet Registry (RIR) like ARIN, APNIC, RIPE, etc.

 

    A significant difference between IPv6 and IPv4 is the address notation. IPv4 uses a period (.) between each octet, compared to IPv6 which uses a colon (:). With IPv6, if you have a series of zeroes in a row, the address need not be written out completely. You can use a double colon (::) to represent that series of zeroes, however you can only use that once. For example, if you have an address like “2001:0DB8:0000:0003:0000:01FF:0000:002E”, it can be written like “2001:DB8::3:0:1FF:0:2E” or “2001:DB8:0:3:0:1FF::2E”, but would never be written like “2001:DB8::3::1ff::2E”. You also cannot have three colons in a row (:::).

 

    IPv6 availability depends on your Service Provider, either at home or for work. In a dual-stack environment, IPv4 and IPv6 co-exist along the same connection and don’t require any special kind of connection. If dual-stack is not available, you might find yourself using an IP tunneling product or service to bring IPv6 connectivity to you. IPv4 exhaustion, as of this writing, is estimated to happen sometime in early or mid 2011. When this happens, IPv4 won’t simply disappear off the face of the Internet, but continued explosive growth requiring more unique IP address assignments will mean using more and more of the abundant IPv6 address space.

 

    Many Operating System platforms have native IPv6 support these days. The UNIX based platforms like Linux, BSD (Free, Open, Net) & MacOSX have had IPv6 support enabled for years now. Microsoft Windows starting having native IPv6 support enabled by default with it’s Vista and Windows 2008 products. Earlier Windows versions like 2000/2003/XP had to have it installed optionally, and did not have as robust features that are available in the newer versions of Windows. Even common web browsing and email software will use IPv6 if it is enabled and available, without having to check off an option or special configuration. The transition from IPv4 to IPv6 is being worked on to be as seemless as possible, and many might not even notice the subtle changes in the coming years.

收藏与分享
07 2010

IPV6的自动配置 (windows/cisco)

Posted by admin in ipv6

    昨晚一朋友询问怎样配置IPV6在Cisco的路由器上。   他的平台是Cisco 3640+Gns3+Windows7。后来讨论发现GNS3在Windows7上面好像不能对本机的网络链接进行操作。

 

 

    大家都知道IPV6的地址是a long a long的。如果让每个用户都去手工配置地址。那肯定是一件很大的灾难。那么肯定还是自动配置是最方便的。

 

    IPV6的自动配置又分成两种方式:1.DHCPv6             2.IPV6的无状态自动配置。

    当让IPV6的无状态自动配置是最简单的。所以先看一下无状态自动配置。

 

Read entire article.

收藏与分享
02 2010

如果DEDECMS5.5安装完成后提示无权限执行这一操作。则执行下面的SQL

Posted by admin in 日记

 

 

 

INSERT INTO `dede_admintype` VALUES (1, ‘信息发布员’, 1, ‘t_AccList a_AccNew a_AccList a_MyList a_MyEdit a_MyDel sys_MdPwd sys_Feedback sys_MyUpload plus_留言簿模块 ‘),
(5, ‘频道管理员’, 1, ‘t_AccList t_AccNew t_AccEdit t_AccDel a_AccNew a_AccList a_AccEdit a_AccDel a_AccCheck a_MyList a_MyEdit a_MyDel a_MyCheck co_AddNote co_EditNote co_PlayNote co_ListNote co_ViewNote spec_New spec_List spec_Edit sys_MdPwd sys_Log sys_ArcTj sys_Source sys_Writer sys_Keyword sys_MakeHtml sys_Feedback sys_Upload sys_MyUpload member_List member_Edit plus_站内新闻发布 plus_友情链接模块 plus_留言簿模块 plus_投票模块 plus_广告管理 ‘),
(10, ‘超级管理员’, 1, ‘admin_AllowAll ‘);
ALTER TABLE `dede_admintype` CHANGE `rank` `rank` FLOAT( 6 ) DEFAULT ‘1′;
UPDATE `dede_admintype` set `rank`=(5 + (`rank`/10)) where `rank` > 10;
ALTER TABLE `dede_admin` CHANGE `usertype` `usertype` FLOAT( 6 ) UNSIGNED DEFAULT ‘0′;
UPDATE `dede_admin` set `usertype`=(5 + (`usertype`/10)) where `usertype` > 10;

收藏与分享
Pages: 上一页 1 2 3 4 5 6 ...19 20 21 下一页