DEV Community

AntDB
AntDB

Posted on

AntDB Installation and Deployment Documentation - P2

Linux Environment Configuration

This section describes the configuration of the Linux system before installing AntDB, including user creation, dependency installation, and system parameter adjustment.
User Configuration
New User Creation
Create a new normal user, such as uatadb, on all hosts where AntDB is to be installed (or use an existing normal user). New user reference example.

useradd -d /home/uatadb uatadb 
passwd uatadb 
Enter fullscreen mode Exit fullscreen mode

Configure the user limit parameters
Edit the /etc/security/limits.conf file and configure the

antdb user parameters.
antdb soft nproc 65536 
antdb hard nproc 65536 
antdb soft nofile 278528 
antdb hard nofile 278528 
antdb soft stack unlimited 
antdb soft core unlimited 
antdb hard core unlimited 
antdb soft memlock 250000000 
antdb hard memlock 250000000 
Enter fullscreen mode Exit fullscreen mode

After saving the file, execute su - antdb to switch to antdb user and execute ulimit -a to check if it takes effect.
Configure user sudo privileges
If security allows, it is recommended to add sudo privileges to the antdb user. Execute visudo for the root user to edit the interface, find the line where Allow root to run any commands anywhere, and add below the line.

antdb ALL=(ALL) ALL 
Enter fullscreen mode Exit fullscreen mode

Save the file and exit. su - antdb Switch to the antdb user and execute sudo id. Expect to be prompted for the user password and the output will be:

uid=0(root) gid=0(root) groups=0(root) 
Enter fullscreen mode Exit fullscreen mode

indicates that sudo privileges were added successfully.
System parameter adjustment
Turn off the firewall
Use the centos 7 operating system as an example:

  1. Disable the firewall service.
systemctl stop firewalld.service 
Enter fullscreen mode Exit fullscreen mode
  1. Disable the firewall self-start service.
systemctl disable firewalld.service 
Enter fullscreen mode Exit fullscreen mode
  1. Check the firewall status.
systemctl status firewalld.service 
Enter fullscreen mode Exit fullscreen mode

Shut down numa and tuned
Take redhat/centos 7 system as an example.

  1. Shut down numa.
grubby --update-kernel=ALL --args="numa=off " #this command modifies the following file: 
/etc/grub2.cfg 
grub2-mkconfig 
Enter fullscreen mode Exit fullscreen mode
  1. Shut down the tuned service.
systemctl stop tuned 
systemctl disable tuned 
Enter fullscreen mode Exit fullscreen mode
  1. Reboot the host after the changes in this way take effect.
reboot 
Enter fullscreen mode Exit fullscreen mode
  1. Verify the cmdline of grub after rebooting.
cat /proc/cmdline 
Enter fullscreen mode Exit fullscreen mode
  1. Check numa
numactl --hardware 
Enter fullscreen mode Exit fullscreen mode

The expected result is: Available: 1 nodes (0)
Turn off Transparent Huge Pages
The use of Transparent Huge Pages (THP for short) can cause performance problems, so it is recommended to turn them off.

  1. Check the on status of Transparent Huge Pages.
cat /sys/kernel/mm/transparent_hugepage/enabled 
Enter fullscreen mode Exit fullscreen mode

If the result is [always] madvise never, then Transparent Huge Pages is on and needs to be turned off; if the result is always madvise [never], then Transparent Huge Pages is off and this step is skipped; 2. Turn off Transparent Huge Pages.

echo never > /sys/kernel/mm/transparent_hugepage/enabled 
echo never > /sys/kernel/mm/transparent_hugepage/defrag checks the on status of Transparent Huge Pages 
Enter fullscreen mode Exit fullscreen mode
  1. Check again that the Transparent Big Page is on.
cat /sys/kernel/mm/transparent_hugepage/enabled 
Enter fullscreen mode Exit fullscreen mode

Configure sysctl.conf

  1. Modify the sysctl.conf file.
cat >> /etc/sysctl.conf << EOF 
# add for antdb 
kernel.shmmax=137438953472 137438953472 
kernel.shmall=53689091 
kernel.shmmni=4096 
kernel.msgmnb=4203520 
kernel.msgmax=65536 
kernel.msgmni=32768 
kernel.sem=501000 641280000 501000 12800 
fs.aio-max-nr=6553600 
fs.file-max=26289810 
net.core.rmem_default=8388608 
net.core.rmem_max=16777216 
net.core.wmem_default=8388608 
net.core.wmem_max=16777216 
net.core.netdev_max_backlog=262144 
net.core.somaxconn= 65535 
net.ipv4.tcp_rmem=8192 87380 16777216 
net.ipv4.tcp_wmem=8192 65536 16777216 
net.ipv4.tcp_max_syn_backlog=262144 
net.ipv4.tcp_keepalive_time=180 
net.ipv4.tcp_keepalive_intvl=10 
net.ipv4.tcp_keepalive_probes=3 
net.ipv4.tcp_fin_timeout=1 
net.ipv4.tcp_synack_retries=1 
net.ipv4.tcp_syn_retries=1 
net.ipv4.tcp_syncookies=1 
net.ipv4.tcp_timestamps=1 
net.ipv4.tcp_tw_recycle=1 
net.ipv4.tcp_tw_reuse=1 
net.ipv4.tcp_max_tw_buckets=256000 
net.ipv4.tcp_retries1=2 
net.ipv4.tcp_retries2=3 
vm.dirty_background_ratio=5 
vm.dirty_expire_centisecs=6000 
vm.dirty_writeback_centisecs=500 
vm.dirty_ratio=20 
vm.overcommit_memory=0 
vm.overcommit_ratio= 120 
vm.vfs_cache_pressure = 100 
vm.swappiness=10 
vm.drop_caches = 2 
vm.min_free_kbytes = 2048000 
vm.zone_reclaim_mode=0 
kernel.core_uses_pid=1 
kernel.core_pattern= /data/antdb/core/core-%e-%p-%s-%t 
fs.suid_dumpable=1 
kernel.sysrq=0 
EOF 
Enter fullscreen mode Exit fullscreen mode

The path of kernel.core_pattern needs to be modified according to the actual environment information. 2. execute the following command to make the above parameters effective.

sysctl -p 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)