Memcache API
Hi everybody, I want to ask a question.
Can I delete all item in a specific bucket? If can, how to do it?
Thank in advanced!
You can flush a given bucket using the 'membase bucket-flush' command. Type the following command to get the details on how to use it.
/opt/membase/bin/cli/membase help
More details can be found here:
http://wiki.membase.org/display/membase/Membase+Command-line+Interface#M...
Does this command work in 1.6.0.1 Windows release?
Running this command results in 400 Bad Request for me. And when using the REST API I get a "Flushing is currently not implemented" result.
Ilhan, seems like there is a bug in the REST API code, I've filed http://jira.membase.org/browse/MB-2712 for this. You should still be able to flush a bucket from your client.
Perry
Perry, can you please tell me what I am missing in the following bucket-flush command?
membase bucket-flush -c 192.168.1.98:8091 -u Administrator -p XXX --bucket=test_bucket3 --bucket-password=password
ERROR: unable to bucket-flush (400) Bad RequestERROR: command: bucket-flush: 192.168.1.98:8091, 2 I can successfully create and delete this bucket in CLI. Ilhan
Ilhan, unfortunately there is a bug in the current flush capability. You'll have to perform the flush of a bucket through the client code. See the above post for a link to the bug that is tracking this.
Perry
Hi,
I can't seem to get this to work on the command line either:
C:\Program Files\Membase\Server\bin\cli>membase bucket-flush -c 192.168.125.106:8091 --bucket=default
ERROR: unable to bucket-flush (400) Bad Request
ERROR: command: bucket-flush: 192.168.125.106:8091, No JSON object could be decoded
also can't get it to work using rest:
C:\tools\curl>curl -i http://Administrator:xxx@192.168.125.106:8091/pools/default/buckets/default/controller/doFlush
As noted above there is a bug in the bucket flush capability in the rest api. An alternative to this method is telneting to Membase on port 11211 for the default bucket and typing "flush_all". This will flush all items out of the default bucket.
This is also fixed in 1.7. Karl, can you download the latest 1.7 beta and verify that it is working for you?
Perry
Sure, the "flush_all" or flush command is perfectly valid here and will only affect the one bucket you're working with, not the entire cluster.