Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How DRBL and CentOS6.3 build Diskless Cluster

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "DRBL and CentOS6.3 how to build Diskless Cluster", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "DRBL and CentOS6.3 how to build Diskless Cluster" this article.

First, install the centos6.3 system: 1, CD-ROM or network PXE reinstall the system

You can mount the home directory (possibly the original home directory) in the part5 of the disk array (in this case / dev/md126) to the new system / home directory:

[* *] # cat / etc/fstab## / etc/fstab# Created by anaconda on Sat Jan 26 22:54:18 2013 March # Accessible filesystems, by reference, are maintained under'/ dev/disk'# See man pages fstab (5), findfs (8) Mount (8) and/or blkid (8) for more info#UUID=ea636e37-69c9-4603-9250-76193bca28c7 / ext4 defaults 1 1tmpfs / dev/shm tmpfs defaults 0 0devpts / dev/pts devpts gid=5 Mode=620 0 0sysfs / sys sysfs defaults 0 0proc / proc proc defaults 0 0##/dev/md126p5 / media/raid2tp5 ext4 defaults 0 0 / dev/md126p1 / media/raid2tp1 ext4 defaults 0 0 / media/raid2tp5/home / home none defaults Bind 0 02 Note that it is mentioned in the DRBL installation instructions that it is recommended to disable the graphical interface configuration software of Network Manage.

It does need to be disabled in the operation in our environment, otherwise compatibility problems will occur.

In addition, set the IP address of all network cards. We will use eth0 outside, and its eth2 will be used for internal use later (you must set these internal network cards IP to 192.168.x.x, 172.16-31.x.x or 10.x.x.x private IP, such as eth2:192.168.101.254, eth3:192.168.102.254, eth4:192.168.103.254...). Please note that as a policy, private IP (192.168.x.x) will be used as a link to the DRBL environment. During the safety period, it is also recommended to set the fire alarm, and then set the fire alarm after the DRBL is installed. In addition, if your GNU/Linux installation automatically frees you to install NetworkManager and is automatically started, it is recommended or removed because the machine that is the server does not necessarily use NetworkManager. For example, in the case of Fedora, you can handle it like this: sudo chkconfig-- del NetworkManager; sudo chkconfig-- del NetworkManagerDispatcher, and then start chkconfig network on. For packages like Ubuntu or Debian, install the web configuration program "sudo apt-get install gnome-network-admin" manually, then remove the network manager: "sudo apt-get-purge remove network-manager" directly. After rebooting, run "network-admin" (or select "system"-> "Administration"-> "Network" on the Gnome desktop) to configure the fixed network. 3. Set up the network cards of the internal network and the external network. 1) set up the internal and external network.

Edit / etc/sysconfig/network-scripts/ifcfg-eth2

Configuration method of BOOTPROTO IP with / etc/sysconfig/network-scripts/ifcfg-eth0:DEVICE interface name (device, network card) (static: fixed IP, dhcpHCP, none: manual) is the network interface valid when the ONBOOT system is started (yes/no) TYPE network type (usually Ethemet) NETMASK network mask IPV6INIT IPV6 is valid (yes/no) GATEWAY default gateway IP address # the subnet connected to the switch does not need to configure a gateway? # 2) restart the network link # service network restart

3) check the network [* *] # routeKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface210.45.*.* * 255.255.255.0 U 000 eth210.1.1.0 * 255.255.255.0 U 000 eth0link-local * 255.255.0.0 U 1002 00 eth0link-local * 255.255.0.0 U 1003 00 eth2default 210.45.72.254 0.0.0.0 UG 00 eth2 [root@nsplab0 drbl] #

2. Installation, configuration and use of DRBL: 1. Install drbl if you are not a system administrator (root), execute the command "su root" (and then enter the password of root). If your package does not have a root password set, you can use "sudo su" (then the user's password) in order to get the key for root to install DRBL first (ID: 1024D/D7E8DF3A, Key fingerprint = F532 A131 65AF 2168 1634 DB1B 4000 9511 D7E8DF3A) In this way, you can further confirm that the program you installed is the program developed by this program. There are several ways to install. Method 1: "rm-f GPG-KEY-DRBL; wget http://drbl.nchc.org.tw/GPG-KEY-DRBL; rpm-- import GPG-KEY-DRBL". Method 2: download by keyserver, KeyID is D7E8DF3A, you can execute "gpg-keyserver subkeys.pgp.net-recv-key D7E8DF3A" in this way, and then run "gpg-a-export D7E8DF3A > GPG-KEY-DRBL; rpm-- import GPG-KEY-DRBL". If you want to find out whether the system already has a digital badge, you can query it like this: rpm-qa gpg-pubkey*. Download the RPM file of DRBL (file name such as drbl-1.9.6-35.i386.rpm): a fixed version, a version under test, or an undetermined version. Run "rpm-Uvh drbl-XXX.i386.rpm" or "yum install drbl-XXX.i386.rpm" (if your package has yum) to install the drbl program. Drbl-XXX.i386.rpm is the file you downloaded. If you are downloading the download, run "rpm-Uvh drbl-current.i386.rpm" or "yum install drbl-current.i386.rpm".

2. Configure drbl1) you can view the file under the modified / opt/drbl/conf: client-ip-hostname.example

Write a mapping relationship between IP and hostname that you want to assign to the client, such as:

# cat client-ip-hostname10.1.1.2 node110.1.1.3 node2 10.1.1.4 node32) you can also modify other example files in the custom directory / opt/drbl/conf. 3) run the configuration command # / opt/drbl/sbin/drblpush-I

Special note 1: during the operation, you will be prompted to start the client with one by one (if you want to automatically detect the client network card MAC, each client needs to be set to PXE startup and in the first order) to collect its MAC address. As an alternative, you can also manually create a new text file, usually in / etc/drbl/macadr-eth0.txt, where the MAC address of each intranet client Nic is added by line, and then the configuration asks for the location of the file, so that start the PXE clients one by one is no longer needed.

Special attention 2: it is best to set each MAC to assign a fixed static IP, refer to: add clinet computers, I have specified MAC address, how to operate correctly?

Pay special attention to 3: the most important thing is to check whether there is a directory file corresponding to each client IP under the directory / tftpboot/nodes. If so, the client can generally start up. The above is applicable in two Full modes, but not necessarily in SSI mode. Note that the client needs to start using PXE, please set BIOS accordingly, and it is best to set BIOS so that it can be started by waking up from the PCI-LAN device.

3. Start or restart drbl

# drbl-all-service start

Or

# drbl-all-service restart

A "Failed to start service ypbind" error may occur and can be restarted so correctly:

# service ypserv restart

4, restart the server and node

Generally, the computing node is shut down first, and then the master node is shut down. When booting, the master node boots first. After the master node boots and enters the login interface, it is best to wait another minute (self-feeling), and ensure that the PXE service of drbl is started. If you are not sure, you can enter the master node and use drbl-all-service to restart it. Then start the compute node, regardless of the order. Here, the switch is simply when each system executes the shutdown or halt command or directly presses the power supply or switch key (when the software switch is not allowed). When each node is normal and the drbl-doit command is available (you can connect to each node without a password ssh), you can use drbl-doit shutdown or halt to shut down uniformly.

5, DRBL usage and management 1) add new node machines

Method 1: you can reconfigure and install child nodes

Drblpush-I

Finally, you are prompted whether to keep the original settings, and you can choose not to, so each node regenerates the configuration document.

Method 2: if the previously installed node uses SSI mode, there is no need to re-drbl push

The number of remote computers has increased. After changing / etc/dhcp/dhcpd.conf, you can increase the number of nodes by running "/ opt/drbl/sbin/dcs-> others-> gen_3N_conf" or "/ opt/drbl/sbin/drbl-3n-conf generate".

Detailed reference: Web page: the last few lines of instructions for the use and modification of DRBL SSI mode.

How do I know if the new node can start PXE successfully? You can check to see if the / tftpboot/nodes directory has the directory named by the IP address of the machine you want to add, and if there is a node, it should be able to start.

2) add new users or configure users and passwords for new nodes

The newly added node may not necessarily have all the user information of the primary node after startup. The solution envisions is that the / etc/passwd,/etc/shadow,/etc/group,/etc/gshadow under the master node can be copied to the corresponding directory of the new client (that is, from / etc to / tftpboot/nodes/ new node IP). Batch copy can be made using drbl-cp-host. For more account management information, please see Bird's web page: http://linux.vbird.org/linux_basic/0410accountmanager/0410accountmanager-fc4.php.

[note] this method is somewhat blunt, worried about sequelae, because time is limited, other ways have not been considered yet.

When adding a new node, existing users will automatically synchronize to the new node, or manually execute "make-C / var/yp" to update "YP/NIS".

Add new users to servers and clients

Method one

Add the drbl-useradd and drbl-userdel commands that come with drbl. In this method, no legal person is the id number of the specified user.

To generate a user, the example states that to generate a user drbl, the group is penguin

Drbl-useradd-s drbl penguin

(http://drbl.nchc.org.tw/one4all/desktop/techrpt.php?c=drbl-useradd&t=%E5%A4%A7%E9%87%8F%E5%BB%BA%E7%AB%8B%E4%BD%BF%E7%94%A8%E8%80%85%E5%B8%B3%E8%99%9F)

Method two

Use the traditional method adduser, deluser to first add users to the server and then update the "YP/NIS" by executing "make-C / var/yp". Or is it recommended to use method one?

3) DRBL Advanced Management

Drbl-doit "echo 'source / opt/intel/mkl/bin/mklvars.sh intel64' > > / etc/bashrc": operate on all client machines:

For more information on how to manage and use it, please click here.

[other references]

Brother Bird's drbl record DRBL operation guide

3. Cluster system management and use 1. System management message notification 1) user login notification

Modify the file / etc/motd to add what you want the user to see after logging in.

2) push to the user message write user name [tty]

Use the above command to send an instant message to the user of the current system, which will not interrupt the user's work and will be displayed in the user's current standard output. You can also use write all to send messages to all users.

2. SSH1 of system management) X11 Forwarding of SSH

Modify the server file / etc/ssh/sshd_config to make AllowTcpForwarding yes, AllowAgentForwarding yes and X11Forwarding yes

Then modify the / etc/ssh/ssh_config of your machine (if it is linux) to make ForwardAgent yes ForwardX11 yes.

You also need to log in to other nodes from the server, so you also need to modify the ssh_config file in the server as above. The former (Tcp) may not be needed.

2) there is no password exchange between the nodes of SSH.

For root users:

# ssh-keygen-t rsa # cd ~ / .ssh # cat id_rsa.pub > > authorized_keys

You then need to use the command "drbl-cp-host ~ / .ssh/* / root/.ssh/" to copy the authentication file to the child node.

For other ordinary users, because the home directory is shared, you only need to do the first step.

If you still have problems with the exchange of visits, you can refer to the following section: "HostKyeChecking of SSH"

3) HostKyeChecking of SSH

For some strange questions, such as logging in without a password from the primary node to the child node, but not the other way around, or you always need to answer yes. Some strange problems may be related to nodes sharing a system and user directory, or they may be related to DRBL. After trying to disable checking, there is no obstacle to the exchange of visits between nodes. Method: add the following to ssh_config

# UserKnownHostsFile=/dev/null

StrictHostKeyChecking no

If you don't want to save ~ / .ssh/known_hosts, you can enable the first line above so that every login generates a known_hosts, but it's all saved in the black hole of the / dev/null file.

[note] after the DRBL reinstalls the child node, the original known_hosts is invalid, and retaining the original file may make the word node inaccessible from the master node.

Test:$$ (E = MC ^ 2) $$:

The above is all the content of the article "how to build Diskless Cluster between DRBL and CentOS6.3". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report