This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
wiki:advanced:multi-node:x2goserver-pgsql [2013/03/12 20:37] sunweaver |
wiki:advanced:multi-node:x2goserver-pgsql [2016/03/29 19:40] (current) stefanbaur [X2Go Server with PostgreSQL database backend] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== X2Go Server with PostgreSQL database backend ====== | ====== X2Go Server with PostgreSQL database backend ====== | ||
| - | **Note:** This wiki page explains how you can configure X2Go with PostgreSQL as database backend. However, this is only recommended for sites that run more than one X2Go Server (X2Go multi-node farms). | + | **Note:** This wiki page explains how you can configure X2Go with PostgreSQL as database backend. However, for small setups, this is unneccessary. If you have one standalone X2Go server and only a small number of users, then you can use the SQLite database backend (which is the default after installation of the '' |
| - | If you have one standalone X2Go server then please use the SQLite database backend (which is the default after installation of the '' | ||
| With X2Go Server v3.0.99.0 the whole session database backend code had been fully rewritten due to a serious security issue that had been brought up by Morty, Reinhard and Arw. Sind then, the '' | With X2Go Server v3.0.99.0 the whole session database backend code had been fully rewritten due to a serious security issue that had been brought up by Morty, Reinhard and Arw. Sind then, the '' | ||
| Line 13: | Line 12: | ||
| - | * configure PostgreSQL server to enable TCP connections from your X2go server | + | * configure PostgreSQL server to enable TCP connections from your X2Go Server |
| - | * configure PostgreSQL server for md5 authentication for users from x2goserver | + | * configure PostgreSQL server for md5 authentication for users from X2Go Server |
| < | < | ||
| Line 29: | Line 28: | ||
| You must create a database user which can create databases and users for | You must create a database user which can create databases and users for | ||
| - | X2go database administration. You can also use the '' | + | X2Go database administration. You can also use the '' |
| job. | job. | ||
| Line 87: | Line 86: | ||
| < | < | ||
| $ / | $ / | ||
| - | X2Go SQL admin interface. Use it to create | + | X2Go SQL admin interface. Use it to create |
| - | remove users or groups in x2go database | + | remove users or groups in X2Go session |
| Usage: | Usage: | ||
| x2godbadmin --createdb | x2godbadmin --createdb | ||
| Line 96: | Line 96: | ||
| </ | </ | ||
| - | ==== Create database (evoke on X2go server) ==== | + | ==== Create database (evoke on X2Go server) ==== |
| Line 114: | Line 114: | ||
| </ | </ | ||
| - | After that step users can create x2go sessions. | + | After that step users of the posix group '' |
| + | |||
| + | ===== Database Structure and Troubleshooting ===== | ||
| + | |||
| + | In hopefully rare cases it may become necessary to fix the X2Go session database via standard PostgreSQL tools (e.g. '' | ||
| + | |||
| + | ==== Connect to the database ==== | ||
| + | |||
| + | In case it becomes necessary to edit the X2Go session database on the PostgreSQL server by hand, connect to the DB with this command: | ||
| + | |||
| + | < | ||
| + | $ psql --user x2godbuser --password -h localhost --dbname x2go_sessions | ||
| + | </ | ||
| + | |||
| + | As password use the password found in ''/ | ||
| + | |||
| + | |||
| + | After successful login, the '' | ||
| + | |||
| + | < | ||
| + | ts-01:~ # psql --user x2godbuser --password -h localhost --dbname x2go_sessions | ||
| + | Password for user x2godbuser: < | ||
| + | Welcome to psql < | ||
| + | |||
| + | Type: \copyright for distribution terms | ||
| + | \h for help with SQL commands | ||
| + | \? for help with psql commands | ||
| + | \g or terminate with semicolon to execute query | ||
| + | \q to quit | ||
| + | |||
| + | x2go_sessions=> | ||
| + | </ | ||
| + | |||
| + | ==== Database structure ==== | ||
| + | |||
| + | The database has five tables: | ||
| + | |||
| + | < | ||
| + | x2go_sessions=> | ||
| + | List of relations | ||
| + | | ||
| + | --------+---------------+-------+---------- | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | (5 rows) | ||
| + | </ | ||
| + | |||
| + | Three of them are important for session management: | ||
| + | |||
| + | Furthermore, | ||
| + | |||
| + | < | ||
| + | x2go_sessions=> | ||
| + | List of relations | ||
| + | | ||
| + | --------+---------------+------+---------- | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | (4 rows) | ||
| + | |||
| + | x2go_sessions=> | ||
| + | </ | ||
| + | |||
| + | If you want to show the content of a table or view, evoke this SQL command: | ||
| + | |||
| + | < | ||
| + | x2go_sessions=> | ||
| + | server | ||
| + | --------------+---------------------------------------+-----------------+------- | ||
| + | ts-01 | mike-57-1379961697_stRTERMINAL_dp24 | x2gouser_mike | 30019 | ||
| + | ts-01 | mike-57-1379961697_stRTERMINAL_dp24 | x2gouser_mike | 30018 | ||
| + | ts-01 | mike-57-1379961697_stRTERMINAL_dp24 | x2gouser_mike | 30020 | ||
| + | (3 rows) | ||
| + | </ | ||
| + | |||
| + | ==== Troubleshooting ==== | ||
| + | |||
| + | If you want to remove these entries (because they are there but they by some reason should not be there), use this command set: | ||
| + | |||
| + | < | ||
| + | x2go_sessions=> | ||
| + | DELETE 1 | ||
| + | </ | ||
| + | |||
| + | ... or ... | ||
| + | |||
| + | < | ||
| + | x2go_sessions=> | ||
| + | DELETE 3 | ||
| + | </ | ||
| + | |||
| + | For further input on manipulating PostgreSQL database via the '' | ||