Code Monkey home page Code Monkey logo

Comments (5)

untergeek avatar untergeek commented on August 16, 2024

It does work. The problem is the 0. You cannot use -d 0. I suppose that should be better documented.

This was an intentional design choice so that you could not accidentally delete the current index. If you want to delete the current index you will have to use a curl statement: curl -XDELETE localhost:9200/.marvel-2014.02.10?pretty

Perhaps we could correct the script to allow for this in the future, but it was intentional.

Here's what it looks like for me:

curator --host blackbox -c 6 -b 1 -d 7 -p .marvel-
2014-02-10T06:55:27.821 INFO                        main:325  Job starting...
2014-02-10T06:55:27.821 INFO                        main:345  Deleting indices older than 7 days...
2014-02-10T06:55:27.822 INFO                   _new_conn:257  Starting new HTTP connection (1): blackbox
2014-02-10T06:55:27.829 INFO         log_request_success:49   GET http://blackbox:9200/_settings [status:200 request:0.007s]
2014-02-10T06:55:27.833 INFO                  index_loop:290  Attempting to delete index .marvel-2014.01.31 because it is 3 days, 0:00:00 older than cutoff.
2014-02-10T06:55:28.040 INFO         log_request_success:49   DELETE http://blackbox:9200/.marvel-2014.01.31 [status:200 request:0.206s]
2014-02-10T06:55:28.040 INFO                  index_loop:300  .marvel-2014.01.31: Successfully deleted.
2014-02-10T06:55:28.040 INFO                  index_loop:290  Attempting to delete index .marvel-2014.02.01 because it is 2 days, 0:00:00 older than cutoff.
2014-02-10T06:55:28.402 INFO         log_request_success:49   DELETE http://blackbox:9200/.marvel-2014.02.01 [status:200 request:0.362s]
2014-02-10T06:55:28.402 INFO                  index_loop:300  .marvel-2014.02.01: Successfully deleted.
2014-02-10T06:55:28.402 INFO                  index_loop:290  Attempting to delete index .marvel-2014.02.02 because it is 1 day, 0:00:00 older than cutoff.
2014-02-10T06:55:29.118 INFO         log_request_success:49   DELETE http://blackbox:9200/.marvel-2014.02.02 [status:200 request:0.716s]
2014-02-10T06:55:29.118 INFO                  index_loop:300  .marvel-2014.02.02: Successfully deleted.
2014-02-10T06:55:29.119 INFO        find_expired_indices:188  .marvel-2014.02.03 is 0:00:00 above the cutoff.
2014-02-10T06:55:29.119 INFO        find_expired_indices:188  .marvel-2014.02.04 is 1 day, 0:00:00 above the cutoff.
2014-02-10T06:55:29.119 INFO        find_expired_indices:188  .marvel-2014.02.05 is 2 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.119 INFO        find_expired_indices:188  .marvel-2014.02.06 is 3 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.119 INFO        find_expired_indices:188  .marvel-2014.02.07 is 4 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.119 INFO        find_expired_indices:188  .marvel-2014.02.08 is 5 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.119 INFO        find_expired_indices:188  .marvel-2014.02.09 is 6 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.119 INFO        find_expired_indices:188  .marvel-2014.02.10 is 7 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.119 INFO                  index_loop:301  DELETE index operations completed.
2014-02-10T06:55:29.120 INFO                        main:350  Closing indices older than 6 days...
2014-02-10T06:55:29.122 INFO         log_request_success:49   GET http://blackbox:9200/_settings [status:200 request:0.002s]
2014-02-10T06:55:29.122 INFO                  index_loop:290  Attempting to close index .marvel-2014.02.03 because it is 1 day, 0:00:00 older than cutoff.
2014-02-10T06:55:29.130 INFO         log_request_success:49   GET http://blackbox:9200/_cluster/state?filter_nodes=true&filter_routing_table=true&filter_indices=.marvel-2014.02.03&filter_index_templates=true&filter_blocks=true [status:200 request:0.008s]
2014-02-10T06:55:29.287 INFO         log_request_success:49   POST http://blackbox:9200/.marvel-2014.02.03/_close [status:200 request:0.153s]
2014-02-10T06:55:29.287 INFO                  index_loop:300  .marvel-2014.02.03: Successfully closed.
2014-02-10T06:55:29.288 INFO        find_expired_indices:188  .marvel-2014.02.04 is 0:00:00 above the cutoff.
2014-02-10T06:55:29.288 INFO        find_expired_indices:188  .marvel-2014.02.05 is 1 day, 0:00:00 above the cutoff.
2014-02-10T06:55:29.288 INFO        find_expired_indices:188  .marvel-2014.02.06 is 2 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.288 INFO        find_expired_indices:188  .marvel-2014.02.07 is 3 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.288 INFO        find_expired_indices:188  .marvel-2014.02.08 is 4 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.288 INFO        find_expired_indices:188  .marvel-2014.02.09 is 5 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.288 INFO        find_expired_indices:188  .marvel-2014.02.10 is 6 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.288 INFO                  index_loop:301  CLOSE index operations completed.
2014-02-10T06:55:29.289 INFO                        main:355  Disabling bloom filter on indices older than 1 days...
2014-02-10T06:55:29.291 INFO         log_request_success:49   GET http://blackbox:9200/_settings [status:200 request:0.002s]
2014-02-10T06:55:29.291 INFO                  index_loop:290  Attempting to disable bloom filter for index .marvel-2014.02.03 because it is 6 days, 0:00:00 older than cutoff.
2014-02-10T06:55:29.299 INFO         log_request_success:49   GET http://blackbox:9200/_cluster/state?filter_nodes=true&filter_routing_table=true&filter_indices=.marvel-2014.02.03&filter_index_templates=true&filter_blocks=true [status:200 request:0.008s]
2014-02-10T06:55:29.303 INFO                _bloom_index:267  Skipping index .marvel-2014.02.03: Already closed.
2014-02-10T06:55:29.303 INFO                  index_loop:290  Attempting to disable bloom filter for index .marvel-2014.02.04 because it is 5 days, 0:00:00 older than cutoff.
2014-02-10T06:55:29.312 INFO         log_request_success:49   GET http://blackbox:9200/_cluster/state?filter_nodes=true&filter_routing_table=true&filter_indices=.marvel-2014.02.04&filter_index_templates=true&filter_blocks=true [status:200 request:0.008s]
2014-02-10T06:55:29.376 INFO         log_request_success:49   PUT http://blackbox:9200/.marvel-2014.02.04/_settings [status:200 request:0.059s]
2014-02-10T06:55:29.376 INFO                  index_loop:300  .marvel-2014.02.04: Successfully bloom filter disabled.
2014-02-10T06:55:29.376 INFO                  index_loop:290  Attempting to disable bloom filter for index .marvel-2014.02.05 because it is 4 days, 0:00:00 older than cutoff.
2014-02-10T06:55:29.385 INFO         log_request_success:49   GET http://blackbox:9200/_cluster/state?filter_nodes=true&filter_routing_table=true&filter_indices=.marvel-2014.02.05&filter_index_templates=true&filter_blocks=true [status:200 request:0.008s]
2014-02-10T06:55:29.446 INFO         log_request_success:49   PUT http://blackbox:9200/.marvel-2014.02.05/_settings [status:200 request:0.057s]
2014-02-10T06:55:29.447 INFO                  index_loop:300  .marvel-2014.02.05: Successfully bloom filter disabled.
2014-02-10T06:55:29.447 INFO                  index_loop:290  Attempting to disable bloom filter for index .marvel-2014.02.06 because it is 3 days, 0:00:00 older than cutoff.
2014-02-10T06:55:29.455 INFO         log_request_success:49   GET http://blackbox:9200/_cluster/state?filter_nodes=true&filter_routing_table=true&filter_indices=.marvel-2014.02.06&filter_index_templates=true&filter_blocks=true [status:200 request:0.008s]
2014-02-10T06:55:31.644 INFO         log_request_success:49   PUT http://blackbox:9200/.marvel-2014.02.06/_settings [status:200 request:2.185s]
2014-02-10T06:55:31.645 INFO                  index_loop:300  .marvel-2014.02.06: Successfully bloom filter disabled.
2014-02-10T06:55:31.645 INFO                  index_loop:290  Attempting to disable bloom filter for index .marvel-2014.02.07 because it is 2 days, 0:00:00 older than cutoff.
2014-02-10T06:55:31.653 INFO         log_request_success:49   GET http://blackbox:9200/_cluster/state?filter_nodes=true&filter_routing_table=true&filter_indices=.marvel-2014.02.07&filter_index_templates=true&filter_blocks=true [status:200 request:0.008s]
2014-02-10T06:55:35.807 INFO         log_request_success:49   PUT http://blackbox:9200/.marvel-2014.02.07/_settings [status:200 request:4.150s]
2014-02-10T06:55:35.807 INFO                  index_loop:300  .marvel-2014.02.07: Successfully bloom filter disabled.
2014-02-10T06:55:35.807 INFO                  index_loop:290  Attempting to disable bloom filter for index .marvel-2014.02.08 because it is 1 day, 0:00:00 older than cutoff.
2014-02-10T06:55:35.816 INFO         log_request_success:49   GET http://blackbox:9200/_cluster/state?filter_nodes=true&filter_routing_table=true&filter_indices=.marvel-2014.02.08&filter_index_templates=true&filter_blocks=true [status:200 request:0.008s]
2014-02-10T06:55:40.046 INFO         log_request_success:49   PUT http://blackbox:9200/.marvel-2014.02.08/_settings [status:200 request:4.226s]
2014-02-10T06:55:40.047 INFO                  index_loop:300  .marvel-2014.02.08: Successfully bloom filter disabled.
2014-02-10T06:55:40.047 INFO        find_expired_indices:188  .marvel-2014.02.09 is 0:00:00 above the cutoff.
2014-02-10T06:55:40.047 INFO        find_expired_indices:188  .marvel-2014.02.10 is 1 day, 0:00:00 above the cutoff.
2014-02-10T06:55:40.047 INFO                  index_loop:301  DISABLE BLOOM FILTER FOR index operations completed.
2014-02-10T06:55:40.047 INFO                        main:365  Done in 0:00:12.228052.

from curator.

dharrigan avatar dharrigan commented on August 16, 2024

Hi There!

Thank you, that makes sense. Yes, I reverted to using the CURL command. I
suppose it might be useful to have a "-f" for force if value is 0. It's
useful at times to completely remove the index, but meh, it's neither
here or there since I can use CURL if required.

Thank you again for a great tool! :-)

-=david=-

On 10 February 2014 12:57, Aaron Mildenstein [email protected]:

It does work. The problem is the 0. You cannot use -d 0. I suppose that
should be better documented.

This was an intentional design choice so that you could not accidentally
delete the current index. If you want to delete the current index you will
have to use a curl statement: curl -XDELETE
localhost:9200/.marvel-2014.02.10?pretty

Perhaps we could correct the script to allow for this in the future, but
it was intentional.

Here's what it looks like for me:

curator --host blackbox -c 6 -b 1 -d 7 -p .marvel-
2014-02-10T06:55:27.821 INFO main:325 Job starting...
2014-02-10T06:55:27.821 INFO main:345 Deleting indices older than 7 days...
2014-02-10T06:55:27.822 INFO _new_conn:257 Starting new HTTP connection (1): blackbox
2014-02-10T06:55:27.829 INFO log_request_success:49 GET http://blackbox:9200/_settings [status:200 request:0.007s]
2014-02-10T06:55:27.833 INFO index_loop:290 Attempting to delete index .marvel-2014.01.31 because it is 3 days, 0:00:00 older than cutoff.
2014-02-10T06:55:28.040 INFO log_request_success:49 DELETE http://blackbox:9200/.marvel-2014.01.31 [status:200 request:0.206s]
2014-02-10T06:55:28.040 INFO index_loop:300 .marvel-2014.01.31: Successfully deleted.
2014-02-10T06:55:28.040 INFO index_loop:290 Attempting to delete index .marvel-2014.02.01 because it is 2 days, 0:00:00 older than cutoff.
2014-02-10T06:55:28.402 INFO log_request_success:49 DELETE http://blackbox:9200/.marvel-2014.02.01 [status:200 request:0.362s]
2014-02-10T06:55:28.402 INFO index_loop:300 .marvel-2014.02.01: Successfully deleted.
2014-02-10T06:55:28.402 INFO index_loop:290 Attempting to delete index .marvel-2014.02.02 because it is 1 day, 0:00:00 older than cutoff.
2014-02-10T06:55:29.118 INFO log_request_success:49 DELETE http://blackbox:9200/.marvel-2014.02.02 [status:200 request:0.716s]
2014-02-10T06:55:29.118 INFO index_loop:300 .marvel-2014.02.02: Successfully deleted.
2014-02-10T06:55:29.119 INFO find_expired_indices:188 .marvel-2014.02.03 is 0:00:00 above the cutoff.
2014-02-10T06:55:29.119 INFO find_expired_indices:188 .marvel-2014.02.04 is 1 day, 0:00:00 above the cutoff.
2014-02-10T06:55:29.119 INFO find_expired_indices:188 .marvel-2014.02.05 is 2 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.119 INFO find_expired_indices:188 .marvel-2014.02.06 is 3 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.119 INFO find_expired_indices:188 .marvel-2014.02.07 is 4 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.119 INFO find_expired_indices:188 .marvel-2014.02.08 is 5 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.119 INFO find_expired_indices:188 .marvel-2014.02.09 is 6 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.119 INFO find_expired_indices:188 .marvel-2014.02.10 is 7 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.119 INFO index_loop:301 DELETE index operations completed.
2014-02-10T06:55:29.120 INFO main:350 Closing indices older than 6 days...
2014-02-10T06:55:29.122 INFO log_request_success:49 GET http://blackbox:9200/_settings [status:200 request:0.002s]
2014-02-10T06:55:29.122 INFO index_loop:290 Attempting to close index .marvel-2014.02.03 because it is 1 day, 0:00:00 older than cutoff.
2014-02-10T06:55:29.130 INFO log_request_success:49 GET http://blackbox:9200/_cluster/state?filter_nodes=true&filter_routing_table=true&filter_indices=.marvel-2014.02.03&filter_index_templates=true&filter_blocks=true [status:200 request:0.008s]
2014-02-10T06:55:29.287 INFO log_request_success:49 POST http://blackbox:9200/.marvel-2014.02.03/_close [status:200 request:0.153s]
2014-02-10T06:55:29.287 INFO index_loop:300 .marvel-2014.02.03: Successfully closed.
2014-02-10T06:55:29.288 INFO find_expired_indices:188 .marvel-2014.02.04 is 0:00:00 above the cutoff.
2014-02-10T06:55:29.288 INFO find_expired_indices:188 .marvel-2014.02.05 is 1 day, 0:00:00 above the cutoff.
2014-02-10T06:55:29.288 INFO find_expired_indices:188 .marvel-2014.02.06 is 2 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.288 INFO find_expired_indices:188 .marvel-2014.02.07 is 3 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.288 INFO find_expired_indices:188 .marvel-2014.02.08 is 4 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.288 INFO find_expired_indices:188 .marvel-2014.02.09 is 5 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.288 INFO find_expired_indices:188 .marvel-2014.02.10 is 6 days, 0:00:00 above the cutoff.
2014-02-10T06:55:29.288 INFO index_loop:301 CLOSE index operations completed.
2014-02-10T06:55:29.289 INFO main:355 Disabling bloom filter on indices older than 1 days...
2014-02-10T06:55:29.291 INFO log_request_success:49 GET http://blackbox:9200/_settings [status:200 request:0.002s]
2014-02-10T06:55:29.291 INFO index_loop:290 Attempting to disable bloom filter for index .marvel-2014.02.03 because it is 6 days, 0:00:00 older than cutoff.
2014-02-10T06:55:29.299 INFO log_request_success:49 GET http://blackbox:9200/_cluster/state?filter_nodes=true&filter_routing_table=true&filter_indices=.marvel-2014.02.03&filter_index_templates=true&filter_blocks=true [status:200 request:0.008s]
2014-02-10T06:55:29.303 INFO _bloom_index:267 Skipping index .marvel-2014.02.03: Already closed.
2014-02-10T06:55:29.303 INFO index_loop:290 Attempting to disable bloom filter for index .marvel-2014.02.04 because it is 5 days, 0:00:00 older than cutoff.
2014-02-10T06:55:29.312 INFO log_request_success:49 GET http://blackbox:9200/_cluster/state?filter_nodes=true&filter_routing_table=true&filter_indices=.marvel-2014.02.04&filter_index_templates=true&filter_blocks=true [status:200 request:0.008s]
2014-02-10T06:55:29.376 INFO log_request_success:49 PUT http://blackbox:9200/.marvel-2014.02.04/_settings [status:200 request:0.059s]
2014-02-10T06:55:29.376 INFO index_loop:300 .marvel-2014.02.04: Successfully bloom filter disabled.
2014-02-10T06:55:29.376 INFO index_loop:290 Attempting to disable bloom filter for index .marvel-2014.02.05 because it is 4 days, 0:00:00 older than cutoff.
2014-02-10T06:55:29.385 INFO log_request_success:49 GET http://blackbox:9200/_cluster/state?filter_nodes=true&filter_routing_table=true&filter_indices=.marvel-2014.02.05&filter_index_templates=true&filter_blocks=true [status:200 request:0.008s]
2014-02-10T06:55:29.446 INFO log_request_success:49 PUT http://blackbox:9200/.marvel-2014.02.05/_settings [status:200 request:0.057s]
2014-02-10T06:55:29.447 INFO index_loop:300 .marvel-2014.02.05: Successfully bloom filter disabled.
2014-02-10T06:55:29.447 INFO index_loop:290 Attempting to disable bloom filter for index .marvel-2014.02.06 because it is 3 days, 0:00:00 older than cutoff.
2014-02-10T06:55:29.455 INFO log_request_success:49 GET http://blackbox:9200/_cluster/state?filter_nodes=true&filter_routing_table=true&filter_indices=.marvel-2014.02.06&filter_index_templates=true&filter_blocks=true [status:200 request:0.008s]
2014-02-10T06:55:31.644 INFO log_request_success:49 PUT http://blackbox:9200/.marvel-2014.02.06/_settings [status:200 request:2.185s]
2014-02-10T06:55:31.645 INFO index_loop:300 .marvel-2014.02.06: Successfully bloom filter disabled.
2014-02-10T06:55:31.645 INFO index_loop:290 Attempting to disable bloom filter for index .marvel-2014.02.07 because it is 2 days, 0:00:00 older than cutoff.
2014-02-10T06:55:31.653 INFO log_request_success:49 GET http://blackbox:9200/_cluster/state?filter_nodes=true&filter_routing_table=true&filter_indices=.marvel-2014.02.07&filter_index_templates=true&filter_blocks=true [status:200 request:0.008s]
2014-02-10T06:55:35.807 INFO log_request_success:49 PUT http://blackbox:9200/.marvel-2014.02.07/_settings [status:200 request:4.150s]
2014-02-10T06:55:35.807 INFO index_loop:300 .marvel-2014.02.07: Successfully bloom filter disabled.
2014-02-10T06:55:35.807 INFO index_loop:290 Attempting to disable bloom filter for index .marvel-2014.02.08 because it is 1 day, 0:00:00 older than cutoff.
2014-02-10T06:55:35.816 INFO log_request_success:49 GET http://blackbox:9200/_cluster/state?filter_nodes=true&filter_routing_table=true&filter_indices=.marvel-2014.02.08&filter_index_templates=true&filter_blocks=true [status:200 request:0.008s]
2014-02-10T06:55:40.046 INFO log_request_success:49 PUT http://blackbox:9200/.marvel-2014.02.08/_settings [status:200 request:4.226s]
2014-02-10T06:55:40.047 INFO index_loop:300 .marvel-2014.02.08: Successfully bloom filter disabled.
2014-02-10T06:55:40.047 INFO find_expired_indices:188 .marvel-2014.02.09 is 0:00:00 above the cutoff.
2014-02-10T06:55:40.047 INFO find_expired_indices:188 .marvel-2014.02.10 is 1 day, 0:00:00 above the cutoff.
2014-02-10T06:55:40.047 INFO index_loop:301 DISABLE BLOOM FILTER FOR index operations completed.
2014-02-10T06:55:40.047 INFO main:365 Done in 0:00:12.228052.


Reply to this email directly or view it on GitHubhttps://github.com//issues/37#issuecomment-34627923
.

I prefer encrypted and signed messages. KeyID: B20A22F9
Fingerprint: 110A F423 3647 54E2 880F ADAD 1C52 85BF B20A 22F9

"It is not usually until you've built and used a version of the program
that you understand the issues well enough to get the design right." - Rob
Pike, Brian Kernighan.

No trees were harmed in the sending of this message, however, a number of
electrons were inconvenienced.

from curator.

untergeek avatar untergeek commented on August 16, 2024

I'm closing this since I went through the code and found I do already have a message that indicates this:

messages.append('Values for --delete, --close, --bloom, --optimize must be > 0')

from curator.

dharrigan avatar dharrigan commented on August 16, 2024

May I suggest a slight grammar improvement,

If you have the sentence read "Values for --delete, --close, --bloom or --optimize must be > 0" then it's a bit easier to comprehend quickly :-)

-=david=-

On 10 February 2014 13:02, Aaron Mildenstein [email protected]:

Closed #37 #37.


Reply to this email directly or view it on GitHubhttps://github.com//issues/37
.

I prefer encrypted and signed messages. KeyID: B20A22F9
Fingerprint: 110A F423 3647 54E2 880F ADAD 1C52 85BF B20A 22F9

"It is not usually until you've built and used a version of the program
that you understand the issues well enough to get the design right." - Rob
Pike, Brian Kernighan.

No trees were harmed in the sending of this message, however, a number of
electrons were inconvenienced.

from curator.

untergeek avatar untergeek commented on August 16, 2024

Pull requests are cool 😉

from curator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.