Linux Miscellaneous (17): iscsi storage separation technology

Source: Internet
Author: User
1iscsi introduction ?? ISCSI uses the port860 and 3260 of the TCPIP as the communication channel. Benefits between two computers 1. iscsi introduction
?
? ISCSI uses port 860 and port 3260 of TCP/IP as the communication channel. The iSCSI protocol is used between two computers to exchange SCSI commands, so that the computer can simulate SAN as a local storage device through a high-speed LAN Collection line.
?
?

Although iSCSI can communicate with any type of SCSI device, system administrators use it almost always to connect to server computers (such as database servers) and storage arrays on disk volumes. ISCSI SAN is usually used for the following two purposes:

Storage IntegrationCompanies want to move different storage resources from servers distributed on the network to a unified location (often a data center), which makes storage allocation more effective. Servers in the SAN environment can obtain new disk volumes without any changes to hardware or cable connections.

Disaster RecoveryThe company wants to mirror storage resources from one data center to another remote data center, which can be used for hot backup in the case of a long power failure. In particular, iSCSI SAN allows us to migrate the entire disk array on the WAN with minimal configuration changes. in essence, storage is changed to "routable ", just like a normal network communication.
?
? Here we can give an example. Alibaba's server has many accounts. if the account and password are actually on a single server, the information will be lost when the server fails. That is disastrous for both Alibaba and users. Therefore, use a network device instead of a local server hard disk:
?
?
?
? As described in the figure, the customer only accesses the device in the disk cabinet, not the server that provides services. The inventory cabinet is managed by a separate server. the server only provides external assignment tasks, so that the storage separation technology is realized and the functions of each server are unified, makes the entire architecture more secure.
?
? 2. iscsi implementation
?
? After understanding the basic principles of iscsi, we need to implement an iscsi model.
?
? (1) preparations
?
? There must be two hosts, one providing a network device (equivalent to a disk cabinet) and the other using a network device (equivalent to a UNIX server ).
?
(2) formal configuration
?
? 1. check the server first:
?
? 1) first, you must create a device that is shared externally;
? 2) install the iscsi server;
? 3). enable the service after configuring the service;
?
? 1). make the device:
?
?
?
?
?
? After the generation is complete, perform the following operations. The second operation is performed twice:
?
?
?
? 2. install the iscsi server:
?

?
? 3) set the main configuration file:

?
?
? Share the device. the server name is westos.example.com.
?
?
? Enable the service:
?
?
?
? 2. client
?
? At this time, our server has shared a device, and the client is to obtain it. First, we will install the iscsi client:
?
?
?
? Fortunately, we have installed it.
?
? Find the shared network device of the specified ip address. we can see that we have found:
?
?
? Enable this network device:
?
?
? Enabled successfully!
?
? We listed the currently available devices on this server and found that there is a network device/dev/sda in addition to the local/dev/vda devices. This is a network device shared by westos.example.com. we can operate on it. what actually changes is the device in westos.example.com. when the server fails, the server shared with the device retains data, which is very secure. Does not affect business operations.
?
?
?
?
?
? We can operate on it like using a local hard disk. we can use it to generate new devices and mount and use them.
?
?
?
?
?
? Then you can format the Mount:
?
?
?
?
?
? To be permanently mounted, you need to write the/etc/fstab file:
?
?
?
? Note: pay attention to the details here. add _ netdev after ULTS; otherwise, it cannot be used.
?
? 3. we have discussed how to use this network device, so we also need to perform a series of operations when we don't want to use it:
?
? 1) uninstall it first. delete it if/etc/fstab writes;
? 2) disconnect the device from iscsi;
?
? 1) uninstall it first:
?

? 2) disconnect the device from iscsi:
?
? Detach a device:
?
?
? After deletion, exit and find that the network device is indeed missing:
?
?
?
? Summary:
?
? The above is the most basic configuration of iscsi storage separation. think about this idea and it will be widely used. we will also meet it when talking about clusters and server load balancer in the future. I will explain it later. Today's two are even better!
?



Related Article

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.