SLURM용 MySQL 구성

SLURM용 MySQL 구성

SLURM(작업 예약용)을 MySQL 데이터베이스와 함께 사용하는 데 문제가 있습니다. 나는 사용하고 있었다이것참고로 제가 뭔가 잘못 이해한 것 같습니다. 누군가 내가 놓친 부분을 알려준다면 정말 좋을 것 같아요...

Ubuntu 22.10의 SLURM 21.08입니다. 저는 MySQL 8.0.32를 사용하고 있습니다.

이전에는 파일에 저장되는 완료 및 회계 작업을 수행하는 SLURM을 구성했습니다. 그리고 그것은 잘 작동하는 것 같았습니다. 컨트롤러가 작동 중이었고 한두 가지 작업을 제대로 실행했습니다.

그러다가 MySQL로 전환했습니다. 다음 /etc/slurm/slurm.conf값이 업데이트되었습니다.

 Job Completion Logging | MySQL
      JobCompLoc | slurm_complete_db
      JobCompHost | localhost
      JobCompPort | <blank>
      JobCompUser | slurm
      JobCompPass | ...some password...
 Job Accounting Storage | SlurmDBD
      AccountingStorageLoc | slurm_acct_db
      AccountingStorageHost | localhost
      AccountingStoragePort | <blank>
      AccountingStorageUser | slurm
      AccountingStoragePass | ...
      AccountingStoreFlags | job_script,job_env

그리고 /etc/slurm/slurmdbd.conf:

 AuthType=auth/munge
 DbdHost=xps8930
 DebugLevel=info
 StorageHost=xps8930
 StorageLoc=slurm_acct_db
 StoragePass=...
 StorageType=accounting_storage/mysql
 StorageUser=slurm
 LogFile=/var/log/slurm/slurmdbd.log
 PidFile=/run/slurmdbd.pid
 SlurmUser=slurm

"slurm"이라는 사용자라는 두 개의 MySQL 데이터베이스를 만들고 다음과 같이 권한을 부여했습니다.

CREATE DATABASE slurm_complete_db DEFAULT CHARACTER SET utf8 COLLATE
utf8_unicode_ci ;
CREATE DATABASE slurm_acct_db DEFAULT CHARACTER SET utf8 COLLATE
utf8_unicode_ci ;
CREATE USER 'slurm'@'%' IDENTIFIED WITH caching_sha2_password BY '' ;
GRANT ALL ON slurm_complete_db.* TO 'slurm'@'%';
GRANT ALL ON slurm_acct_db.* TO 'slurm'@'%';

InnoDB 지원이 활성화되었음을 "showengines" 명령을 사용하여 확인했습니다.

데이터베이스가 비어 있으므로 다음 단계는 데이터베이스를 구성하는 것이어야 한다고 생각합니다. 에서는 slurm.confClusterName을 "개인"이라고 불렀습니다. 그래서 저는 이렇게 했습니다:

$ sacctmgr add cluster personal
sacctmgr: error: slurm_persist_conn_open_without_init: failed to open
persistent connection to host:localhost:6819: Connection refused
sacctmgr: error: Sending PersistInit msg: Connection refused

slurm실행 중 입니다 slurmdbd(SLURM과 MySQL이 동일한 컴퓨터에 있음).

$ ps -aef | grep slurm
root        1407       1  0 09:42 ?        00:00:08 /usr/sbin/slurmd -D -s
root        1857       1  0 09:43 ?        00:00:03 /usr/sbin/slurmdbd -D -s

에서는 /var/log/slurm/slurmdbd.log다음을 볼 수 있습니다.

[2023-01-26T18:06:02.541] error: mysql_real_connect failed: 2003 Can't
connect to MySQL server on 'xps8930:3306' (111)
[2023-01-26T18:06:02.541] error: The database must be up when starting
the MYSQL plugin.  Trying again in 5 seconds.

에는 /var/log/slurm/slurmctld.log다음이 있습니다.

[2023-01-26T09:42:33.264] error: Configured MailProg is invalid
[2023-01-26T09:42:33.350] slurmctld version 21.08.5 started on cluster personal
[2023-01-26T09:42:36.121] error: slurm_persist_conn_open_without_init: failed to open persistent connection to host:localhost:6819:
Connection refused
[2023-01-26T09:42:36.121] error: Sending PersistInit msg: Connection refused
[2023-01-26T09:42:36.153] accounting_storage/slurmdbd:  clusteracct_storage_p_register_ctld: Registering slurmctld at port 6817 with slurmdbd
[2023-01-26T09:42:36.153] error: Sending PersistInit msg: Connection refused
[2023-01-26T09:42:36.154] error: Sending PersistInit msg: Connection refused
[2023-01-26T09:42:37.456] No memory enforcing mechanism configured.
[2023-01-26T09:42:39.924] error: mysql_real_connect failed: 2002 Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
[2023-01-26T09:42:39.924] fatal: You haven't inited this storage yet.

다음에 무엇을 해야 할지, 어떤 단계를 놓치고 있는지 잘 모르겠습니다. slurmdbd와 사이에 먼저 slurmctld집중해야 할까요 slurmdbd? 일단 작동되면 둘 중 하나가 slurmctld나타나거나 작동하도록 시도할 수 있습니다.

글이 길어져서 죄송합니다! 어떤 조언이라도 주시면 감사하겠습니다!

추신: 명령이 munge -n | unmunge성공했습니다.

답변1

몇 달 동안 이 문제를 미뤄둔 끝에 마침내 이 문제를 해결해야겠다고 결정했습니다. 이 정보가 이 문제를 해결하려는 다른 사람에게 도움이 되기를 바랍니다.

hostname반환되었고 xps8930그것이 제가 파일 기반 회계를 할 때 사용했던 것입니다. 내가 해야 할 일은 대신 이러한 값을 설정하는 것이었습니다(구성 파일의 다른 값은 문제와 관련이 없었습니다).

안에 /etc/slurm/slurm.conf:

ClusterName=personal
SlurmctldPidFile=/run/slurm/slurmctld.pid
SlurmdPidFile=/run/slurm/slurmd.pid
AccountingStorageHost=localhost
AccountingStoragePass=/var/run/munge/munge.socket.2
AccountingStorageType=accounting_storage/slurmdbd
AccountingStorageUser=slurm
AccountingStoreFlags=job_script,job_env
JobCompHost=localhost
JobCompPass=<some MySQL password>
JobCompType=jobcomp/mysql
JobCompUser=slurm
##  Database defaults to slurm_jobcomp_db
#JobCompLoc=slurm_complete_db

안에 /etc/slurm/slurmdbd.conf:

AuthInfo=/var/run/munge/munge.socket.2
AuthType=auth/munge
DbdHost=localhost
DebugLevel=info
LogFile=/var/log/slurm/slurmdbd.log
PidFile=/run/slurm/slurmdbd.pid
SlurmUser=slurm
StorageHost=localhost
StoragePass=<same MySQL password as above, since it's the same user>
StorageType=accounting_storage/mysql
StorageUser=slurm
StorageLoc=slurm_acct_db

AccountingStoragePassAuthInfo첫 번째 파일의 값은 두 번째 파일의 값과 같습니다 . 기본값을 사용할 수 있도록 비워 둘 수 있다고 가정합니다. 10세전기이것이 버그일지도 모른다고 추측했습니다. 그러나 현재선적 서류 비치AuthInfo괜찮다고 하더군요 .

slurmdbd( sudo service slurmdbd start)를 시작한 후 sacctmgr다음을 실행할 수 있습니다.

$ sudo sacctmgr add cluster personal
 Adding Cluster(s)
  Name           = personal
Would you like to commit changes? (You have 30 seconds to decide)
(N/y): y
$ sacctmgr list cluster
   Cluster     ControlHost  ControlPort   RPC     Share GrpJobs       GrpTRES GrpSubmit MaxJobs       MaxTRES MaxSubmit     MaxWall                  QOS   Def QOS 
---------- --------------- ------------ ----- --------- ------- ------------- --------- ------- ------------- --------- ----------- -------------------- --------- 
  personal                            0     0         1                                                                                           normal

문제가 해결되면 slurmctldslurmd서비스를 시작했습니다. 그리고 지금까지는 모든 것이 괜찮아 보입니다.

포트 등은 기본값으로 두었습니다. 그리고 기본값이 괜찮아 보였기 때문에 여러 값이 생략되었을 수도 있습니다.

간단히 말해서, 이전과 비교하여 달라진 점은 다음과 같습니다.

  • localhost에서 사용slurmdbd.conf
  • 그리고 비밀번호를 입력하지 마세요 AccountingStoragePass. "Pass"가 있으므로 거기에 비밀번호를 입력해야 한다고 생각했습니다.

이것이 다른 사람들에게 유용하길 바랍니다!

관련 정보