Customizing Installs
Predefined Installs
By default, lxinst installs components to exploit the machine(s) used
for the install.
It is possible to perform small installs using flag -s like in
unix$ lxinst -s /usr/local/leanxcale
And, it is possible to perform medium size installs using flag -m, as in
unix$ lxinst -m /usr/local/leanxcale
A small install limits the number of kvds to 4, and
per-component memory to 1GiB.
A medium install limits the number of kvds to 8, but does not limit
per-component memory and tries to use the default allocation policy.
Custom Install Configurations
Installs are configured using a file that describes the hosts and components installed. The file may include properties for the whole installation, or for individual hosts and components.
To perform custom installations, use a configuration file. You can fine-tune your installation in order to adapt the default installation to your needs, resources, and requirements.
The configuration file describes hosts and components installed.
To install using a configuration file, use the lxinst flag -f to
use it, as in:
unix$ lxinst -f myinstall.conf
Configuration File
The configuration file has an initial section describing global properties, then a series of hosts each one including a series of properties and a series of components with properties.
The file consists of plain text lines. The character # can be
used to add comments (the rest of the line is ignored). Each line
declares a property, perhaps with a value, or starts a host or component
declaration.
Lines declaring hosts start with host, those declaring components
start with a component type name. All other lines declare properties.
A host configuration starts using the host keyword and the name for
the host (which usually is the host name used to reach the host on the
network). It is recommended to use the host name instead of using
localhost.
A property is declared with a single line with the property name, then blanks, and then the property value. If the property has no value, it is considered as a boolean and it is set to true.
Properties declared before the first host declaration are global, and may be overridden later by properties defined within a host or component.
All declarations after a host declaration are defined for that host, until another host declaration is found.
All properties defined a component declaration, before another one is declared, are defined for that component.
Those required components and properties not specified by the user are added by the install program with default values.
Variables HOME and USER may be used when defining properties.
The variable LXDIR may be used as well and refers to the install
(or disk) directory for the host or component.
A component may be repeated adding the option x N to specify how
many instances are wanted. When not used, each component declared stands
for a single component, but many of the same type can be added for
components like kvds.
For docker installs, specify docker before the first host.
For example, when installing at the host named atlantis, this can be
a configuration file:
# global properties
lxdir $HOME/leanxcale
# one host
host atlantis
# one component
lxqe
# properties for this component
addr atlantis!3444
mem 2G
# another component kvds with 4 instances
kvds x 4
mem 1G
In this file, the property lxdir (leanXcale install directory) is
defined as a global property, and applies to all hosts defined.
Then, a single host (atlantis) is defined. When no host is
configured, localhost is used as the default.
For the configured host, two of the required components are configured:
-
For the
lxqecomponent, the network address for the service is given (host name and port), and the memory size is set to 2GiB (Gibibyte, i.e. 1024 MiB). -
For the
kvdscomponent, four instances are configured (x 4), each one with 1GiB of memory.
Note that components required (e.g. lxmeta) but not specified are
added by the install program itself.
Docker configuration files
For a docker installation, specify docker and try not to specify specific paths or hostnames for the installed system. For example:
docker
host lx1
kvds x2
Custom Memory Allocation
The installer has a default memory split allocation among components. To
specify the memory size for the lxqe and kvds components we can
include them in the configuration file and include the mem attribute
for them, as done here:
host atlantis
lxqe
mem 4G
kvds x4
mem 1G
It is suggested not to use more memory in total than the physical memory available on the system (minus the one used by the operating system and leaving a small amount unused for safety).
We suggest to give half the memory to the lxqe component and the
other half to all the kvds components (evenly distributed).
Note that by default the install tries to use available memory, unless a small or medium install was selected.
Custom Disk Allocation
To specify the maximum disk size for the disk usage, specify it for the
components using a significant space on disk (most notably kvds for
table storage, and lxqe for the transactional log). For example:
host atlantis
lxqe
disk 100G
kvds x4
disk 100G
Custom Query Engine Ports
The network address (including port) used by the query engine to listen
for client connections is 14420. To use another port, specify the
network address for the lxqe component:
host atlantis
lxqe
addr atlantis!3000
But it may be easier to move the base port address used to a range other
than 14000. This can be done defining the global (or host) property
baseport, as done here:
host atlantis
baseport 10000
Refer to the [LeanXcale Components and Ports] section for more details regarding network port usage.
Custom Optional Components: OpenDATA and Monitoring
To install optional components, specify them in the configuration file. It is customary to add them on the first host installed. For example:
host atlantis
stats
odata
adds both stats and odata to the installation. As they are
optional components, they are never installed by default.
The OpenDATA port is usually 14004 unless configured otherwise.
The default user and password for the stats web page is lxadmin.
Other Configuration Options
Here we provide more details on configuration files.
This property defines the directory used by the install, and relies on
the HOME environment variable on each host involved:
lxdir $HOME/xamplelx
To use a host just for stats, without any DB component, use only as
the value for the stats property:
host atlantis
# run stats here using other hosts for DB components
stats only
To include a web interface in your install, add web as a property
for the host. The server port is 5000. For example:
host atlantis
# this enables a web server
web
In some cases it is desirable to install one host with just the lx
command, to operate the rest of the hosts installed (perhaps just during
the install process). For example, when installing from a laptop and
wanting to have the lx command installed at the laptop to operate a
set of hosts being installed.
This can be done adding the nodb attribute to a host. For example:
# localhost is just to run lx cmds w/o db components
host localhost
lxdir $HOME/xamplelx
nodb
# installed host
host atlantis
...
Specific ssh and scp commands may be given to reach the installed
hosts. Should the installed hosts use different ssh and scp command
to reach each other, properties sshi and scpi can be used to given
them.
This is an example:
host atlantis
# from the current location:
ssh "ssh leandata@lsdclus04.ls.fi.upm.es -p 22124"
scp "scp -P 22124 {src} {user}@lsdclus04.ls.fi.upm.es:{dst}"
# ssh/scp to be used within the installed hosts
sshi "ssh {user}@{host}"
scpi "scp {src} {user}@{host}:{dst}"
Replication
Hosts may be replicated, but either all hosts must have replicas or none
of them. To define a replica for a host, add another host and define
mirror for it using the replicated host name as the property value.
For example:
host blade120
host blade121
host atlantis
mirror blade120
host blade125
mirror blade121
configures a system with two replicated hosts. That is, four hosts where two ones are a mirror of the other two ones.
In replicated configurations, the set of initial hosts is designated as the first replica (or replica-1) and the mirror hosts are known as the second replica.
Component names in this case include a final .r1 or .r2 to
reflect the replica they belong to. For example, kvds100.r1 is
likely to be a component in this configuration.
AWS Options
When using a configuration file, just define the property aws before
anything. You can specify the region, instance type, disk size, and AWS tag.
The disk size is in GiB.
The tag is a string and should not include blanks.
For example, using this file:
#cfgfile aws.conf aws awstype m5.large awsregion us-east-1 awsdisk 100 host lx1
you can run:
unix$ lxinst -K key -f aws.conf
This can be done also using the command line:
unix$ lxinst -K xkey aws awsregion us-east-1 awstype m5.large awsdisk 100
The partition mounted at /usr/local/leanxcale for the DB storage is
30GiB by default. You can change this using the aswdisk property. It
is formatted using a compressed ZFS.
In the installed system, the user running the DB is lx, and
LeanXcale is added to the UNIX system as a standard (disabled) systemd
service. The instance is left running. You can stop it on your own if
that is not desired.
To install multiple instances, install using multiple host names:
unix$ lxinst -K key aws lx1 lx2
install #cfgfile: argv aws lx1 lx2...
...
aws instance i-03c781120293253fd IP 54.159.42.233
setup instance #1...
...
aws instance i-0d2b2403b2d1e25e1 IP 3.89.224.85
setup instance #2...
...
install done
created lxinst.uninstall
#To dial the instances:
ssh -o StrictHostKeyChecking=no -i lxinst.pem lx@18.212.188.66
ssh -o StrictHostKeyChecking=no -i lxinst.pem lx@100.24.60.220
By default, private IP addresses for hosts are in 10.0.120.0/24.
To use a different network, keep 10.0 and pick your own 3rd byte as in
unix$ lxinst -K xkey aws awsnet 10.0.130