The unix_socket_directories system parameter is a configuration parameter specifying the file system directories for the PostgreSQL server to store its Unix domain sockets
YugabyteDB also uses this parameter.
The default value for unix_socket_directories is /tmp.
Example:
[root@localhost ~]# alias y
alias y='ysqlsh -h yugabytedb.tech -U yugabyte'
[root@localhost ~]# y -c "SHOW unix_socket_directories;"
unix_socket_directories
-------------------------------
/tmp/.yb.yugabytedb.tech:5433
(1 row)
In PostgreSQL we can change the default value of unix_socket_directories by editing the postgresql.conf file then restarting PostgresSQL.
That doesn’t work with YugabyteDB.
But starting in YB 2.19.0, we can alter the default value of unix_socket_directories via the tmp_dir T-Server gFlag!
In the above example, we changed the default value of unix_socket_directories from /tmp to /root/jim/tmp. Make sure that the new directory exists and is writable by the YugabyteDB process before setting the gFlag.