Prepare the cluster machines.
Run the preparation procedures on all machines before installing TDP Datacenter.
Run the procedures below on all machines of the Big Data Cluster.
Required stages, in this order
Stage 2
Kernel parameters
Avoid using the swap area, change the RAM allocation, and disable Transparent Huge Pages.
Stages
- 1 · Firewall and SELinux
- 2 · Kernel parameters
- 3 · Time synchronization
Disable the firewall service and SELinux, and restart the machine.
First stage, required on each cluster machine: disabling the firewall service and SELinux. The firewall is stopped and disabled. SELinux is disabled both temporarily and permanently, and the permanent change only takes effect after the machine restarts.
firewalld service: stop and disable. If it cannot be disabled, create rules (iptables).
Temporary (setenforce) and permanent (/etc/selinux/config) disabling, with a machine restart.
Disable the Firewall service
firewalld stopped and disabled.
systemctl stop firewalld;
systemctl disable firewalld;
systemctl is-active firewalld
systemctl is-enabled firewalld
It worked when
firewalld appears as inactive and disabled: stopped and disabled.$ systemctl is-active firewalld
inactive
$ systemctl is-enabled firewalld
disabledIf the Firewall cannot be disabled
If the Firewall cannot be disabled, create rules (iptables) to allow communication between the machines on the ports used by the TDP Platform services.
Temporarily disable SELinux
SELinux disabled until the next restart.
setenforce 0;
getenforce
It worked when
Permissive: SELinux is disabled until the next restart.Permanently disable SELinux
SELinux configured as disabled.
sed -i --follow-symlinks "s+SELINUX=enforcing+SELINUX=disabled+g" /etc/selinux/config;
On RHEL 9 and derivatives, the SELINUX=disabled option in the file is not enough: SELinux stays enabled in the kernel, with no policy loaded. Also add the selinux=0 parameter to the kernel command line (requires the grubby package):
grubby --update-kernel ALL --args selinux=0
grep ^SELINUX= /etc/selinux/config
It worked when
SELINUX=disabled. The permanent change only takes effect after the machine restarts, in the next step.$ grep ^SELINUX= /etc/selinux/config
SELINUX=disabledRestart the machine
The permanent SELinux disabling in effect.
Restart the machine to apply the permanent SELinux disabling.
getenforce
It worked when
Disabled.$ getenforce
DisabledNext, go on to the kernel parameters.
Avoid using the swap area, change the RAM allocation, and disable Transparent Huge Pages.
Second stage, required on each machine: setting three kernel parameters, which are the use of the swap area, the default RAM allocation behavior, and Transparent Huge Pages (THP). The values of each parameter are in the table below, and the explanation of each one comes with its step.
vm.swappiness=1
vm.overcommit_memory=1
never, in enabled and defrag
Avoid using the swap area as much as possible
The kernel avoiding sending application memory to disk.
echo 'vm.swappiness=1' >> /etc/sysctl.conf;
sysctl -p /etc/sysctl.conf;
sysctl vm.swappiness
It worked when
vm.swappiness parameter shows the value set in the table above.$ sysctl vm.swappiness
vm.swappiness = 1The Linux kernel provides an adjustable setting that controls how often the disk swap area is used, called swappiness. Lowering the swappiness value reduces the likelihood that the Linux kernel sends an application's memory to the swap area. The swap area is far slower than memory, because it uses disk instead of RAM. When the memory area of processes is moved to disk, they may suffer pauses, which can cause problems in services such as Apache Zookeeper.
The disk is avoided unless absolutely necessary (when the server runs out of memory).
Programs use the swap area almost immediately.
Change the default RAM allocation behavior
The kernel serving memory requests without the heuristic approach.
echo 'vm.overcommit_memory=1' >> /etc/sysctl.conf;
sysctl -p /etc/sysctl.conf;
sysctl vm.overcommit_memory
It worked when
vm.overcommit_memory parameter shows the value set in the table above.$ sysctl vm.overcommit_memory
vm.overcommit_memory = 1In Big Data environments, where machines with large amounts of RAM are common, we recommend the value shown in the command above for the overcommit_memory setting.
Uses a heuristic approach to serve memory requests (malloc).
Assumes there is always enough physical memory, considerably improving the performance of memory-intensive tasks.
Disable Transparent Huge Pages (THP)
Transparent Huge Pages disabled.
echo never > /sys/kernel/mm/transparent_hugepage/enabled;
echo never > /sys/kernel/mm/transparent_hugepage/defrag;
echo "echo never > /sys/kernel/mm/transparent_hugepage/enabled" >> /etc/rc.local;
echo "echo never > /sys/kernel/mm/transparent_hugepage/defrag" >> /etc/rc.local;
cat /sys/kernel/mm/transparent_hugepage/enabled
It worked when
never option appears in brackets, the selected option. The same applies to the defrag file, in the same directory.Many Linux distributions offer THP as a low-complexity option to increase the size of memory blocks/pages and make it possible to manage many gigabytes, and even terabytes, of RAM. However, workloads in Big Data environments tend to perform poorly with THP enabled, because they tend to have sparse rather than contiguous memory access patterns, which overloads the CPU.
THP increases the size of memory blocks/pages from 4KB to 2MB or 1GB.
Next, go on to time synchronization.
Install and configure Chrony and check the synchronization status.
Third stage, required on each machine: installing a time synchronization service (NTP) to keep the date and time of the machines always synchronized and prevent inconsistencies in data and services. In this example, we use Chrony: install the service, configure the NTP servers, restart it, and check the synchronization status.
Chrony (chronyd)
/etc/chrony.conf
chronyc tracking and chronyc sources
Install Chrony
The chronyd service installed, enabled, and started.
yum install chrony -y
systemctl enable chronyd
systemctl start chronyd
systemctl is-active chronyd
systemctl is-enabled chronyd
It worked when
chronyd appears as active and enabled: started and enabled.$ systemctl is-active chronyd
active
$ systemctl is-enabled chronyd
enabledConfigure Chrony to synchronize with appropriate NTP servers
The NTP servers defined in the configuration file.
vi /etc/chrony.conf
# Add or adjust the NTP servers as needed
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
To save and exit the vi editor, press ESC, type :wq, and press Enter.
grep ^server /etc/chrony.conf
It worked when
server lines of the file list the NTP servers you defined.Restart the service to apply the new settings
Chrony using the configured servers.
systemctl restart chronyd
systemctl is-active chronyd
It worked when
chronyd appears as active again after the service restart.$ systemctl is-active chronyd
activeCheck the synchronization status
The machine's time synchronization state.
chronyc tracking
chronyc sources
It worked when
chronyc tracking shows the machine's synchronization state, and chronyc sources lists the time sources. The one marked with ^* is the one the machine uses to synchronize.$ chronyc tracking
Reference ID : 92A43042 (cortex.pads.ufrj.br)
Stratum : 2
Ref time (UTC) : Wed Aug 07 18:08:25 2024
System time : 0.000000526 seconds slow of NTP time
Last offset : +0.001021679 seconds
RMS offset : 0.001021679 seconds
Frequency : 501.882 ppm slow
Residual freq : +128.144 ppm
Skew : 2.026 ppm
Root delay : 0.036760874 seconds
Root dispersion : 0.003537497 seconds
Update interval : 1.0 seconds
Leap status : Normal
$ chronyc sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^+ lrtest2.ntp.ifsc.usp.br 2 6 17 12 +1552us[+1552us] +/- 20ms
^- a.st1.ntp.br 1 6 17 12 -1435us[-1435us] +/- 16ms
^- gps.nu.ntp.br 1 6 17 13 +604us[ +604us] +/- 14ms
^* cortex.pads.ufrj.br 1 6 17 14 +1043us[+2065us] +/- 20ms
^+ b.ntp.netplanety.com.br 2 6 17 14 +2778us[+3800us] +/- 49ms
^- sa-north-1.clearnet.pw 2 6 17 13 +2083us[+2083us] +/- 39ms
^- time.cloudflare.com 3 6 17 13 +11ms[ +11ms] +/- 74msNext steps
Next step
Installation Package Download
Download the TDP installation packages and their direct dependencies.
Previous step
Support Tools
Learn about the tools that can make the deployment and administration of the Big Data Cluster easier.