CryptDB - cannot connect to proxy (ERROR 1105 (HY0

2019-04-17 18:48发布

问题:

I install CryptDB in Ubuntu 14.04. I want to start the proxy:

$ /home/user/cryptdb/bins/proxy-bin/bin/mysql-proxy \
    --plugins=proxy \
    --event-threads=4 \
    --max-open-files=1024 \
    --proxy-lua-script=$EDBDIR/mysqlproxy/wrapper.lua \
    --proxy-address=127.0.0.1:3307 \
    --proxy-backend-addresses=localhost:3306

and it started:

2015-10-26 00:04:34: [global] (*) mysql-proxy 0.9.0 started

Then I login mysql use this command:

$ mysql -u root -pletmein -h 127.0.0.1 -P 3307

It display:

ERROR 1105 (HY000): (proxy) all backends are down

proxy output:

2015-10-26 00:04:40: [global] (critical) proxy-plugin.c.1772: Cannot connect, all backends are down.

I install MySQL and CryptDB on the same VM.

I am following the steps on CryptDB readme on GitHub.


Edit: the problem below is fixed, the above problem not fix yet.

Also, the original script (cryptdb/mysqlproxy/wrapper.lua) cause an error:

2015-10-26 00:24:33: [global] (critical) (lua-error) [/home/user/cryptdb/mysqlproxy/wrapper.lua]

[string "/home/user/cryptdb/mysqlproxy/wrapper.lua"]:1: attempt to concatenate a nil value

Seems the os.getenv("EDBDIR") return nil even I have set the EDBDIR in ~/.bashrc: EDBDIR=/home/user/cryptdb.

So I just modify the code like this, hope this won't cause another problem:

-- assert(package.loadlib(os.getenv("EDBDIR").."/obj/libexecute.so",
assert(package.loadlib("/home/user/cryptdb/obj/libexecute.so",
                   "lua_cryptdb_init"))()

回答1:

For your first problem, start the proxy with:

$ /home/user/cryptdb/bins/proxy-bin/bin/mysql-proxy \
--plugins=proxy \
--event-threads=4 \
--max-open-files=1024 \
--proxy-lua-script=$EDBDIR/mysqlproxy/wrapper.lua \
--proxy-address=127.0.0.1:3307 \
--proxy-backend-addresses=127.0.0.1:3306

Note the use 127.0.0.1 instead of localhost.

For your second problem, add export EDBDIR=/home/user/cryptdb to your .bashrc as suggested above.



标签: mysql proxy lua