auser / alice Goto Github PK
View Code? Open in Web Editor NEWMonitoring and REST interface to rabbitmq
Home Page: http://alicetheapp.com/
License: MIT License
Monitoring and REST interface to rabbitmq
Home Page: http://alicetheapp.com/
License: MIT License
I am using a FreeBSD 7.3 OS.
(cd ebin; erl -pa -pa ebin -noshell -run make_boot write_scripts alice)
{"init terminating in do_boot",{undef,[{make_boot,write_scripts,[["alice"]]},{init,start_it,1},{init,start_em,1}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
*** Error code 1
Stop in /home/daryl/public_html/alice.
{"init terminating in do_boot",{'cannot get bootfile','alice.boot'}}
Crash dump was written to: erl_crash.dump
If I then just run the 'make boot' command I still get the error:
(cd ebin; erl -pa -pa ebin -noshell -run make_boot write_scripts alice)
{"init terminating in do_boot",{undef,[{make_boot,write_scripts,[["alice"]]},{init,start_it,1},{init,start_em,1}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
*** Error code 1
rabbitmq is running and operational so I am unsure as to what the problem is??
I'm getting this error with v. 1.7.0 using the default configuration. Which gives guest read/write permissions:
curl -i http://localhost:9999/permissions/
curl: (52) Empty reply from server
In the erlang console:
Error: {json_encode,{bad_term,{<<"guest">>,<<".">>,<<".">>,<<".*">>}}}
=CRASH REPORT==== 27-Jan-2010::22:16:44 ===
crasher:
pid: <0.83.0>
registered_name: []
exception error: bad argument
in function iolist_size/1
called as iolist_size({permissions,
{struct,
[{vhosts,
[{struct,
[{"name",<<"/">>},
{"users",
[{struct,
[{"name",
{<<"guest">>,<<".">>,<<".">>,
<<".">>}},
{"configure",<<".">>},
{"write",<<".">>},
{"read",<<".">>}]}]}]}]}]}})
in call from mochiweb_request:respond/2
in call from mochiweb_http:headers/5
initial call: mochiweb_socket_server:acceptor_loop/1
ancestors: [mochiweb_http,rest_server,rest_server_sup,<0.57.0>,<0.56.0>]
messages: []
links: [<0.68.0>,#Port<0.832>]
dictionary: []
trap_exit: false
status: running
heap_size: 610
stack_size: 23
reductions: 906
neighbours:
=ERROR REPORT==== 27-Jan-2010::22:16:44 ===
{mochiweb_socket_server,235,{child_error,badarg}}
However, running:
curl -i http://localhost:9999/permissions/vhost/root works ok.
In a test scenario with a fanout exchange and a single consumer queue, if I use the root vhost, I can hit the REST interface's /exchanges, /queues, and /bindings and get reasonable-looking results from each. If I create a vhost named "test" and use that, /bindings/test works ok:
curl -i http://172.16.200.99:9999/bindings/test
...
{"bindings":[{"queue":"consumer_recv","exchange":"","from_queue":"consumer_recv"},{"queue":"consumer_recv","exchange":"testroom","from_queue":"none"}]}
But /exchanges/test doesn't work at all:
curl -i http://172.16.200.99:9999/exchanges/test
...
{"error":"unhandled"}
And /queues/test produces this:
curl -i http://172.16.200.99:9999/queues/test
...
{"queues":[{}]}
Is the REST API supposed to give full access to bindings, queues, and exchanges in non-root vhosts? Is suffixing the vhost name the correct way to access them?
It would be great if you could add in the Readme or on the wiki some docs about the environment setup to correctly compile the application.
Starting from a standard install of ubuntu it seems that it only compiles mochiweb but not anything related to alice
Here's the output, it seems is not picking up anything to compile in directory others than deps.
Feels like it's not finding make_boot but I'm new to erlang and I can't work out how to fix it.
make[1]: Entering directory `/home/blank/personal/alice/deps/mochiweb' (cd src;make all) make[2]: Entering directory `/home/blank/personal/alice/deps/mochiweb/src' erlc -W -I ../include +debug_info -o ../ebin mochifmt.erl erlc -W -I ../include +debug_info -o ../ebin mochifmt_records.erl erlc -W -I ../include +debug_info -o ../ebin mochifmt_std.erl erlc -W -I ../include +debug_info -o ../ebin mochihex.erl erlc -W -I ../include +debug_info -o ../ebin mochijson2.erl erlc -W -I ../include +debug_info -o ../ebin mochijson.erl erlc -W -I ../include +debug_info -o ../ebin mochinum.erl erlc -W -I ../include +debug_info -o ../ebin mochiweb_app.erl erlc -W -I ../include +debug_info -o ../ebin mochiweb_charref.erl erlc -W -I ../include +debug_info -o ../ebin mochiweb_cookies.erl erlc -W -I ../include +debug_info -o ../ebin mochiweb_echo.erl erlc -W -I ../include +debug_info -o ../ebin mochiweb.erl erlc -W -I ../include +debug_info -o ../ebin mochiweb_headers.erl erlc -W -I ../include +debug_info -o ../ebin mochiweb_html.erl erlc -W -I ../include +debug_info -o ../ebin mochiweb_http.erl erlc -W -I ../include +debug_info -o ../ebin mochiweb_multipart.erl erlc -W -I ../include +debug_info -o ../ebin mochiweb_request.erl erlc -W -I ../include +debug_info -o ../ebin mochiweb_response.erl erlc -W -I ../include +debug_info -o ../ebin mochiweb_skel.erl erlc -W -I ../include +debug_info -o ../ebin mochiweb_socket_server.erl erlc -W -I ../include +debug_info -o ../ebin mochiweb_sup.erl erlc -W -I ../include +debug_info -o ../ebin mochiweb_util.erl erlc -W -I ../include +debug_info -o ../ebin reloader.erl make[2]: Leaving directory `/home/blank/personal/alice/deps/mochiweb/src' make[1]: Leaving directory `/home/blank/personal/alice/deps/mochiweb' (cd ebin; erl -pa ebin -noshell -run make_boot write_scripts rest_app) {"init terminating in do_boot",{undef,[{make_boot,write_scripts,[["rest_app"]]},{init,start_it,1},{init,start_em,1}]}} Crash dump was written to: erl_crash.dump init terminating in do_boot () make: *** [make_boot] Error 1
$ curl -i "http://localhost:9999/users/nonexisting"
returns: "curl: (52) Empty reply from server"
And the following error in Alice shell:
(alice@pipeline)1> Error: {function_clause,
[{mochijson2,'-json_encode_proplist/2-fun-0-',
[{ok,400,[],{"nonexisting",<<"not a user">>}},
"{",
{encoder,null,false}]},
{lists,foldl,3},
{mochijson2,json_encode_proplist,2},
{rest_server,jsonify,1},
{rest_server,run_controller,4},
{mochiweb_http,headers,5},
{proc_lib,init_p_do_apply,3}]}=CRASH REPORT==== 3-May-2010::00:51:02 ===
crasher:
initial call: mochiweb_socket_server:acceptor_loop/1
pid: <0.147.0>
registered_name: []
exception error: bad argument
in function iolist_size/1
called as iolist_size({ok,400,[],{"nonexisting",<<"not a user">>}})
in call from mochiweb_request:respond/2
in call from mochiweb_http:headers/5
ancestors: [mochiweb_http,rest_server,rest_server_sup,<0.59.0>,<0.58.0>]
messages: []
links: [<0.70.0>,#Port<0.892>]
dictionary: []
trap_exit: false
status: running
heap_size: 987
stack_size: 24
reductions: 888
neighbours:=ERROR REPORT==== 3-May-2010::00:51:02 ===
{mochiweb_socket_server,235,{child_error,badarg}}
An identical behavior can be seen with /vhosts/nonexisting
I have Alice and Wonderland both up and running, and I am noticing
that all of the REST resources are working great with the exception of
the queues resource.
Using curl:
root@sfqload01 /var/lib/rabbitmq
$ curl -i http://localhost:9999/queues
HTTP/1.1 200 OK
Server: MochiWeb/1.0 (Any of you quaids got a smint?)
Date: Wed, 17 Feb 2010 08:04:58 GMT
Content-Type: text/json
Content-Length: 13
{"queues":[]}
root@sfqload01 /var/lib/rabbitmq
So Wonderland obviously shows an empty page. But when i query
rabbitmqctl directly I can see the output that I would like to see via
Alice:
root@sfqload01 /var/lib/rabbitmq
$ rabbitmqctl list_queues -p /nanite memory name messages_unacknowledged messages
Listing queues ...
6056 mapper-15e44eb68b0841a9098bac4fbad56a2d 0 0
9432 registration 0 0
6056 mapper-46f4166745cf57fe1b6e8d55885614ec 0 0
2915112 nanite-b 5 1476
1802424 nanite-a 6 1368
9432 request 0 0
9432 mapper-offline 0 0
19192 heartbeat 0 0
...done.
root@sfqload01 /var/lib/rabbitmq
Add logging to a configurable log file
The init.d scripts require a standard method to start Alice. Since multiple RabbitMQ brokers can be started on different ports, we also need to be able to start multiple Alice instances on different ports.
For example:
alice.sh start -n [email protected] -port 9001 -log /var/log/alice
alice.sh start -n [email protected] -port 9002 -log /var/log/alice
Log files should not overlap, similar to the RabbitMQ logs
I had some PMs open talking to people, then I closed the window and returned later and all my PMs were moved to the leftmost tabs. I would think that leaving the layout just how I left it would be the desired behavior.
I don't know if this is by design or not, so maybe it's a good thing to have them all move to the left to force me to clean them out when I reconnect, heh.
Assuming we have multiple Alice instances, something similar to the 'stop' and 'start' commands would be useful.
For example:
rabbitmqctl status -n [email protected]
alice.sh status -n [email protected]
I also got the message from start.sh about not being able to find alice.boot, which was mentioned in a comment on another ticket.
Can anyone explain in more detail how this can be fixed, as I have no Erlang knowledge?
Running "make wonderland" attempts to pull from the private wonderland repo, not the public one. I'd love to submit a patch here (it's an easy fix), but I'm not really sure how. Also, I don't feel like forking and issuing a pull request for something so simple :-)
Alice hangs when I try adding a user with:
curl -i -XPOST -d'{"username":"n8gray", "password":"blah"}' http://locahost:9999/users
The "ebeam.smp" process starts taking 40% of my cpu and doesn't stop until I abort the alice process. Nothing interesting comes up in the rabbitmq logs
I'm using OS X 10.5.7 on an Intel mac. Some more version strings:
Erlang R13B01 (erts-5.7.2) [source] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false]
RabbitMQ 1.6.0 (AMQP 8-0)
git head of alice (8aa4f43)
Thanks,
-n8
Request to add a new section, under Dashboard, to manage Nodes. Overall we need a good mechanism to handle Node maintenance, without involving AppSupport. This can also help with integration with load balancers, such as F5.
The features requested:
(1) Health OK / Not OK
This should be automatic, but it should be settable via manual override, via a UI checkbox. If a Node is OK, health is OK, if the Node is down health is 404.
Health is provided via the following example URL: http://np143.wc1.yellowpages.com:5671/health
The purpose is to notifiy external load-balancers, such as F5, that traffic should not be routed to this node. F5 can be configured to check both a URL and a TCP port to determine if a monitored service is available.
So, an admin user might set this to "Not OK" in order to bring the node down for maintenance in a graceful manner. Existing AMQP clients would continue to stay connected until they complete their task. But the F5 would not direct new clients to connect to this node.
Always though, if the AMQP service dies, then Alice should detect this condition and also set the Health to Not OK.
(2) Node Up / Down
This should trigger the rabbitmqctl stop_app and start_app methods. These manually start and stop the AMQP service itself on port 5672. Erlang continues to run. Also, if an AMQP port is down, the health check should automatically get set to "Not OK"
(3) Node traversal
The UI should provide html links, which make it easy to traverse from Node to Node.
I am exploring rabbitmq and alice/wonderland, everything works great except for accessing permissions from alice/wonderland. When I try the permissions link in wonderland or via rest in alice it fails. Here is the report from it. Unfortunately know too little about erlang to have a clue.
=CRASH REPORT==== 6-Oct-2009::14:14:30 ===
crasher:
pid: <0.80.0>
registered_name: []
exception error: no function clause matching
lists:map(#Fun<permissions.1.43242716>,
{badrpc,
{'EXIT',
{undef,
[{rabbit_access_control,list_vhost_users,
[<<"/">>]},
{rpc,'-handle_call/3-fun-0-',5}]}}})
in function permissions:'-get/1-fun-1-'/1
in call from lists:map/2
in call from permissions:get/1
in call from rest_server:handle/2
in call from mochiweb_http:headers/5
initial call: mochiweb_socket_server:acceptor_loop/1
ancestors: [mochiweb_http,rest_server,rest_server_sup,<0.56.0>,<0.55.0>]
messages: []
links: [<0.67.0>,#Port<0.863>]
dictionary: [{mochiweb_request_path,"/permissions"}]
trap_exit: false
status: running
heap_size: 6765
stack_size: 23
reductions: 2139
neighbours:
i have the problem when i exe start.sh.
both in macxOS and linux.
the bindings view is blank, despite the /bindings/vhost call working on the rest interface.
trying to view info on a vhost specified with a leading slash (rabbitmqctl add_vhost "/foo") is borken.
'make' produces several warnings:
[root@q1 auser-alice-581132a670c48be183fc34eec7e6ec6e44b7ac2c]# make
make[1]: Entering directory `/root/auser-alice-
581132a/deps/mochiweb'
(cd src;make all)
make[2]: Entering directory `/root/auser-alice-581132a670c48be183fc34eec7e6ec6e44b7ac2c/deps/mochiweb/src'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/auser-alice-581132a670c48be183fc34eec7e6ec6e44b7ac2c/deps/mochiweb/src'
make[1]: Leaving directory `/root/auser-alice-581132a670c48be183fc34eec7e6ec6e44b7ac2c/deps/mochiweb'
(cd ebin; erl -pa ebin -noshell -run make_boot write_scripts rest_app)
write_scripts for "rest_app"
Writing to "rest_app.rel" (as rest_app)
WARNING rest_app: Source code not found: alice_log.erl
WARNING rest_app: Source code not found: rest_app.erl
WARNING rest_app: Source code not found: rest_server.erl
On the Wonderland Users UI, we noticed the default behavior to delete a user, when the user is clicked, is a risky. It will be too easy for a person, to accidentally click "OK". What is probably better is if the click opens a window, with two options. One option is to change the user's password, the other option is to delete the user. Changing a user's password is probably a likely Admin task.
Same feedback applies to the VHost UI.
This is a small issue but may affect some users.
In the event that a user does not have git installed on the system, typing 'make wonderland' will return an error:
[root@q1 auser-alice-8a1a9ffdfe19b95116f9ff9eb0c32a0ea2621b43]# make wonderland
[ -d web//wonderland ] || (mkdir web/ && cd web/ && git clone git://github.com/auser/wonderland.git)
/bin/sh: git: command not found
However, it will go ahead and create web/. This is a problem because the next time 'make wonderland' is run, it will error because web/ already exists:
[root@q1 auser-alice-8a1a9ffdfe19b95116f9ff9eb0c32a0ea2621b43]# make wonderland
[ -d web//wonderland ] || (mkdir web/ && cd web/ && git clone git://github.com/auser/wonderland.git)
mkdir: cannot create directory `web/': File exists
make: *** [wonderland] Error 1
Hi,
I'm getting an error when trying to get connections. Other alice requests work.
curl -i http://localhost:9999/conn HTTP/1.1 404 Object Not Found Server: MochiWeb/1.0 (Any of you quaids got a smint?) Date: Thu, 24 Feb 2011 15:59:41 GMT Content-Type: text/plain Content-Length: 10 Not found.
with Alice showing
=INFO REPORT==== 24-Feb-2011::15:59:41 === (rest_server:232) Error in rest server: {{case_clause, {client_properties, [{<<"information">>,longstr, <<"http://github.com/tmm1/amqp">>}, {<<"product">>,longstr,<<"AMQP">>}, {<<"platform">>,longstr, <<"Ruby/EventMachine">>}, {<<"version">>,longstr, <<"0.6.7">>}]}}, [{conn,convert_prop_for_json,1}, {lists,map,2}, {lists,map,2}, {conn,'-get/1-fun-0-',1}, {lists,map,2}, {conn,get,1}, {rest_server,run_controller,4}, {mochiweb_http,headers,5}]}
I'm connecting to rabbitmq using the Ruby amqp gem.
rabbitmqct list_connections shows what's connected
rabbitmqctl list_connections Listing connections ... guest 127.0.0.1 44237 running guest 127.0.0.1 50008 running
After not finding the bootfile:
$ ./start.sh
(cd ebin; erl -pa ebin -noshell -run make_boot write_scripts alice)
{"init terminating in do_boot",{undef,[{make_boot,write_scripts,[["alice"]]},{init,start_it,1},{init,start_em,1}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
make: *** [boot] Error 1
{"init terminating in do_boot",{'cannot get bootfile','alice.boot'}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
I tried creating it as suggested in the Common Problems but ran into:
$ make boot
(cd ebin; erl -pa ebin -noshell -run make_boot write_scripts alice)
{"init terminating in do_boot",{undef,[{make_boot,write_scripts,[["alice"]]},{init,start_it,1},{init,start_em,1}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
make: *** [boot] Error 1
Any hints whats going wrong?
Trying to list queues via wonderland, I get such an error in alice:
=INFO REPORT==== 7-Sep-2010::14:52:32 ===
(rest_server:232) Error in rest server: {function_clause,
[{lists,map,
[#Fun<queues.0.39488572>,
{badrpc,
{'EXIT',
{undef,
[{rabbit_amqqueue,info_all,
[<<"/">>,
[name,durable,auto_delete,
arguments,messages_ready,
messages_unacknowledged,
messages_uncommitted,
messages,acks_uncommitted,
consumers,transactions,
memory]]},
{rpc,local_call,3},
{queues,get_info_for,2},
{queues,get_impl,1},
{rest_server,run_controller,4},
{mochiweb_http,headers,5},
{proc_lib,init_p_do_apply,
3}]}}}]},
{queues,get_impl,1},
{rest_server,run_controller,4},
{mochiweb_http,headers,5},
{proc_lib,init_p_do_apply,3}]}
$ /usr/sbin/rabbitmqctl list_vhosts
Listing vhosts ...
/
celery_test
...done.
What am I doing wrong? How can it be fixed? Give me a note if you need more information.
when i use curl -i http://localhost:9999/conn
the respond is
curl: (52) Empty reply from server
who can tell me the possiabe reasons?thanks very much.
Currently the alice log is named "alice.log". This creates a problem, when or if, multiple Alice instances are running. Ideally Alice will name its log files similar to RabbitMQ.
For example:
alice@[email protected]
Assuming we have multiple Alice instances, running on different ports. We require a method to stop a unique instance. This is for usage with the init.d scripts. Something similar to the rabbitmqctl commands would be nice.
For example:
alice.sh stop -n [email protected]
This would allow combining the Alice admin stop command with the corresponding RabbitMQ stop command:
rabbitmqctl stop_app -n [email protected]
alice.sh stop -n [email protected]
The UI visually looks pretty cool. But I think the Wonderland Dashboard could be designed to be more scalable. What happens when there are ten, twenty or even hundreds of queues, vhosts or exchanges.
I think it would be better to have an initial global or sum total perspective. I also liked the original dashboard information, which contained the "running nodes". So, I think it would be better if initially the user saw a globals dashboard, showing the cluster running nodes, the total memory used, total number of queues, total number of Vhosts, etc.
But, make each item such as queues or vhosts clickable. When the user clicks on Vhosts they would then see a list of Vhosts, with total memory and total messages for each. Each of the individual Vhosts would also be clickable.
The second click, opens the Vhost and shows a list of queues, with name, memory, messages, consumers, unacknowledged.
This could be implemented internally by having the following APIs:
curl -i http://localhost:9999/dashboard/dashboard
curl -i http://localhost:9999/dashboard/dashboard/vhost/LOLcats
curl -i http://localhost:9999/dashboard/dashboard/vhost/LOLcats/cats_queue
What do you think?
Running ./start.sh I get the following:
=PROGRESS REPORT==== 19-Nov-2009::11:11:41 ===
application: alice
started_at: '[email protected]'
Eshell V5.6.3 (abort with ^G)
=ERROR REPORT==== 19-Nov-2009::11:10:18 ===
Lost connection with rabbitmq_server. Trying to regain connection to '[email protected]'
=ERROR REPORT==== 19-Nov-2009::11:10:23 ===
Error in process <0.113.0> on node '[email protected]' with exit value:
{badarg,[{erlang,list_to_existing_atom,["rabbit@h8"]},{dist_util,recv_challenge,1},
{dist_util,handshake_we_started,1}]}
Any idea what this could be? rabbit@h8 is definitely running, alive and well.
Using RabbitMQ 1.7.0
Need scripts to start, stop, reload and status Alice. Also scripts to assist with logrotate, via logrotate.d.
A RabbitMQ installation provides such scripts for RabbitMQ, so providing similar scripts for Alice would assist with integration.
Alice integration with the logrotate command would be useful, during installation. The 1.6.0 release of RabbitMQ, provides a pre-built installed /etc/logrotate.d script. RabbitMQ also provides a logrotate command:
rabbitmqctl -n [email protected] log_rotate [spec]
Something similar for Alice would be quite useful. Also, the logrotate dateext and gzip compress options would be nice too.
Management has made a request to configure a read-only mode for the Wonderland GUI web interface.
We use the RESTful interface to make updates for our deployment scripts. Likewise Wonderland is very useful to look at the state of VHosts and queues.
But, since there is no authentication, people are concerned that either a malicious or even a casual browser might not understand that 'delete' user x or 'delete' vhost y is not a good idea. Although the action is logged it could still cause a lot of havoc, especially since the configuration is not backed up.
Therefore, it would be useful to be able to start Wonderland in a read-only mode. In this mode, updates such as delete, would not be allowed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.