Get the App
SLTechnology News&Howtos  ›  Servers  › 

Experiment on NAT working Mode in LVS Scheduler

Shulou Source: shulou.com Published: 2022-06-03 08:40:37 12月06日 Update

LVS Cluster Creation and Management

Using the ipvsadm tool

Network File System

Depends on RPC (Remote Procedure Call) Requires installation of nfs-utils, rpcbind packages System services: nfs, rpcbind Shared configuration files: /etc/exports

Case Environment LVS scheduler acts as the gateway of web server pool, LVS two network cards are connected to internal and external networks respectively, using polling (rr) scheduling algorithm

Experimental case diagram

experimental process

1. Configure NFS storage servers to provide storage space

1. Start by adding two hard disks to the nfs server

2. Restart server after adding hard disk

3. Modify the hostname for each server for easy identification

4. View newly added hard drives

Format two hard disks (the two methods are the same, take sdb as an example)

After formatting, mount. First, create two mount points.

Modify the/etc/fstab file

Mount successful

5. shared storage space

turn off the firewall

All required packages exist for sharing

modify the configuration file

Modify NIC to host-only mode

At this point nfs is in a disconnected state, so configure it at the VM terminal

Turn on the service and see if the shared space path is available

Modify the NIC configuration because we switched connection mode

Restart the NIC and verify

NFS server configuration complete

2. Configure two Web servers

First install Apache services (two web server configuration process is the same, take Web1 as an example)

turn off the firewall

Switch NIC to host-only mode

Modify web1 network card address

Modify web2 network card

providing site

vim /etc/fstab

Mount the site and view

Go to default home page Write content

opening service

At this point, the work on both Web servers is complete.

III. Configure the LVS server

1. Download the ipvsadm installation tool

2. Add NIC to LVS server and set to host-only mode

Copy a copy of the contents of the network card and modify both network cards

Restart the NIC and check

Using two web servers ping the gateway to test connectivity

Enable routing forwarding

Configure firewall settings using iptables

Clear forwarding table

Clear NAT address translation tables

Change IP address of win10 client

Client pingLVS Server Test

Load the LVS kernel module

Define startup scripts

startup script

Next, test it on the client.

The experiment of NAT working mode in LVS scheduler is completed!

Tags: Service server network card configuration mode file host hard disk lab scheduling address customer space process firewall storage testing fire prevention work content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Apple vpn Xiaomi Linux