In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail the example analysis of Linux link aggregation. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Link aggregation is a computer network term that aggregates multiple physical ports together to form a logical port to achieve load sharing of outbound / inbound traffic throughput across member ports.
According to the port load sharing policy configured by the user, the switch determines which member port the network packet is sent to the opposite switch. When the switch detects the link of one of the member ports
In the event of a failure, stop sending packets on this port, and recalculate the sending port of the message in the remaining links according to the load sharing policy, and the failed port acts as the sender again after recovery.
Mouth. Link aggregation is a very important technology in increasing link bandwidth, realizing link transmission elasticity and engineering redundancy.
There are two commonly used modes of link aggregation of NICs: "bond" (network binding) and "team" (network grouping):
The "bond" mode is mainly used on RHEL6
"Team" mode is a technology to realize link aggregation on RHEL7.
"bond" mode can add up to two fast network cards.
The "bond" model does not support debt balancing.
Ipv6 is not supported in "bond" mode.
Hash encryption is not supported in "bond" mode.
Up to eight network cards can be added in "team" mode.
"team" mode supports load balancing.
The "team" mode supports ipv6.
Hash encryption is supported in "team" mode.
Bond2team command: converts a binding profile to a network grouping profile.
"team" (network group daemon)
Installation of team:
Yum install reamd
Working modes supported by "team" mode:
Active-backup: master / standby
Loadbalance: load balancing
Broadcast: broadcast fault tolerance
Roundrobin: balanced call
When using the NetworkManager daemon to control grouped port interfaces, especially when errors are found, keep the following points in mind
1. Starting the primary interface does not automatically start the port interface.
2. Starting the port interface always starts the primary interface
3. Stopping the primary interface always stops the port interface
4. Hosts without ports can start static IP connections
5. Hosts without ports will wait for ports when starting a DHCP connection
6. After adding the port with carrier, the host using DHCP connection waits for the port to complete the connection.
7. After adding a port without carrier, the host connected by DHCP will keep the port waiting.
Use the command line to configure the "team" example:
1.nmcli connection show (View available connections in the system) [root@localhost ~] # nmcli connection show NAME UUID TYPE DEVICE enp4s0f3 22c02942-97bc-4e91-9fbd-ba81ade73091 ethernet enp4s0f3 virbr0 84d56169-90a1-40d6-8ed8-c48ea30e3349 bridge virbr0 enp4s0f0 65bde539-1c28-45cc-abb1-0ea9ddbe28f4 ethernet-- enp4s0f1 bdf86b0b-9c32-443f-a40e-5bad91ffb632 ethernet-- Enp4s0f2 1be55c68-9659-4041-a20e-d08dbc64cac8 ethernet-- [root@localhost] # 2. Create team interface: nmcli connection add type team ifname team interface name [root@localhost ~] # nmcli connection add type team ifname team-ServerA connection "team-team-ServerA" (dc7d9c0f-dd25-4444-a5d6-c963ade56b78) has been added successfully. [root@localhost ~] # NetworkManager writes the configuration to the / etc/sysconfig/network-scripts/ifcfg-team-team-ServerA file and sets onboot to yes and bootproto to dhcp. You can use the nmcli connnection show team API name command to view interface information [root@localhost ~] # nmcli connection show team-team-ServerAconnection.id: team-team-ServerAconnection.uuid: dc7d9c0f-dd25-4444-a5d6-c963ade56b78connection.stable-id:-- connection.type: teamconnection.interface-name: Team-ServerAconnection.autoconnect: is connection.autoconnect-priority: 0connection.autoconnect-retries:-1 (default) connection.auth-retries:-1connection.timestamp: 0connection.read-only: no. Change team interface name: nmcli con mod old-team-name connection.id new-team-name imports configuration file for team interface: nmcli connection modify team-name team.config JSON-config
Cd
3. Add enp4s0f0,enp4s0f1 to the team interface team-team-ServerA:
Nmcli con add type team-slave con-name from team interface name ifname network card device name master primary team interface name [root@localhost ~] # nmcli con add type team-slave con-name team-slave1 ifname enp4s0f0 master team-team-ServerA connection "team-slave1" (31848a23-7071-4fc3-abc2-7e423ba3e181) has been successfully added. [root@localhost ~] # nmcli con add type team-slave con-name team-slave2 ifname enp4s0f1 master team-team-ServerA connection "team-slave2" (ab23f7fe-916d-4597-9d54-b68d532a3413) has been added successfully. [root@localhost ~] #
4. To enable network grouping, you must first activate these ports
[root@localhost ~] # nmcli connection up team-slave1 connection activated successfully (D-Bus activity path: / org/freedesktop/NetworkManager/ActiveConnection/11) [root@localhost ~] # nmcli connection up team-slave2 connection activated successfully (D-Bus activity path: / org/freedesktop/NetworkManager/ActiveConnection/12) [root@localhost ~] # [root@localhost ~] # nmcli connection up team-team-ServerAConnection successfully activated (master waiting for slaves) (D-Bus active path: / Org/freedesktop/NetworkManager/ActiveConnection/13) cd [root@localhost ~] #
Create a team interface using a configuration file:
Create a configuration file under the / etc/sysconfig/network-scripts/ directory with the following contents:
DEVICE=team0
DEVICETYPE=Team
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.1.1
PREFIX=24
TEAM_CONFIG=' {"runner": {"name": "activebackup"}, "link_watch": {"name": "ethtool"}'
This creates the team primary interface to create ports that are members of the team, please create one or more configuration files under the / etc/sysconfig/network-scripts/ directory, as follows: DEVICE=xxx HWADDR=xxxx DEVICETYPE=TeamPort ONBOOT=yes TEAM_MASTER=team0 TEAM_PORT_CONFIG=' {"prio": 100} 'prio is used to specify priority, which ranges from-32767 to + 32767, and defaults to 0 if not specified. This is the end of the article on "sample Analysis of Linux Link aggregation". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.