vision5 / ngx_mongo Goto Github PK
View Code? Open in Web Editor NEWNon-blocking upstream module for Nginx to connect to MongoDB
License: Other
Non-blocking upstream module for Nginx to connect to MongoDB
License: Other
hello,mclyne
Recently I was looking at this ngx_mongo module and found this module didn't have update for mongodb, if fllow the mongo syntax, and set keyword conflict with nginx variables .
could you share some for example about update ?
Hi!
We tried to use this software but unfortunately it didn't work. As I'm newbie in linux world, I'm not sure if I did something wrong or there is a bug in the software.
We're trying to request mongodb through nginx web server equipped with this module.
While one can see JSON in http response, it gets suddenly cut in the middle. But even the delivered portion of JSON contains some junk characters and is thus damaged.
Following message appears in the log:
2012/11/22 12:15:23 [error] 2616#0: *32 mongo_json: received last_buf while still processing BSON while sending to client, client: 10.32.33.156, server: localhost, request: "POST /query HTTP/1.1", upstream: "mongodb://127.0.0.1:27017", host: "nginx.bla-bla.com"
The same request in mono console works just fine and shows no junk characters.
We use
debian 6.0.6
nginx 1.2.5
mongodb 2.2.1
I get the following error when I do make
over the nginx source (after ./configure --add-module=../ngx_mongo
):
-o objs/addon/src/ngx_http_mongo_module.o \
../ngx_mongo/src/ngx_http_mongo_module.c
../ngx_mongo/src/ngx_http_mongo_module.c: In function ‘ngx_http_mongo_create_predefined_request’:
../ngx_mongo/src/ngx_http_mongo_module.c:681:28: error: variable ‘mctx’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/src/ngx_http_mongo_module.o] Error 1
make[1]: Leaving directory `/home/****/src/nginx-1.3.14'
make: *** [build] Error 2
I'm using Ubuntu 12.10 and the development version of Nginx 1.3.14
over Ubuntu 12.10
For some reason, nginx will not compile with this module and keeps complaining that the libyajl module is not found.
the following response is given for dpkg -L libyajl-dev:
/.
/usr
/usr/lib
/usr/lib/libyajl_s.a
/usr/include
/usr/include/yajl
/usr/include/yajl/yajl_parse.h
/usr/include/yajl/yajl_gen.h
/usr/include/yajl/yajl_common.h
/usr/include/yajl/yajl_version.h
/usr/share
/usr/share/doc
/usr/share/doc/libyajl-dev
/usr/share/doc/libyajl-dev/copyright
/usr/lib/libyajl.so
/usr/share/doc/libyajl-dev/README
/usr/share/doc/libyajl-dev/TODO
/usr/share/doc/libyajl-dev/changelog.Debian.gz
I've even tried moving the yajl/ folder to /usr/loca/lib/ and the likes. :S ... any help?
@renatop7 posted this in another issue:
Hi, I have an interest too in this module.
I tried to add it to nginx but I get the error:
"ngx_mongo works only on little endian platforms"
Is this because of nginx version?
$ rpm -qa | grep yajl
yajl-1.0.7-3.el6.x86_64
yajl-devel-1.0.7-3.el6.x86_64
$ rpm -ql yajl yajl-devel
/usr/bin/json_reformat
/usr/bin/json_verify
/usr/lib64/libyajl.so.1
/usr/lib64/libyajl.so.1.0.7
/usr/share/doc/yajl-1.0.7
/usr/share/doc/yajl-1.0.7/COPYING
/usr/share/doc/yajl-1.0.7/ChangeLog
/usr/share/doc/yajl-1.0.7/README
/usr/share/doc/yajl-1.0.7/TODO
/usr/include/yajl
/usr/include/yajl/yajl_common.h
/usr/include/yajl/yajl_gen.h
/usr/include/yajl/yajl_parse.h
/usr/lib64/libyajl.so
/usr/share/doc/yajl-devel-1.0.7
/usr/share/doc/yajl-devel-1.0.7/COPYING
sudo ln -s /usr/include/ /usr/local/include/yajl
sudo ln -s /usr/lib64/ /usr/local/lib/libyajl.so.1
sudo ln -s /usr/lib64/ /usr/local/lib/libyajl.so.1.0.7
sudo ln -s /usr/lib64/ /usr/local/lib/libyajl.so
Still Cannot Find!
If using internal malloc, should include yajl_free to avoid memory leak
Referenace:
ngx_http_mongo_module.c
line : 1958 and line 1997
yajl = yajl_alloc(&ngx_http_mongo_json_to_bson_callbacks, NULL, &ctx);
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.