RabbitMQ - weird disk_free

I just installed Erlang and RabbitMQ.

. \ status rabbitmqctl.bat

[...] {disk_free_limit, 1000000000}, {disk_free, 2010} [...]

Why is there 2010? I have 143 GB on this drive. Because of this, I have the following errors in RabbitMQ logs:

= INFORMATION REPORT ==== June 17, 2013 :: 17: 11: 09 === Disk limit set to 1000 MB

= INFO REPORT ==== June 17, 2013 :: 17: 11: 09 === Not enough free disk space. Free Bytes: 2010 Limit: 1,000,000,000

= WARNING REPORT ==== June 17, 2013 :: 17: 11: 09 === The disk resource limitation alarm limit is set to node 'rabbit @ USER-PC.


* Publishers will be blocked until this signal is cleared *


How can I change it manually? I am using Windows 7.

+4
source share
1 answer

I have the same problem and I seem to have gotten to the root cause.

Rabbit uses os:cmd("dir /-C /W \"" ++ Dir ++ [$]") here to run dir and get free disk space.

But ... I have installed Clink ( http://code.google.com/p/clink ), which wraps cmd.exe.

Parsing the cmd output rabbits is pretty naive and depends on the free disk space in the last line:

 parse_free_win32(CommandResult) -> LastLine = lists:last(string:tokens(CommandResult, "\r\n")), {match, [Free]} = re:run(lists:reverse(LastLine), "(\\d+)", [{capture, all_but_first, list}]), list_to_integer(lists:reverse(Free)). 

Running the os:cmd("dir /-C /W \"" ++ Dir ++ [$"]) command os:cmd("dir /-C /W \"" ++ Dir ++ [$"]) on erl on my machine adds the license text to the end of the command output (due to Clink), and the analysis code takes the last year in the copyright notice, not in the available accessible disc.

I assume that you have something similar that also affects the result of calling the command. Doing Result = os:cmd("dir /-C /W <your dir>"). in erlang request should give you a good idea.

+3
source

Source: https://habr.com/ru/post/1486620/


All Articles