Skip to content
Khosrow E. edited this page Feb 24, 2014 · 6 revisions

Commands are broken down into different levels, similar to shells like crmsh, and each new level will present different commands.

Table of Contents

Common Commands

Commands below will work at all levels.

set

Change or show display settings inside lvsm.

help

Print a relevant help messge depending on the level.

end

Return to the previous level.

exit

Exit the lvsm shell.

quit

Exit the lvsm shell.

Live Level

Available commands are

restart

Restarts a given module. For this command to work the configuration items director_cmd and/or firewall_cmd need to be set up in the lvsm.conf file.

Usage:

restart <module>

Where <module> is one of:

Option Result
director restart the lvs director
firewall restart the iptables firewall

Virtual Level

In this level the status of the live setup can be viewed.

status

Show the running status of all virtual servers.

Usage:

status

show

Show the running status of one or more virtual server(s).

Usage:

show tcp|udp|fwm <vip> [<port>]

The options are defined below

Option Meaning
<service> service type of tcp, udp, or fwm. Refer to ipvsadm documentation for more info.
<vip> hostname or IP address of the virtual server
<port> optional. the port name or number associated with the server

Examples:

lvsm(live)(virtual)# show udp 10.10.10.20 53   
lvsm(live)(virtual)# show tcp mysite

enable

Enable a real server. This option is dependent on the director type.

  • Under ldirectord it is supported only when the maintenancedir is set in ldirectord.conf.
  • Under keepalived it is supported only when SNMP support is enabled and SNMP is configured in read/write mode to have access to Keepalived.

Usage:

enable real <server> [<port>]

disable

Disable a real server in ipvs. This option is dependent on the director type.

  • Under ldirectord it is supported only when the maintenancedir is set in ldirectord.conf.
  • Under keepalived it is supported only when SNMP support is enabled and SNMP is configured in read/write mode to have access to Keepalived.

Usage:

disable real <server> [<port>]

Real Level

In this level

show

Show information about a specific real server.

Usage:

show <server> [<port>]

enable

Enable a real server. This option is dependent on the director type.

  • Under ldirectord it is supported only when the maintenancedir is set in ldirectord.conf.
  • Under keepalived it is supported only when SNMP support is enabled and SNMP is configured in read/write mode to have access to Keepalived.

Usage:

enable real <server> [<port>]

disable

Disable a real server in ipvs. This option is dependent on the director type.

  • Under ldirectord it is supported only when the maintenancedir is set in ldirectord.conf.
  • Under keepalived it is supported only when SNMP support is enabled and SNMP is configured in read/write mode to have access to Keepalived.

Usage:

disable real <server> [<port>]

Firewall Level

This level provides information about the iptables filters.

status

Display the status of all packet filtering rules.

Usage:

status

show

Show the running status of specific packet filter tables.

Usage:

show <table>
Table Meaning
nat show the network address translation table in the prerouting chain
filters show the filter table in the input chain

Configure Level

Enters configuration mode. In this mode, the configuration files can be viewed and synced if under version control and/or cluster mode. Configure mode provides access to the director configuration as well as firewall rules.

Available commands are

show

Will display the configuration for the specified module.

Usage:

show <module>

Where <module> is one of:

Option Result
director show the director configuration
firewall show the iptables configuration

Example:

lvsm(configure)# show director

edit

Opens the configuration file for the module using an editor. Note: the editor is currently set to vi.

Usage:

edit <module>

Where <module> is one of:

Option Result
director edit the director configuration
firewall edit the iptables configuration

Example:

lvsm(configure)# edit director

sync

Synchronizes all configuration files across the cluster by first commiting to a revision control system. Currently only subversion and git are supported.

Example:

lvsm(configure)# sync

Clone this wiki locally