I am trying to get amplify to monitor mysql database on ubuntu server 20.04 running on a raspberry pi 4. I am sure I have set everything up correctly and have crossreferenced my work with many internet guides. However, mysql does not appear in the nginx amplify web interface after setting things up. My logs show the following errors:
2022-08-08 10:32:41,134 [1824839] supervisor ps nginx output: [' 2074 1 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf', '1740162 2074 nginx: worker process', '1740163 2074 nginx: worker process', '1740165 2074 nginx: worker process', '1740166 2074 nginx: worker process', '1740168 2074 nginx: cache manager process', '']
2022-08-08 10:32:41,161 [1824839] supervisor nginx objects: ['5057a79cf47c63d99f326ae55fea2c99bc0e2dcfd6bc5cdc5492d770f0a55284']
2022-08-08 10:32:41,162 [1824839] supervisor status objects: []
2022-08-08 10:32:41,162 [1824839] supervisor api objects: []
2022-08-08 10:32:41,228 [1824839] supervisor failed to find running mysqld via "ps xao pid,ppid,command | grep -E 'mysqld( |$)'" due to AmplifySubprocessError
2022-08-08 10:32:41,228 [1824839] supervisor additional info:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/amplify/ext/mysql/managers.py", line 154, in _find_local
ps, _ = (ps, None) if ps is not None else subp.call(PS_CMD)
File "/usr/lib/python3/dist-packages/amplify/agent/common/util/subp.py", line 34, in call
raise AmplifySubprocessError(message=command, payload=dict(returncode=process.returncode, error=raw_err))
amplify.agent.common.errors.AmplifySubprocessError: (message=ps xao pid,ppid,command | grep -E 'mysqld( |$)', payload={'returncode': 1, 'error': ''})
2022-08-08 10:32:41,229 [1824839] supervisor mysql objects: []
Does anyone understand these errors and could you help me fix this to get mariaDB showing up on Nginx Amplify?
The mariadb daemon is called 'mariadbd' and amplify-agent is looking for 'mysqld'.
If you run
Then the line starting with 'loaded' should have the location of the service file
In this case it is '/lib/systemd/system/mariadb.service'. Open the file in a text editor and find the line starting
Then change the path from pointing to 'mariadbd' to 'mysqld'. Then you need to reload the daemon and restart the services.
The agent should now be able to find the process.