Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
litespeed_wiki:lslb:installation [2017/04/21 13:47]
Michael Alegre [Testing] Changed mentions of LSLB to Web ADC.
litespeed_wiki:lslb:installation [2019/05/17 21:31]
Kacey Schroeder [Upgrade]
Line 1: Line 1:
-====== ​LiteSpeed Web ADC Installation ====== +====== Installation/​Uninstallation ​====== 
- +Installation must be performed in a command line terminal. For testing purpose, ​LiteSpeed ​Load Balancer can be installed into your home directory as a non-privileged userFor production useit should be installed into a system directoryUnder Mac OS X, root user is disabled by default; ​it can be enabled by using the NetInfo Manager Application ​in /Applications/Utilities folderIf you don't want to enable root user, you can use "​sudo" ​to install LiteSpeed ​Load Balancer into system directory as well.
-LiteSpeed ​Web ADC is an affordable, high-performance layer 7 HTTP smart load balancer applicationLiteSpeed Web ADC is feature-richsecure, and efficient, offering more flexibility than similarly-priced load balancing softwareThis makes it an excellent choice for small enterprises looking to scale their applications beyond one server — both to improve service speed as well as reliability ​in case of hardware failure. +
- +
-**[[https://www.litespeedtech.com/​products/​litespeed-web-adc|More Information]]** +
- +
-In this guide we will be showing ​you how to download and install LiteSpeed ​Web ADC. +
-===== Prerequisites ===== +
-  -A server running Linux or FreeBSD 6.x. +
-  -A valid [[#​licensing_options|LiteSpeed Web ADC License]]. +
- +
-Note: It is recommended to run LSLB on machine separate from your web serversIt is also recommended that you have a dual NIC setup for your LSLB machine. One NIC with an assigned public IP address to handle public facing traffic, and one NIC in a private network with its own subnet (10.x.x.x or 192.168.x.x),​VLAN,​ or dedicated switch to handle traffic between LiteSpeed Web ADC and the backend. +
-===== Licensing Options ===== +
- +
-[[https://​store.litespeedtech.com/​store/​cart.php?​gid=4|Purchase an Owned/​Leased LiteSpeed Web ADC License]] +
- +
-[[https://​www.litespeedtech.com/​products/​litespeed-load-balancer/​download/​get-a-trial-license|Request a LiteSpeed Web ADC Trial License]]+
  
 ===== Download ===== ===== Download =====
- 
 Download [[https://​www.litespeedtech.com/​products/​litespeed-web-adc/​download|the latest version of LiteSpeed Web ADC]] to the root directory of the machine you will be using to run it and uncompress the downloaded file. We will be using LiteSpeed Web ADC 1.8 in this guide. Download [[https://​www.litespeedtech.com/​products/​litespeed-web-adc/​download|the latest version of LiteSpeed Web ADC]] to the root directory of the machine you will be using to run it and uncompress the downloaded file. We will be using LiteSpeed Web ADC 1.8 in this guide.
  
 For example: For example:
   #cd /root   #cd /root
-  #wget https://​www.litespeedtech.com/​packages/​lslb/​lslb-1.8-i386-linux.tar.gz +  #wget https://​www.litespeedtech.com/​packages/​lslb/​lslb-2.1-x86_64-linux.tar.gz 
-  #tar -zxvf lslb-1.8-i386-linux.tar.gz+  #tar -zxvf lslb-2.1-x86_64-linux.tar.gz
  
- +===== Install ​===== 
-===== Installation ​===== +  - Decompress the package into a convenient location:​\\ ​''tar xvfz lslb-xxxx.tar.gz or gunzip -c lslb-xxxx.tar.gz | tar xvf -''​ 
- +  - Install license key or serial number
-Now that we have LiteSpeed Web ADC downloaded, let's install it and configure for our two hypothetical servers. +    * Trial License: 
- +      - A trial license is for evaluation purposes and is only good for 15 days after downloadA trial license can be requested from download page. 
-Enter the now uncompressed ​lslb-1.8 directory +      - A trial license key will be sent to you as an attachment ​in a confirmation emailPlease save the attachment as ''​trial.key'' ​and copy it to the installation ​directory
- +      - When you switch from a trial license ​to a production license, you can simply run the install script again after following ​the steps below to update your license. 
-  ​cd lslb-1.8 +    * Production ​license: 
-   +      - Licenses can be leased or purchased at the LiteSpeed ​[[https://store.litespeedtech.com|store]]. 
-Place your "trial.key"/"​serial.no" file in this directory (/​root/​lslb-1.8) and ensure that  ​''​license.litespeedtech.com'' ​is reachable from your server before continuing.  +      - A serial number ​will be sent to you in the confirmation email after you order has been successfully processedEach serial number allows ​for one server installation. 
- +      - Save the serial number as "​serial.no"; ​in the installation directory (where install.sh is located).  The LiteSpeed products registration server will use this file to retrieve your license key during ​the installation process
-Run the installation ​script +  ​- Go to the installation directory ''​cd lslb-xxxx''​ and run command ''​./​install.sh''​ \\ \\ The "​root" ​user can install the server into system directory; ​non-root user should install it to somewhere under their home directory. ​\\ \\ Mac OS X user can install the server into a system directory with command ''​sudo ​./​install.sh''​ 
-  ​./install.sh +  ​- Read the End User License Agreement and type "Yes" ​to confirm your agreement
- +  ​- Specify ​the directory where you would like to install LiteSpeed Web ADCFor the root user, the default is /usr/local/lslbFor non-privileged users, ​the default ​is their home directory. ​Remember, non-privileged users will not be able to install ​the server into a system directory.  
-Agree to the License agreement and specify ​the following recommended installation directory: +  - Generate license request.\\ \\ If the Installer only finds serial number but no valid license keyit will prompt ​to generate a license request. The installer ​will talk to LiteSpeed ​products registration server and obtain ​valid license key automaticallyUpon getting the license keyit will go to next step. If failed, the installer will exit and leave a license request file.\\ \\ If the automatic process failed, you can create a ticket with license department from online store client area.\\ \\ Note: Installation ​will continue only if there is a valid trial license or valid Enterprise license. 
-  Do you agree with above license? Yes +  - Follow ​the instructions on the screen
-  ​Destination ​[/opt/lslb]: /​usr/​local/​lslb +    - The following questions will be asked:  
- +    - User and group that the server process run on behalf ​of. 
-You will now be asked some simple configuration questions which will be explained below. Default values will be presented ​in brackets, such as "​[admin]"​The default value for y/n questions will be capitalizedYou can press the return key to select the default value when applicable. +    - Destination directory where the server should ​be installed. 
- +    If an installed copy exists, choose either Update or Reinstall.  
-  * **User name:** The username used to log in to the LSLB WebAdmin ConsoleDefault value is "​admin"​. +    - Update will keep your current configuration
-  * **Password:​** ​The password used to log in to the LSLB Webadmin Console. Must be at least 6 characters long+    - Administrator'​s ​username and password ​for the administration ​web interface
-  ​* **User:​** ​The user that LSLB will be running as. For security reasons, you should choose ​a non-system ​user who does not have a login shell and home directory, such as "​nobody"​Default value is "​nobody"​+    - TCP port for normal web service
-  ​* **Group:** The group that the load balancer will be running as. You will also be provided with a list of groups that your previously selected "User" ​is a member of. Default value is "​nobody". +    TCP port for web administration interface
-  ​* **HTTP port:** Specifies ​the port that LSLB will listen on. Port 80 is the standard HTTP port, so it is recommended ​to either stop any server you may have running on this port or change said servers port number so that you can use port 80 for LSLBDefault value is 8090. +    The "root" ​user has option ​to enable ​"chroot"​. ​The installer will setup the initial chroot environment automaticallyWe strongly recommend not enabling it unless you are familiar with "chroot". You can always enable it later with an upgrade installation
-  * **Admin HTTP port:** The port used for the LSLB WebAdmin Console. Once setyou can access ​the LSLB WebAdmin Console through ''<​nowiki>​http:​//Host_IP_Address:​Admin_Port<​/nowiki>''​You can replace "​Host_IP_Address"​ with "​localhost"​ if accessing through your LSLB machine. Default value is 7090. +    - The "root" ​user can also choose ​to run LiteSpeed Load Balancer as service which starts automatically at system startup**"Would you like to have LiteSpeed ​Load Balancer started automatically when the machine restarts [Y/n]?"**select ​"Y"​. ​If you miss this step during ​the installationyou can manually install ​the lslb.service startup script by running\\ ''/​usr/​local/​lslb/​admin/​misc/​rc-inst.sh'',​ then\\ ''​chkconfig ​lslb on''​
-  * **Enable chroot:** Allows you run LSLB in a chroot environment. This will limit the LSLB process and its children processes from accessing files outside of the new chroot directory, adding an extra layer of security. Default value is "​N"​ for no. +
-    * **Chroot ​directory:** The new root directory for the LSLB process (entered without a trailing "/"​)Specified when selecting "​y"​ for "​yes" ​to the "​Enable chroot"​ setting+
- +
-LSLB will now attempt to install. If successfulyou will be asked if you would like LSLB to start automatically when your machine starts and if you would like to start LSLB now. The default values for both of these questions is "​Y"​ for "​yes"​. +
- +
-===== Basic Configuration ===== +
- +
-This section ​will cover a basic LiteSpeed ​Web ADC configuration using LiteSpeed Web ADC server as well as 2 (or more) web servers running on separate machines from one anotherFor simplicitywe will be assuming 2 web servers with LiteSpeed Web ADC configured ​to handle HTTP traffic to a single site being hosted on both of these servers. If you would like to use LiteSpeed Web ADC for a different applicationsimply replace "​clusterHTTP"​ in this guide with the appropriate cluster type (AJP,​LSAPI,​FCGI,​MIX)  +
- +
-To startlog in to your LiteSpeed Web ADC WebAdmin Console using the IP address of your LiteSpeed Web ADC server and the port number ​you assigned the LiteSpeed Web ADC WebAdmin Console during installationWe will be using "192.168.0.10"​ as our LiteSpeed Web ADC IP address and the default port "​7090"​ for the LiteSpeed Web ADC WebAdmin Console+
- +
-  http://​192.168.0.10:​7090 +
- +
-Once you have logged in, navigate to Configuration >> Clusters ​and click "​Add"​ at the top right of "​Clusters List"+
- +
-Here we will be defining a new cluster as follows: +
- +
- +
-{{ :​litespeed_wiki:​lslb-new-cluster.png?direct 800px |}} +
-Click "​Save"​ at the top right+
- +
-Now that we have our cluster defined, let'​s ​define a worker group for this cluster where we will be adding in our two web servers as nodes. We will be using "​192.168.0.15:​81"​ and "​192.168.0.16:​82"​ as our two web servers and ports. Replace these values ​the IP addresses and ports of your own web servers.  +
- +
-While still viewing the "​clusterXYZ"​ cluster, click the tab for "​Worker Group",​ and then click "​Add"​Define the worker group as follows: +
- +
-{{ :​litespeed_wiki:​lslb-worker-group.png?direct 800px |}} +
- +
-Where "Node Address List" is a comma separated list in the form: +
- +
-  (Node_Tag)LSLB_IP_Address->​Destination_IP_Address:​Destination_Port +
- +
-Click "Save" ​at the top right. +
- +
-With our cluster fully configured and our web servers added as nodes to a worker group in said cluster, let's create our LiteSpeed Web ADC virtual host. +
- +
-Navigate to Configuration >> Virtual Hosts. +
- +
-{{ :​litespeed_wiki:​lslb-vh.png?​direct 800px |}} +
- +
-Since we will now be creating our own virtual host, we no longer need the "Example" ​hostDelete "​Example"​ by clicking "​Delete"​ in the "​Action"​ section for this host and then clicking "​Yes"​ to the confirmation message on the resulting page +
- +
-Back in Configuration >> Virtual Hosts, click "Add" at the top right of "​Virtual Host List". +
- +
-Choose a "Virtual Host Name", select "​clusterXYZ"​ for "​Default Cluster" to specify that this virtual host will be handling HTTP traffic, enter location for this virtual host's configuration fileFor example:  +
- +
-{{ :​litespeed_wiki:​lslb-vhost.png?​direct 800px |}} +
- +
-Click "Save" at the top right. +
- +
-Now that we have LiteSpeed ​Web ADC virtual host configured, ​the final step is to set a listener for the LiteSpeed Web ADC virtual host. The "Default"​ listener should already be configured for the port you specified during installationso lets check that by clicking ​"View/Edit"​. ​ +
- +
-Here you should see that under "​Virtual Host Mappings",​ the "​Example"​ virtual host is still mapped to this listener. +
- +
-{{ :​litespeed_wiki:​lslb-listener.png?​direct 800px |}} +
- +
-Because we deleted this virtual host earlier, we should also delete ​the mapping by again clicking "​Delete"​ under the "​Action"​ section and then clicking "​Yes"​ to the confirmation message on the resulting page.  +
- +
-Since we created our own LiteSpeed Web ADC Virtual host earlierwe can now add it to "​Virtual Host Mappings"​ by clicking "​Add"​ and selecting it as well as entering your sites domains in the comma seperated "​Domains"​ list. +
- +
-{{ :​litespeed_wiki:​lslb-listener-mapping.png?direct 800px |}} +
- +
-Click "​Save"​ at the top right and apply changes with a "​Graceful Restart"​. +
- +
-Before: +
-{{ :​litespeed_wiki:​lslb-gracefulrestart.png?direct 800px |}} +
- +
-After: +
-{{ :​litespeed_wiki:​lslb-gracefulrestart2.png?direct 800px |}} +
- +
-Your LiteSpeed Web ADC should now be working and ready to handle all incoming HTTP traffic to your specified port/site!+
  
 ===== Testing ===== ===== Testing =====
 +  - There are a couple of ways to control the server process. For detail information please see Administration Guide. To start the server, simply run ''​[your_install_dir]/​bin/​lslbctrl start.''​
 +  - If the default port for normal web service was not changed during installation,​ point your browser to **http://​[address]:​8090/​**,​ otherwise replace "​8090"​ with actual port used. "​[address]"​ should be the IP address or domain name of Load Balancer machine. Use "​localhost"​ if it is accessed from the same machine. Load Balancer will try to route request to a default LiteSpeed Web Server installation on localhost, port 8088, if it does not work, try next step. 
 +  - If the default port for web administration interface is not changed during installation,​ point your browser to **http://​[address]:​7090/​**,​ otherwise replace "​7090"​ with actual port used. "​[Address]"​ should be the IP address or domain name of your load balancer machine. Use "​localhost"​ if it is accessed from the same machine. The welcome page of administration interface should be loaded, click "Log on" link and use the administrator'​s username and password specified during installation to log on. For detailed information regarding configuration,​ please refer to our Configuration Guide, or click "​help"​ link on top of each page. 
 +  - If your server uses firewall, please make sure that localhost is trusted. For instance, Linux with IPTables should include a rule ''​ALLOW INPUT from LO''​.
 +  - If the web administration interface is inaccessible either, please take a look at the error log - ''​[your_install_dir]/​logs/​error.log'' ​
 +    * If it is because of TCP port confliction with other server applications,​ the load balancer should be reinstalled with an available port.
 +      * The following command can be used to find an available port: \\ ''​netstat -an | grep XXXX''​ \\ XXXX is the port number. If the port is available, no output should be produced.
 +    * If it is because swapping directory is not writable, you can either grant write permission of swapping directory to the user whom the web server running as, or change the swapping directory manually. The swapping directory is configured in the server'​s XML configuration file located at ''​[your_install_dir]/​conf/​lslbd_config.xml'',​ default value is ''/​tmp/​lslbd/​swap''​. Search for ''<​swappingDir>''​. \\ \\ If you still have problem with installation,​ please post your problem on our support Forum. ​
  
-Below are 2 methods of testing ​that LiteSpeed Web ADC is configured correctly and working. We will again be assuming 2 web servers with LiteSpeed Web ADC handling HTTP requests to a web site hosted on both of these servers, but these tests can me modified to test other applications of LiteSpeed Web ADC as well. +===== Upgrade ===== 
- +There are a few scenarios ​that you need to update ​the server ​software ​or license.
-For both tests: Run your servers in an isolated environment (no outside traffic) and make a small but noticeable change to the home page of one of your web servers. +
- +
-** Test 1: Disabling One Of Two Web Servers** +
- +
-Aside from balancing your servers traffic as to not cause a crash, one of the main features of a load balancer is to appropriately redirect traffic to an available server if one should experience a failure. With two servers running this is an easy thing to check. +
- +
-To begin, visit your site through a browser and make note of which server ​you are being directed to with respect ​to the small change you made earlier, we will call this server ​"​Server 1". If your "​Mode"​ is set to "​Stateful"​ under "Load Balancer Definition"​ in Configuration >> Clusters >> < your_HTTP_cluster >, then this server (Server 1) will be the preferred server for LiteSpeed Web ADC to direct your IP address to. This is also known as "​Session Affinity"​. +
- +
-Now that we know which server you are being directed to, either stop Server 1 or change Server 1's port to a number LiteSpeed Web ADC is not aware of and restart it to have this change take affect. If everything is working correctly, the next time you attempt to visit your site, LiteSpeed Web ADC will instead redirect your request to Server 2, which you can again confirm with respect to the small change made earlier. +
- +
-**Test 2: Round Robin** +
- +
-From the LiteSpeed Web ADC WebAdmin Console, navigate to Configuration >> Clusters. Select the cluster you are using to direct HTTP traffic to your site, in our cause this is "​clusterXYZ"​. Click "​Edit"​ at the top right of the "Load Balancer Definition"​ section. +
- +
-Change "​Mode"​ to "​Stateless"​ and "​Strategy"​ to "Round Robin"+
  
-{{ :​litespeed_wiki:​lslb-test2-cluster.png?direct 800px |}}+  * A new release is available 
 +  * Upgrade from a trial license to production license 
 +  * Upgrade production license from an N worker processes to a M worker process license.
  
-Click "​Save"​ at the top right.+The built-in update agent will check new release periodically and automatically download new package and send email notification about the new release. Server upgrade can be performed via the web admin interface by clicking the upgrade link in the version management page
  
-By choosing "​Stateless"​, you have told LiteSpeed Web ADC to ignore ​"Session Affinity" ​for this clusterMeaning that you are equally likely ​to be sent to Server 1 or Server 2 on an HTTP request for your site. By choosing "Round Robin"you have told LiteSpeed Web ADC to rotate back and forth between Server 1 and Server 2 when receiving HTTP requests for your site.+For license upgrade, you can manually copy "serial.no" ​and "​license.key" ​to ''​[your_install_dir]/​conf/''​ directory then restartit is recommended ​to backup ​your old license key first.
  
-Perform a "Graceful Restart" ​of LSLB.+===== Version Management ===== 
 +Multiple versions of LiteSpeed Load Balancer can be installed and easily switched from one to another by using the version management utility provided ''​[your_install_dir]/​admin/​misc/​mgr_ver.sh''​. 
 +  * To switch to version A, for example 1.0, just run ''​[your_install_dir_current_version]/​admin/​misc/​mgr_ver.sh 1.0''​ 
 +  * To remove previous installed files for version A, for example 1.0, just run ''​[your_install_dir_current_version]/​admin/​misc/​mgr_ver.sh -d 1.0''​ 
 +Version management is also available from WebAdmin interface under "Service Manager - Server - Version Management". It will list all the installed versions and available new releases. You can install new release or switch between different versions by just a click.
  
-{{ :​litespeed_wiki:​lslb-gracefulrestart3.png?​direct&​800 |}}+===== Uninstall ===== 
 +Simply run ''​[your_install_dir]/​admin/​misc/​uninstall.sh''​ and follow the instructions on the screen.
  
-Because of possible browser caching, this next part is best done through ​the terminal.+The following questions will be asked: 
 +  * Whether to keep the log directory 
 +  * Whether to keep the configuration directory
  
-Use the following terminal command to request your web page. For this example our domain name is ''​yoursitename.com''​, replace this with your own domain name or the IP address and port of your LSLB server.+All the directories that are not created by the Installer will not be touched, even they are under ''​[your_install_dir]''​. But all the files created by the Installer will be removed.
  
-  curl -i yoursitename.com +''​[your_install_dir]''​ will be removed as well if it is empty.
-or +
-  curl -i 192.168.0.10:​80 +
-   +
-Run this command a few times to check if LiteSpeed Web ADC is correctly swapping back and forth between Server 1 and Server 2 by checking for the small change made earlier. The output should be similar to Server 1 -> Server 2 -> Server 1 -> Server 2... and so on+
  
-Note: It is recommended to set "​Mode"​ and "​Strategy"​ back to your previous settings when done performing this test. The default settings are "​Stateful"​ and "Least Load" respectively. 
  • Admin
  • Last modified: 2020/11/18 15:31
  • by Lisa Clarke