我试图运行在集群中使用sqlite3的脚本(SGE)。SGE + sqlite3:错误:数据库被锁定
该脚本创建与lockfile锁,填充数据库,并释放锁。
$cat test.sh
#!/bin/sh
lockfile /commun/data/_tmp.idp448.lock
sqlite3 /commun/data/stats.sqlite "create table if not exists timeBeginDB(target text UNIQUE NOT NULL,inserted int);"
rm -f /commun/data/_tmp.idp448.lock
whoami
/commun/data /从所有节点都可见。 /commun/data/_tmp.idp448.lock是我创建的一个随机名,我目前是唯一使用我们的新群集的名称。
没有的qsub脚本工作没有任何问题:
[lindenb]$ sh test.sh
lindenb #prints whoami, no error on stderr
时的qsub被调用:
$ qsub -cwd -S /bin/sh test.sh
Your job 673 ("test.sh") has been submitted
$ cat test.sh.o673
lindenb #prints 'whoami', so the lock have been created and deleted
$ cat test.sh.e673
Error: database is locked
这是一个sqlite3的错误。
你有什么想法,什么样的建议,在上海黄金交易所方面,可能是问题的原因,行为的这种差异?
谢谢 皮埃尔
UPDATE:
我超级用户身份登录集群的节点上。简单以下命令失败: (/commun/data/stats2.sqlite不存在)
ssh [email protected]
[email protected]'s password:
sqlite3 /commun/data/stats2.sqlite 'create table if not exists timeBeginDB(target text UNIQUE NOT NULL,inserted int);'
Error: database is locked
它工作在〜根:
[[email protected] ~]# sqlite3 stats2.sqlite 'create table if not exists timeBeginDB(target text UNIQUE NOT NULL,inserted int);'
[[email protected] ~]#
错误是否发生在{for {1..10}中的i中;做test.sh&完成“? – choroba
@choroba,我已经运行了循环,stderr上没有错误。 – Pierre