Cannot access any SharePoint sites and Central Administration

I am running SharePoint Server 2016 on two separate servers: one application server and one database server. I have created a number of sites in a site-collection. Recently today, I am not able to access these sites as well as the Central Administration. I have not made any configuration changes to the servers since this happened. I received the below error message:

This operation can be performed only on a computer that is joined to a server farm by users who have permissions in SQL Server to read from the configuration database. To connect this server to the server farm, use the SharePoint Products Configuration Wizard, located on the Start menu in Microsoft SharePoint 2016 Products.

I tried the below solutions which I found on the internet with no luck:

  • Restarted both SQL Server (MSSQLSERVER) and SQL Server Agent (MSSQLSERVER) services (they were already running before I restarted them).
  • I checked the domain accounts which some SQL Server services and SharePoint services run as and found that the current password is still valid (these account passwords have been set to never expire in Active Directory).
  • I restarted the SharePoint application server and the database server with no luck.

What could be the cause of the above error message?