{question}
What are memsqld and memsqld_safe processes in the output of the ps command?
{question}
{answer}
The two following two processes are created by SingleStore when deployed.
- memsqld
- memsqld_safe
Thememsqld
is launched by memsqld_safe
. The memsqld_safe
watches if memsqld
is running and, if not, It launches a new memsqld
process. memsqld_safe
is the PID, while memsqld
is the DPID.
$ ps aux | grep memsqld
memsql 6656 0.0 0.0 379536 7216 ? Ssl 10:18 0:00 /opt/singlestoredb-server-7.3.16-8d9c1b9863/memsqld_safe --defaults-file /ebs/memsql/master-3306-MI93e7c912/memsql.cnf --user 999 --auto-restart StagedEnable
memsql 6664 5.1 1.6 3168864 268112 ? Sl 10:18 0:44 /opt/singlestoredb-server-7.3.16-8d9c1b9863/memsqld --defaults-file /ebs/memsql/master-3306-MI93e7c912/memsql.cnf --user 999
memsql 6667 0.0 0.4 294220 75856 ? Ssl 10:18 0:00 /opt/singlestoredb-server-7.3.16-8d9c1b9863/memsqld --defaults-file /ebs/memsql/master-3306-MI93e7c912/memsql.cnf --user 999
admin 7269 0.0 0.0 12700 1968 pts/0 S+ 10:32 0:00 grep --color -s memsqld
We can see both PID and DPID using sdb-admin describe-node
:
| pid | 6656 |
| dpid | 6664 |
$ sdb-admin describe-node --memsql-id 0CD5F33E04AF14874F0E019AD368CF7F0A5BD72E
+--------------------+---------------------------------------------------------------------------------+
| memsqlId | 0CD5F33E04AF14874F0E019AD368CF7F0A5BD72E |
| host | 10.0.0.132 |
| role | Master |
| port | 3306 |
| bindAddress | 0.0.0.0 |
| processState | Running |
| version | 7.3.16 |
| memsqlConfig | /ebs/memsql/master-3306-MI93e7c912/memsql.cnf |
| datadir | /ebs/memsql/master-3306-MI93e7c912/data |
| plancachedir | /ebs/memsql/master-3306-MI93e7c912/plancache |
| tracelogsdir | /ebs/memsql/master-3306-MI93e7c912/tracelogs |
| auditlogsdir | /ebs/memsql/master-3306-MI93e7c912/auditlogs |
| memsqld | /opt/singlestoredb-server-7.3.16-8d9c1b9863/memsqld |
| nodeID | 1 |
| pid | 6656 |
| dpid | 6664 |
| autoRestartEnabled | true |
| isConnectable | true |
| recoveryState | Online |
| availabilityGroup | -- |
| config | Omitted from table view. Use 'sdb-admin describe-node ... --property config' |
| variables | Omitted from table view. Use 'sdb-admin describe-node ... --property variables' |
+--------------------+---------------------------------------------------------------------------------+
Both memsqld_safe.pid
and memsqld.pid
files will be located under the data
directory of any given node.
/ebs/memsql/master-3306-MI93e7c912/data $ ls -lrt memsqld*
-rw-r--r-- 1 memsql 4 Nov 2 10:18 memsqld_safe.pid
-rw-r--r-- 1 memsql 4 Nov 2 10:18 memsqld.pid
{answer}