我尝试slurmdbd
从标准存储库(版本:)在 Ubuntu 16.04 上安装会计15.08.7-1build1
。
以下是命令:
$ sudo apt-get install mysql-server
$ sudo mysql
> create user 'slurm'@'localhost' identified by '123456';
> grant all on *.* TO 'slurm'@'localhost' identified by '123456' with grant option;
> create database slurm_acct_db;
> flush privileges;
> exit
$ sudo apt-get install slurmdbd
$ sudo vi /etc/slurm-llnl/slurmdbd.conf
$ cat /etc/slurm-llnl/slurmdbd.conf
AuthType=auth/munge
AuthInfo=/var/run/munge/munge.socket.2
DbdHost=localhost
DebugLevel=debug5
StorageHost=localhost
StorageLoc=slurm_acct_db
StoragePass=123456
StorageType=accounting_storage/mysql
StorageUser=slurm
LogFile=/var/log/slurm-llnl/slurmdbd.log
PidFile=/var/run/slurm-llnl/slurmdbd.pid
SlurmUser=slurm
但是启动slurmdbd
失败:
$ sudo systemctl start slurmdbd.service
Job for slurmdbd.service failed because the control process exited with error code. See "systemctl status slurmdbd.service" and "journalctl -xe" for details.
$ systemctl status slurmdbd.service
● slurmdbd.service - Slurm DBD accounting daemon
Loaded: loaded (/lib/systemd/system/slurmdbd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Di 2018-02-06 08:42:59 CET; 21s ago
Process: 5881 ExecStart=/usr/sbin/slurmdbd $SLURMDBD_OPTIONS (code=exited, status=1/FAILURE)
Feb 06 08:42:59 accslurm systemd[1]: Starting Slurm DBD accounting daemon...
Feb 06 08:42:59 accslurm systemd[1]: slurmdbd.service: Control process exited, code=exited status=1
Feb 06 08:42:59 accslurm systemd[1]: Failed to start Slurm DBD accounting daemon.
Feb 06 08:42:59 accslurm systemd[1]: slurmdbd.service: Unit entered failed state.
Feb 06 08:42:59 accslurm systemd[1]: slurmdbd.service: Failed with result 'exit-code'.
$ journalctl -xe
Feb 06 08:42:59 accslurm systemd[1]: Starting Slurm DBD accounting daemon...
-- Subject: Unit slurmdbd.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit slurmdbd.service has begun starting up.
Feb 06 08:42:59 accslurm systemd[1]: slurmdbd.service: Control process exited, code=exited status=1
Feb 06 08:42:59 accslurm systemd[1]: Failed to start Slurm DBD accounting daemon.
-- Subject: Unit slurmdbd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit slurmdbd.service has failed.
--
-- The result is failed.
尝试使用详细输出手动执行此操作:
$ sudo -u slurm slurmdbd -Dvvv
slurmdbd: error: mysql_query failed: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ignore table cluster_table modify `creation_time` int unsigned not null, modify ' at line 1
alter ignore table cluster_table modify `creation_time` int unsigned not null, modify `mod_time` int unsigned default 0 not null, modify `deleted` tinyint default 0, modify `name` tinytext not null, modify `control_host` tinytext not null default '', modify `control_port` int unsigned not null default 0, modify `last_port` int unsigned not null default 0, modify `rpc_version` smallint unsigned not null default 0, modify `classification` smallint unsigned default 0, modify `dimensions` smallint unsigned default 1, modify `plugin_id_select` smallint unsigned default 0, modify `flags` int unsigned default 0, drop primary key, add primary key (name(20));
slurmdbd: Accounting storage MYSQL plugin failed
slurmdbd: error: Couldn't load specified plugin name for accounting_storage/mysql: Plugin init() callback failed
slurmdbd: error: cannot create accounting_storage context for accounting_storage/mysql
slurmdbd: fatal: Unable to initialize accounting_storage/mysql accounting storage plugin
所以看起来创建数据库的语法有错误?
我错过了什么?
我不知道是否应该通过手动降级到旧的 mysql 版本或调整 slurmdbd 来解决它。但根本原因是
alter ignore table
已从mysql 5.7中删除。看起来您使用带有“新语法”引擎的“旧语法”SQL 语句。