Creating the User Environment
Create a new Tungsten user that will be used to manage and install the Tungsten software. The recommended choice for MySQL installations is
to create a new user, tungsten. You will need to create this user on each host. You can create the new user using
adduser:
shell> sudo adduser tungsten
You can add the user to the mysql group adding the command-line option:
shell> sudo usermod -G mysql -a tungsten
Login as the tungsten user:
shell> su - tungsten
Optionally, create an SSH key file, but do not configure a password:
tungsten:shell> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/tungsten/.ssh/id_rsa):
Created directory '/home/tungsten/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/tungsten/.ssh/id_rsa.
Your public key has been saved in /home/tungsten/.ssh/id_rsa.pub.
The key fingerprint is:
e3:fa:e9:7a:9d:d9:3d:81:36:63:85:cb:a6:f8:41:3b tungsten@staging
The key's randomart image is:
+--[ RSA 2048]----+
| |
| |
| . |
| . . |
| S .. + |
| . o .X . |
| .oEO + . |
| .o.=o. o |
| o=+.. . |
+-----------------+
This creates both a public and private keyfile; the public keyfile can then be shared with all hosts in the deployment.
See "SSH Configuration" for steps.
For Tungsten to work correctly, the tungsten user must be able to open a larger number of files/sockets for communication between the
different components and processes. You can check this by using ulimit:
shell> ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 256
pipe size (512 bytes, -p) 1
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 709
virtual memory (kbytes, -v) unlimited
The system should be configured to allow a minimum of 65535 open files. You should configure both the tungsten user and the database user
with this limit by editing the /etc/security/limits.conf file:
tungsten - nofile 65535
mysql - nofile 65535
In addition, the number of running processes supported should be increased to ensure that there are no restrictions on the running processes or threads:
tungsten - nproc 8096
mysql - nproc 8096
You must logout and log back in again for the ulimit changes to take effect.
You may also need to set the limit settings on the specific service if your operating system uses the systemctl service management framework.
To configure your file limits for the specific service:
Copy the MySQL service configuration file template to the configuration directory if it does not already exist:
shell> sudo cp /lib/systemd/system/mysql.service /etc/systemd/system/NotePlease note that the filename
mysql.servicewill vary based on multiple factors. Do check to be sure you are using the correct file. For example, in some cases the filename would bemysqld.serviceEdit the proper file used above, and append to or edit the existing entry to ensure the value of
infinityfor the keyLimitNOFILE:LimitNOFILE=infinityThis configures an unlimited number of open files, you can also specify a number, for example:
LimitNOFILE=65535Reload the
systemctldaemon configuration:shell> sudo systemctl daemon-reloadNow restart the MySQL service:
shell> service mysql restart
On Debian/Ubuntu hosts, limits are not inherited when using su/sudo. This may lead to problems when remotely starting or
restarting services. To resolve this issue, uncomment the following line within /etc/pam.d/su:
session required pam_limits.so
Integration with AppArmor
Make sure that Apparmor, if configured, has been enabled to support access to the /tmp directory for the MySQL processes. For example,
add the following to the MySQL configuration file (usually /etc/apparmor.d/local/usr.sbin.mysqld):
/tmp/** rwk