inets httpd: server configuration file syntax (proplist_file) - erlang

What is the syntax for the configuration file when you start an httpd server like this:
inets:start(httpd,
[{proplist_file, "./server_config.txt"}]
).
The httpd docs say:
{proplist_file, path()}
If this property is defined, Inets expects to find all other
properties defined in this file.
And:
the properties are to be fetched from a configuration file that can
consist of a regular Erlang property list
But with this file:
server_config.txt:
[
{port, 0},
{server_name, "httpd_test"},
{server_root, "/Users/7stud/erlang_programs/inets_proj"},
{document_root, "/Users/7stud/erlang_programs/inets_proj/htdocs"},
{ipfamily, inet6},
{ bind_address, {0,0,0,0,0,0,0,1} }
]
I get the error:
$ erl
Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V8.2 (abort with ^G)
1> inets:start().
ok
2> inets:start(httpd, [{proplist_file, "/Users/7stud/erlang_programs/inets_proj/server_config.txt"}]).
** exception error: no try clause matching {error,{8,erl_parse,["syntax error before: ",[]]}}
in function httpd_sup:httpd_config/1 (httpd_sup.erl, line 144)
in call from httpd_sup:start_child/1 (httpd_sup.erl, line 52)
in call from inets:call_service/3 (inets.erl, line 461)
Next, I tried the Apache syntax, and that didn't work either:
server_config.txt:
Port 0
ServerName "httpd_test"
ServerRoot "/Users/7stud/erlang_programs/inets_proj"
DocumentRoot "./htdocs"
Ipfamily inet6
BindAddress {0,0,0,0,0,0,0,1}
3> inets:start(httpd, [{file, "./server_config.txt"}]).
{error,"httpd_conf: \"/Users/7stud/erlang_programs/inets_proj\" is an invalid ServerRoot"}
4>
Okay, I made some progress on the Apache style syntax by getting rid of the quotes:
Port 0
ServerName httpd_test
ServerRoot /Users/7stud/erlang_programs/inets_proj
DocumentRoot ./htdocs
Ipfamily inet6
BindAddress 0:0:0:0:0:0:0:1
Now, I get the error:
8> inets:start(httpd, [{file, "./server_config.txt"}]).
{error,"httpd_conf: 0:0:0:0:0:0:0:1 is an invalid address"}

I figured out the proplist syntax. I shortened up the paths once I got the proplist syntax to work:
server_config.txt:
[
{port, 0},
{server_name, "httpd_test"},
{server_root, "."},
{document_root, "./htdocs"},
{ipfamily, inet6},
{ bind_address, {0,0,0,0,0,0,0,1} }
].
Notice the . at the end! The syntax is so obvious no wonder the docs don't give an example. :(
$ erl
Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V8.2 (abort with ^G)
1> inets:start().
ok
2> {ok, Server} = inets:start(httpd, [{proplist_file, "./server_config.txt"}]).
{ok,<0.73.0>}
3> httpd:info(Server).
[{mime_types,[{"htm","text/html"},{"html","text/html"}]},
{ipfamily,inet6},
{server_name,"httpd_test"},
{bind_address,{0,0,0,0,0,0,0,1}},
{server_root,"."},
{port,49400},
{document_root,"./htdocs"}]
I'm still wondering how to specify an ipv6 bind address with the Apache syntax. Maybe ipv6 came after the erlang Apache syntax was implemented?

Related

inets httpd: server example in User's Guide not working

I copied the code straight from the inets User's Guide:
$ erl
Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V8.2 (abort with ^G)
1> inets:start().
ok
2> {ok, Pid} = inets:start(httpd, [{port, 0}, {server_name,"httpd_test"}, {server_root,"/tmp"}, {document_root,"/tmp/htdocs"}, {bind_address, "localhost"}]).
=ERROR REPORT==== 25-Feb-2018::03:08:14 ===
Failed initiating web server:
undefined
{invalid_option,{non_existing,{document_root,"/tmp/htdocs"}}}
** exception error: no match of right hand side value
{error,
{{shutdown,
{failed_to_start_child,
{httpd_manager,{127,0,0,1},60152,default},
{error,
{invalid_option,
{non_existing,{document_root,"/tmp/htdocs"}}}}}},
{child,undefined,
{httpd_instance_sup,{127,0,0,1},60152,default},
{httpd_instance_sup,start_link,
[[{port,60152},
{bind_address,{127,0,0,1}},
{server_name,"httpd_test"},
{server_root,"/tmp"},
{document_root,"/tmp/htdocs"}],
15000,
{<0.73.0>,#Port<0.904>},
[]]},
permanent,infinity,supervisor,
[httpd_instance_sup]}}}
3>
document_root is an invalid option? Okay, I'll check the list of valid options and correct the mistake in the example....hmmmm, there doesn't seem to be one.
Okay, I needed to do this:
$ cd /tmp
$ mkdir htdocs
Now, I'm trying to bind to an ipv6 version of localhost, but I'm having no luck. The httpd docs say:
{bind_address, ip_address() | hostname() | any}
and ip_address() is defined as:
ip_address() = {N1,N2,N3,N4} % IPv4 | {K1,K2,K3,K4,K5,K6,K7,K8} % IPv6
but N and K are not defined. If N is an integer, what is a K? I tried:
{bind_address, {0,0,0,0,0,0,0,1}}
but I got an error:
$ erl
Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V8.2 (abort with ^G)
1> inets:start().
ok
2> inets:start(httpd, [{port, 0}, {server_name, "httpd_test"}, {server_root, "."}, {document_root, "./htdocs"}, {bind_address,{0,0,0,0,0,0,0,1}}]).
{error,{listen,{exit,badarg}}}
Yet, with an ipv4 address everything works as expected:
3> inets:start(httpd, [{port, 0}, {server_name, "httpd_test"}, {server_root, "."}, {document_root, "./htdocs"}, {bind_address,{127,0,0,1}}]).
{ok,<0.74.0>}
4> httpd:info(pid(0,74,0)).
[{mime_types,[{"htm","text/html"},{"html","text/html"}]},
{server_name,"httpd_test"},
{bind_address,{127,0,0,1}},
{server_root,"."},
{port,63069},
{document_root,"./htdocs"}]
5> httpc:request("http://localhost:63069/file1.txt").
{ok,{{"HTTP/1.1",200,"OK"},
[{"date","Mon, 26 Feb 2018 03:02:33 GMT"},
{"etag","nCZT0114"},
{"server","inets/6.3.4"},
{"content-length","14"},
{"content-type","text/plain"},
{"last-modified","Mon, 26 Feb 2018 02:51:52 GMT"}],
"Hello, world!\n"}}
/ets/hosts:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
Next, I tried {bind_address, any}:
$ erl
Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V8.2 (abort with ^G)
1> inets:start().
ok
2> {ok, Server} = inets:start(httpd, [{port, 0}, {server_name, "httpd_test"}, {server_root, "."}, {document_root, "./htdocs"}, {bind_address, any}]).
{ok,<0.72.0>}
3> httpd:info(Server).
[{mime_types,[{"htm","text/html"},{"html","text/html"}]},
{server_name,"httpd_test"},
{bind_address,any},
{server_root,"."},
{port,63679},
{document_root,"./htdocs"}]
But, I can't perform a get request with an ipv6 address:
4> httpc:request("http://[::1]:63679/file1.txt").
{error,{failed_connect,[{to_address,{"::1",63679}},
{inet,[inet],nxdomain}]}}
5> httpc:request("http://127.0.0.1:63679/file1.txt").
{ok,{{"HTTP/1.1",200,"OK"},
[{"date","Mon, 26 Feb 2018 03:13:35 GMT"},
{"etag","nCZT0114"},
{"server","inets/6.3.4"},
{"content-length","14"},
{"content-type","text/plain"},
{"last-modified","Mon, 26 Feb 2018 02:51:52 GMT"}],
"Hello, world!\n"}}
Okay, I solved the error I got when I tried to bind the server to an ipv6 address: I needed to specify the option {ipfamily, inet6}:
inets:start(httpd, [{port, 0},
{server_name, "httpd_test"},
{server_root, "."},
{document_root, "./htdocs"},
{ipfamily, inet6},
{bind_address,{0,0,0,0,0,0,0,1}}]).
However, my httpc:request() still fails:
4> httpd:info(Server).
[{mime_types,[{"htm","text/html"},{"html","text/html"}]},
{ipfamily,inet6},
{server_name,"httpd_test"},
{bind_address,{0,0,0,0,0,0,0,1}},
{server_root,"."},
{port,51284},
{document_root,"./htdocs"}]
5> httpc:request("http://[::1]:51284/file1.txt").
{error,{failed_connect,[{to_address,{"::1",52489}},
{inet,[inet],nxdomain}]}
I can use curl to make a get request with an ipv6 address:
~$ curl -v "http://[::1]:52489/file1.txt"
* Trying ::1...
* TCP_NODELAY set
* Connected to ::1 (::1) port 52489 (#0)
> GET /file1.txt HTTP/1.1
> Host: [::1]:52489
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Mon, 26 Feb 2018 05:07:07 GMT
< Server: inets/6.3.4
< Content-Type: text/plain
< Etag: nCZT0114
< Content-Length: 14
< Last-Modified: Mon, 26 Feb 2018 02:51:52 GMT
<
Hello, world!
* Connection #0 to host ::1 left intact
That leads me to believe that httpc:request() is having trouble with the ipv6 address.
Okay, I tried to configure the client for ipv6:
1> inets:start().
ok
2> {ok, Client} = inets:start(httpc, [{profile, client1_config}] ).
{ok,<0.72.0>}
3> Client.
<0.72.0>
7> httpc:set_options([{ipfamily, inet6}], client1_config).
ok
Fingers crossed....
8> httpc:request("http://[::1]:52489/file1.txt", client1_config).
{error,
{failed_connect,
[{to_address,{"::1",52489}},
{inet6,[inet6],nxdomain}]}}
Then I tried (spacing added by me for legibility):
9> httpc:request(
get,
"http://[::1]:52489/file1.txt",
[],
[{ipv6_host_with_brackets, true}],
client1_config
).
** exception error: no function clause matching httpc:request(get,"http://[::1]:52489/file1.txt",[],
[{ipv6_host_with_brackets,true}],
client1_config) (httpc.erl, line 149)
The error makes no sense to me. There is a five arg version of httpc:request(), and I've carefully checked the types of all the args, and my types are correct:
httpc:request(atom, string, list_of_tuples, list_of_tuples, atom)
Okay, the second argument is actually a tuple: {string, []}. Here's where I'm at now with the server:
7> httpd:info(Server).
[{mime_types,[{"htm","text/html"},{"html","text/html"}]},
{ipfamily,inet6},
{server_name,"httpd_test"},
{bind_address,{0,0,0,0,0,0,0,1}},
{server_root,"."},
{port,53686},
{document_root,"./htdocs"}]
And the client:
32> httpc:get_options(all, client1_config).
{ok,[{proxy,{undefined,[]}},
{https_proxy,{undefined,[]}},
{pipeline_timeout,0},
{max_pipeline_length,2},
{max_keep_alive_length,5},
{keep_alive_timeout,120000},
{max_sessions,2},
{cookies,disabled},
{verbose,verbose},
{ipfamily,inet6},
{ip,default},
{port,default},
{socket_opts,[]}]}
But my client still can't connect with an ipv6 address. I don't know if I'm supposed to be using the httpc:request() Option {ipv6_host_with_brackets, true} or not, so I've been trying it both ways:
34> httpc:request(get, {"http://[::1]:52489/file1.txt", []}, [], [{ipv6_host_with_brackets, true}], client1_config).
(<0.124.0>) << {dbg,{ok,[{matched,nonode#nohost,1}]}}
(<0.124.0>) << {#Ref<0.0.3.431>,
{ok,<<16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0>>}}
(<0.124.0>) << {inet_async,#Port<0.981>,5,{error,econnrefused}}
(<0.124.0>) << {'EXIT',#Port<0.981>,normal}
(<0.124.0>) << {init_error,error_connecting,
{#Ref<0.0.3.426>,
{error,
{failed_connect,
[{to_address,{"::1",52489}},
{inet6,[inet6],econnrefused}]}}}}
{error,{failed_connect,[{to_address,{"::1",52489}},
{inet6,[inet6],econnrefused}]}}
35> httpc:request(get, {"http://[::1]:52489/file1.txt", []}, [], [], client1_config).
(<0.126.0>) << {dbg,{ok,[{matched,nonode#nohost,1}]}}
(<0.126.0>) << {#Ref<0.0.3.447>,
{ok,<<16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0>>}}
(<0.126.0>) << {inet_async,#Port<0.982>,6,{error,econnrefused}}
(<0.126.0>) << {'EXIT',#Port<0.982>,normal}
(<0.126.0>) << {init_error,error_connecting,
{#Ref<0.0.3.442>,
{error,
{failed_connect,
[{to_address,{"::1",52489}},
{inet6,[inet6],econnrefused}]}}}}
{error,{failed_connect,[{to_address,{"::1",52489}},
{inet6,[inet6],econnrefused}]}}
36> httpc:request(get, {"http://[0:0:0:0:0:0:0:1]:52489/file1.txt", []}, [], [{ipv6_host_with_brackets, true}], client1_config).
(<0.128.0>) << {dbg,{ok,[{matched,nonode#nohost,1}]}}
(<0.128.0>) << {#Ref<0.0.3.463>,
{ok,<<16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0>>}}
(<0.128.0>) << {inet_async,#Port<0.983>,7,{error,econnrefused}}
(<0.128.0>) << {'EXIT',#Port<0.983>,normal}
(<0.128.0>) << {init_error,error_connecting,
{#Ref<0.0.3.458>,
{error,
{failed_connect,
[{to_address,{"0:0:0:0:0:0:0:1",52489}},
{inet6,[inet6],econnrefused}]}}}}
{error,{failed_connect,[{to_address,{"0:0:0:0:0:0:0:1",
52489}},
{inet6,[inet6],econnrefused}]}}
37> httpc:request(get, {"http://[0:0:0:0:0:0:0:1]:52489/file1.txt", []}, [], [], client1_config).
(<0.130.0>) << {dbg,{ok,[{matched,nonode#nohost,1}]}}
(<0.130.0>) << {#Ref<0.0.3.479>,
{ok,<<16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0>>}}
(<0.130.0>) << {inet_async,#Port<0.984>,8,{error,econnrefused}}
(<0.130.0>) << {'EXIT',#Port<0.984>,normal}
(<0.130.0>) << {init_error,error_connecting,
{#Ref<0.0.3.474>,
{error,
{failed_connect,
[{to_address,{"0:0:0:0:0:0:0:1",52489}},
{inet6,[inet6],econnrefused}]}}}}
{error,{failed_connect,[{to_address,{"0:0:0:0:0:0:0:1",
52489}},
{inet6,[inet6],econnrefused}]}}
Okay! I got a client to successfully make a request with an ipv6 address. For all the requests at the bottom of my question, I specified the wrong port. Once I got the client port to match the server port, then all those requests succeeded. Here's my setup:
Server config:
7> httpd:info(Server).
[{mime_types,[{"htm","text/html"},{"html","text/html"}]},
{ipfamily,inet6},
{server_name,"httpd_test"},
{bind_address,{0,0,0,0,0,0,0,1}},
{server_root,"."},
{port,53686},
{document_root,"./htdocs"}]
8>
Client config:
52> httpc:get_options(all, client1_config).
{ok,[{proxy,{undefined,[]}},
{https_proxy,{undefined,[]}},
{pipeline_timeout,0},
{max_pipeline_length,2},
{max_keep_alive_length,5},
{keep_alive_timeout,120000},
{max_sessions,2},
{cookies,disabled},
{verbose,false},
{ipfamily,inet6},
{ip,default},
{port,default},
{socket_opts,[]}]}
53>
And here's the shortest syntax for a request:
53> httpc:request("http://[::1]:53686/file1.txt", client1_config).
{ok,{{"HTTP/1.1",200,"OK"},
[{"date","Mon, 26 Feb 2018 10:21:39 GMT"},
{"etag","nCZT0114"},
{"server","inets/6.3.4"},
{"content-length","14"},
{"content-type","text/plain"},
{"last-modified","Mon, 26 Feb 2018 02:51:52 GMT"}],
"Hello, world!\n"}}
So the httpc:request() Option {ipv6_host_with_brackets, true} isn't required.
When I read the httpc docs, the profile part didn't really register with me. But a profile consists of the configuration options for the client, and it's also where cookies are stored, so you need to include the profile with subsequent requests.
There's a default profile, which I guess automatically gets sent with every request when you don't specify your own profile, and I think the default profile will handle cookies for you. (Nope, not by default. I found the following below the definition for httpc:set_options():
CookieMode = enabled | disabled | verify
If cookies are enabled, all
valid cookies are automatically saved in the cookie database of the
client manager. If option verify is used, function store_cookies/2 has
to be called for the cookies to be saved. Default is disabled.
You can also add configuration options to the default profile.
But if you need to use a configuration like ipv6 for some requests and not others, then you can create a named profile and use the named profile when needed in your httpc:request()'s and the default profile for other requests (by not specifying a named profile). See httpc:set_options() for the client configuration options. Somewhat confusingly, httpc:request() has an Options argument, which allows you to specify other options (look in the docs below the definition of httpc:request/5 for a list of those options). Some of the request Options, like sync and stream, seem to be more appropriate for a profile:
A profile keeps track of proxy options, cookies, and other options
that can be applied to more than one request.
http://erlang.org/doc/man/httpc.html
If you create a profile by calling inets:start(httpc, profile_name), the return value is the Pid of the client, which gets spun off in a separate process and handles requests when using that profile. You can kill the client with either of the following:
inets:stop(httpc, name_of_profile)
inets:stop(httpc, ClientPid)

Erlang/OTP app using rebar returns crash dump when releasing

I followed the tutorial many times and, created a small app using rebar and release it successfully. But when I come to the main application (calendarApp), crash dump was returned. I made some changes but the result is the same. I would like to know what I am doing wrong, and how I can fix this.
At the end, when I do start and attach, it returns "Node is not running!".
I will show you:
sonu#sonu-Ideapad-Z570:~/calendarApp/rel$ ./calendarApp/bin/calendarApp console
Exec: /home/sonu/release/calendarApp/rel/calendarApp/erts-5.10.4/bin/erlexec -boot /home/sonu/release/calendarApp/rel/calendarApp/releases/1/calendarApp -mode embedded -config /home/sonu/release/calendarApp/rel/calendarApp/releases/1/sys.config -args_file /home/sonu/release/calendarApp/rel/calendarApp/releases/1/vm.args -- console
Root: /home/sonu/release/calendarApp/rel/calendarApp
Erlang R16B03 (erts-5.10.4) [source] [smp:4:4] [async-threads:10] [kernel-poll:false]
{global,calendarApp_sup} (<0.216.0>) starting....
{global,calendarApp_server} (<0.217.0>) starting ......
Eshell V5.10.4 (abort with ^G)
(calendarApp#127.0.0.1)1>
=INFO REPORT==== 19-Jan-2016::09:50:45 ===
application: calendarApp
exited: {{shutdown,
{failed_to_start_child,calendarApp_server,
{undef,
[{mnesia,create_schema,
[['calendarApp#127.0.0.1']],
[]},
{calendarApp_db,init,0,
[{file,"src/calendarApp_db.erl"},{line,7}]},
{calendarApp_server,init,1,
[{file,"src/calendarApp_server.erl"},{line,49}]},
{gen_server,init_it,6,
[{file,"gen_server.erl"},{line,304}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}}},
{calendarApp_app,start,[normal,[]]}}
type: permanent
{"Kernel pid terminated",application_controller," {application_start_failure,calendarApp,{{shutdown,{failed_to_start_child,calendarApp_server,{undef,[{mnesia,create_schema,[['calendarApp#127.0.0.1']],[]},{calendarApp_db,init,0,[{file,\"src/calendarApp_db.erl\"},{line,7}]},{calendarApp_server,init,1,[{file,\"src/calendarApp_server.erl\"},{line,49}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,304}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,239}]}]}}},{calendarApp_app,start,[normal,[]]}}}"}
Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,calendarApp,{{shutdown,{failed_to_start_child,calendarApp_server,{undef,[{mnesia,create_schema, [['calendarApp#127.0.0.1']],
sonu#sonu-Ideapad-Z570:~/calendarApp/rel$ ./calendarApp/bin/calendarApp console
If anyone knows the problem, please help me to fix this.

Erlang - Is it possible to limit the ram consumption when using disc copies in Mnesia?

I have a 4GB ram in my system and it used 2GB of ram before the insertion completed wen using disc_copies. I was wondering what would happen if 100 percent of the ram was consumed? Is there any option to limit the ram consumed during disc_copies, like limiting the ram usage to 2GB?
If you are looking how to limit erlang VM memory usage you should use control groups for it. But if you like to monitor memory usage you should use memory monitor memsup from os_mon application.
$ erl -boot start_sasl
Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
...
=PROGRESS REPORT==== 22-Oct-2015::22:39:46 ===
application: sasl
started_at: nonode#nohost
Eshell V7.0 (abort with ^G)
1> application:start(os_mon).
...
=PROGRESS REPORT==== 22-Oct-2015::22:40:03 ===
application: os_mon
started_at: nonode#nohost
ok
2>
...
2> memsup:get_memory_data().
{8162500608,6514708480,{<0.7.0>,426616}}
3> memsup:get_system_memory_data().
[{system_total_memory,8162500608},
{free_swap,5996748800},
{total_swap,5997850624},
{cached_memory,3290759168},
{buffered_memory,444370944},
{free_memory,1647222784},
{total_memory,8162500608}]
4>
Read os_mon documentation about usage and alarms.

How to properly mock riakc_pb_socket with meck?

Using Erlang R16B02, riakc 2.0.0 and meck 0.82:
When trying to mock riakc_pb_socket in my unit tests it blows up. Here's what I get:
> erl -pa ebin deps/*/ebin
Erlang R16B02 (erts-5.10.3) [source-b44b726] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V5.10.3 (abort with ^G)
1> meck:new(riakc_pb_socket).
** exception exit: {compile_forms,{error,[{[],
[{75,erl_lint,{bad_deprecated,{get_index,'_'}}}]}],
[{[],[{75,erl_lint,{undefined_behaviour,[gen_server]}}]}]}}
2>
I found that if I comment this line in riakc_pb_socket.erl and recompile - the problem goes away. Is there a better solution?
-deprecated({get_index,'_', eventually}).
so afterwards....
> erl -pa ebin deps/*/ebin
Erlang R16B02 (erts-5.10.3) [source-b44b726] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V5.10.3 (abort with ^G)
1> meck:new(riakc_pb_socket).
ok
2>
> erl -pa ebin deps/*/ebin
Erlang R16B02 (erts-5.10.3) [source-b44b726] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V5.10.3 (abort with ^G)
1> code:which(riakc_pb_socket).
"deps/riakc/ebin/riakc_pb_socket.beam"
2>

RabbitMQ setting memory limit too low

I get this message when launching RabbitMQ:
=WARNING REPORT==== 8-Feb-2014::10:43:42 ===
Only 2048MB of 23482MB memory usable due to limited address space.
Crashes due to memory exhaustion are possible - see
http://www.rabbitmq.com/memory.html#address-space
When I follow that link, I read about how I should be using a 64-bit Erlang VM. But:
ajax:~ maxvitek$ erl
Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Eshell V5.10.4 (abort with ^G)
1>
...which certainly appears to be a 64-bit build. This is with the vm_memory_high_watermark set to 1. If I can get rid of the memory address problem so that RabbitMQ could use more of the system's memory, I will set that back to 0.4. Any idea where to look to fix this?
Both Erlang and RabbitMQ are installed via Homebrew, running on Mavericks.

Resources