如何删除rocksDB上的LOCK
我尝试运行以下代码但收到以下错误
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
Traceback (most recent call last):
File "hello flask.py", line 18, in <module>
rdb = rocksdb.DB("sample.db", rocksdb.Options(create_if_missing=True))
File "rocksdb/_rocksdb.pyx", line 1437, in
rocksdb._rocksdb.DB.__cinit__ (rocksdb/_rocksdb.cpp:23176)
File "rocksdb/_rocksdb.pyx", line 84, in rocksdb._rocksdb.check_status
(rocksdb/_rocksdb.cpp:3453)
rocksdb.errors.RocksIOError: IO error: While lock file: sample.db/LOCK:
Resource temporarily unavailable
代码 :
from flask import Flask
import rocksdb
app = Flask(__name__)
@app.route('/hello/<name>')
def hello_name(name):
value = name.encode(encoding='UTF-8',errors='strict')
rdb.put(b'name', value)
return 'Hello %s!' % rdb.get(b'name')
@app.route('/')
def hello():
return 'Welcome'
if __name__ == '__main__':
rdb = rocksdb.DB("sample.db", rocksdb.Options(create_if_missing=True))
app.run(debug = True)