Connect to the Database (for troubleshooting or verification)
In case there are log errors related to the Local Database (CouchDB) you may need to connect to it directly.
Follow these steps:
-
Open a browser locally on the Gateway Server. Default URL to reach a Local Database that has not been enabled for Clustering, and is not externally accessible, is http://localhost:5984/_utils/
-
If the Gateway is running Cluster Setup, change this URL to the correct name used by the certificate and HTTPS, and change the port to 6984, https://psmg01.pointsharp.id:6984/_utils/
-
Login in to the website presented by using the Credentials set in the Database configuration.
-
All current databases are displayed in the Database section in the top left corner. The one named ps is the Local Database itself. The psgrevision is the database for the Cluster configuration.
Recreate the Local Database
If there are issues with the Local Database (for example, CouchDB errors are displayed in the log), you may need to delete the ps database. The database contains the user sessions, but will automatically be recreated when next request reaches the Gateway Server.
Take note though that when deleting this database, the current session will be lost, and users depending on what resources are used, may need to login again.
| Consult Pointsharp Support Team first, before any deletions or changes are made in the CouchDB itself, to make sure this is needed. |
CouchDB management
CouchDB does not support management with Internet Explorer, but any other browser should work fine.
To check if the databases exist, run the following in powershell.
$ Invoke-RestMethod -Method 'Get' -Uri 'http://127.0.0.1:5984/_all_dbs'
If only the ps database exists, run the following in powershell to create the other ones:
$ Invoke-WebRequest http://localhost:5984/_users -Method “PUT”
$ Invoke-WebRequest http://localhost:5984/_replicator -Method “PUT”
$ Invoke-WebRequest http://localhost:5984/_global_changes -Method “PUT”
Disable logging
CouchDB logs a lot and this can be disabled (from version 5.0 of Pointsharp Access Gateway this will be disabled by default).
| Please note that local.ini might exist in several folders, only change in the correct path. |
Check if local.ini exists in:
[Installed location]:\CouchDB\etc\local.d
If local.ini exists
Backup the file and then paste the following to the end of the file.
; CouchDB Custom Default Configuration Settings
[log]
level = none
If local.ini doesn’t exist
Download and copy to the folder:
[Installed location]:\CouchDB\etc\local.d
Restart the CouchDB service.
More information about CouchDB can be found on the CouchDB website.