This shows you the differences between two versions of the page.
— | wiki:useful_commands_and_administration_tasks [2020/03/25 15:15] (current) – created neyron | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Useful commands and administration tasks ====== | ||
+ | //Here, you'll find useful commands, sometimes a bit tricky, to put into your scripts or administration tasks// | ||
+ | |||
+ | ===== List suspected nodes without running jobs ===== | ||
+ | You may need this list of nodes if you want to automatically reboot them because you don't know why they have been suspected and you think that it is a simple way to clean things: | ||
+ | < | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ===== List alive nodes without running jobs ===== | ||
+ | < | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ===== Oarstat display without best-effort jobs ===== | ||
+ | |||
+ | < | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ===== Setting some nodes in maintenance mode only when they are free ===== | ||
+ | |||
+ | You may need to plan some maintenance operations on some particular nodes (for example add somme memory, upgrade bios,...) but you don't want to interrupt currently running or planned users jobs. To do so, you can simply run a " | ||
+ | <code bash> | ||
+ | | ||
+ | </ | ||
+ | This uses the " | ||
+ | |||
+ | The example above will disable 2 free nodes, but you may want to add a //-p// option to specify the nodes you want to disable, for example: '' | ||
+ | |||
+ | **Note:** you can't simply do that within a " | ||
+ | |||
+ | ===== Optimizing and re-initializing the database with Postgres ===== | ||
+ | Sometimes, the database contains so much jobs that you need to optimize it. Normally, you should have a **vacuumdb** running daily fron cron. You can do manually a **vacuumdb -a -f -z ; reindexdb oar** but don't forget to stop OAR before, and be aware that it may take some time. But the DB still may be very big and it may be a problem for backups or the nightly vaccum takes too much time. A more radical solution is to start again with a new database, but keep the old one so that you can still connect to it for jobs history. You can do this once a year for example, and you only have to backup the current database. Here is a way to do this: | ||
+ | |||
+ | * First of all, make a backup of your database! With postgres, it is as easy as: | ||
+ | < | ||
+ | | ||
+ | </ | ||
+ | It will create an exact copy of the " | ||
+ | * You should plan a maintenance and be sure there' | ||
+ | * Make a dump of your " | ||
+ | * Stop the oar server, drop the oar database and re-create it. | ||
+ | * Finally, restore the " | ||
+ | * And restart the server. | ||
+ | |||