We recently setup the thinlinc HA and cluster to test the failover and loadbalancing. The vsmserver.hconf on 1 node looks like
# cat /opt/thinlinc/etc/conf.d/vsmserver.hconf # -*- mode: conf-unix; -*- # Hiveconf configuration file - VSM server # [/vsmserver] # Administrators email admin_email=root@localhost # # Terminal servers. A space-separated list of agent server hostnames. These will # be used for communication between the server and the agent. The names reported # to clients are fetched from the agent itself; names in terminalservers are not # reported directly to clients. # terminalservers=thinlinc01.abc.com # Load balance finetuning ram_per_user=100 bogomips_per_user=600 existing_users_weight=4 load_update_cycle=40 # The maximum number of sessions per user. 0 means no limit. max_sessions_per_user=4 # Only allow connections from clients in this space-separated list for priv # operations localhost and hostname IP are always allowed. allowed_clients= # ThinLinc access can be limited to certain groups. If the allowed_groups # space-separated list is empty, all users are accepted. Otherwise, the user # must be a member of the groups listed below, to be able to use ThinLinc. # Example: allowed_groups=students teachers allowed_groups= # If true, processes occupying the users interval of forwarded ports # will be killed. unbind_ports_at_login=true # A space-separated list of candidate:agenthost pairs that can be used to force # sessions for specific users or groups to be created on specific agent hosts. # Note that only one server can be specified per candidate. No load # balancing is in use for servers selected this way. # # If the specific server is down, no session will be created. # # If a server specified here is also listed in terminalservers, # sessions will also be created for users or groups not listed here. # Use of this parameter is recommended only for special circumstances, # for example when testing new operating systems. # # Groupnames should be prepended by a '+'. Example: # explicit_agentselection=+agentoneusers:agentone explicit_agentselection= # Port to listen on # This should normally be the same as /vsm/vsm_server_port, but under # some special circumstances, it might be set to another value. listen_port=9000 [/vsmserver/subcluster/default] agents=thinlinc01.abc.com thinlinc02.abc.com [/vsmserver/HA] # Enable HA operations by setting this to 1. enabled=1 # A space-separated list of the nodes in the cluster nodes=thinlinc01.abc.com thinlinc02.abc.com
and vmsagent.conf looks like -
[/vsmagent] # The host that runs the VSM server (master machine) master_hostname=thinlinc.abc.com (resource IP) # Only allow connections from the VSM servers in this space-separated list. # localhost, hostname, IP and master_hostname are always allowed. NOTE: Do not # change this parameter unless you know what you are doing. allowed_clients= # Automatically create the users home directory, if it doesn't exist? make_homedir=1 # The file mode for the newly created home directory make_homedir_mode=0700 # The default geometry, if the client doesn't request anything. default_geometry=1024 768 # Save password for future logins? single_signon=1 # Extra arguments to pass to the Xserver Xvnc, for example: # xserver_args=-MaxIdleTime 60 xserver_args=-br -localhost -verbose 3 # The location of the Xauthority file, either homedir or sessiondir xauthority_location=sessiondir # Public hostname; the hostname that clients are redirected to. If not # defined, the agent will use the computer's IP address. agent_hostname= # The maximum port used for VNC and tunnel ports for displays # display_min to display_max. This number may not be higher than # lowest_user_port max_session_port=32767 # The lowest port to be used for user programs needing TCP/UDP ports. # This must be higher than max_session_port. lowest_user_port=32768 # Where to start allocating display numbers. display_min=10 # Timeout in tenths of seconds, for starting new sessions xvnc_start_timeout=250 # The maximum display number to use on this VSM agent host. # display_max - display_min is the maximum number of ThinLinc users # allowed on this host. Default is 2000. display_max=2000 # Port to listen on # This should normally be the same as /vsm/vsm_agent_port, but under # some special circumstances, it might be set to another value. listen_port=904 # Environment variables to add to users environment, before running # xstartup. Note: Since xstartup is run through /bin/bash --login, # files in /etc/profile.d/ will be sourced and may override values in # default_environment. # Note: TOWN is just an example.
The same configuration is there in other node too. My both the nodes are running vsmserver and vsmagent and i have setup HA and cluster within them. And i have configured the keepalived
So, when user tries to connect to resource IP - then the session is always created on master thinlinc01.abc.com. I was expecting my sessions to get created on
thinlinc02.abc.com and load being distributed but sadly that is not happening.
Can you please advise me if i am missing something ?
There is one more issue - when the session is created in the vsmserver logs where the session is created i can see
2023-08-14 12:15:49 DEBUG vsmserver.HA: Writing active HA changes to disk 2023-08-14 12:15:49 DEBUG vsmserver.HA: Done writing active HA changes 2023-08-14 12:15:49 DEBUG vsmserver.session: Writing active sessions to disk 2023-08-14 12:15:49 DEBUG vsmserver.session: Done writing sessions 2023-08-14 12:15:49 DEBUG vsmserver.HA: Successfully transferred session change (new,admintestaman/127.0.0.1:10) to other node 2023-08-14 12:15:49 DEBUG vsmserver.HA: Writing active HA changes to disk 2023-08-14 12:15:49 DEBUG vsmserver.HA: Done writing active HA changes
and on the other machine i see
2023-08-14 12:32:52 DEBUG vsmserver.session: User with uid 0 requested a socket 2023-08-14 12:33:10 DEBUG vsmserver.session: Doing periodic session verification 2023-08-14 12:35:57 DEBUG vsmserver.HA: Handling session change (new, admintestaman/127.0.0.1:10) 2023-08-14 12:35:57 DEBUG vsmserver.HA: Got (new,admintestaman) from other node. Updating my session database 2023-08-14 12:35:57 DEBUG vsmserver.session: Writing active sessions to disk 2023-08-14 12:35:57 DEBUG vsmserver.session: Done writing sessions
My doubt/concern is why its showing
127.0.0.1 IP - I was expecting it to display IP/hostname of the server instead.
Am i correct here ??
Now, since it says
127.0.0.1 - because of this , i can see a session is also created in slave
thinlinc02 server which IMO is not correct and after a while that session dies - and this info is then transfered to master node and then it also deletes its session - and because of this my original session dies.
Can you please point what i am missng here ?