-
Notifications
You must be signed in to change notification settings - Fork 18
Problems installing #35
Comments
Hi @sglebs, I believe there are some points missing in the README, sorry about that. Can you try running syncdb and then call service-add again?
Thanks for reporting and sorry about the errors you're getting. |
Thanks, I will try that now and will get back to you. Related question: do I need to have a global shared install of MySQL or can I also have dockerized MySQL instances just like the postgresapi service supports? If you look at https://github.com/guokr/tsuru-postgresapi you will see that I can configure it to create docker instances with PostgreSQL on-the-fly. Can I do the same here? Thanks! |
django.db.utils.OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)") Even though I did sudo vi /etc/mysql/my.cnf , bind-address = 0.0.0.0 I will have to see what could be wrong. |
vagrant@ubuntu-14:~$ ifconfig tsuru env-set MYSQLAPI_SHARED_SERVER=172.17.42.1 -a mysqlapi tsuru app-run -a mysqlapi -- python manage.py syncdb --noinput I will try again after lunch. |
Hi @sglebs, mysqlapi requires another MySQL database for storing metadata related to instances. You need to define the following environment variables (all of them are optional, I'm also specifying the default value):
Regarding the container support, currently mysqlapi doesn't work with Docker. It supports the following flavors:
Unfortunately, it doesn't offer any kind of high availability yet (unless you use an Amazon RDS as shared instance or pre-provisioned instance). |
Hi @fsouza . I assume I just set the env vars and you guys create the database on-the-fly? Or do I need to create it manually myself from the console? Since this is a DEV machine, I will share here the exact values I am using: tsuru env-set MYSQLAPI_DB_NAME=mysqlapi tsuru service-add mysqlapi namoroonmysql small -t namoroon Application Not RespondingPlease try again in a few moments.I will try and create the mysqlapi database myself and will see if that fixes it. |
Sorry, you need to create the database and then run the syncdb command (syncdb doesn't create the database, only the schema):
|
Some progress: tsuru app-run -a mysqlapi -- python manage.py syncdb --noinput django.db.utils.OperationalError: (1130, "Host '172.17.0.45' is not allowed to connect to this MySQL server") I have to edit the MySQL con I guess, just like Postgresapi. |
I had to do this: mysql -u root -h localhost -p and then I got this: tsuru app-run -a mysqlapi -- python manage.py syncdb --noinput But unfortunately when I run this: Error: Failed to create the instance namoroonmysql: <title>Error 502 - Application Not Responding</title> <style> body { background-color: #fff; margin: 0px; padding-top: 280px; text-align: center; } h1 { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 24px; font-weight: normal; } h2 { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; color: #999; font-weight: normal; } </style>Application Not RespondingPlease try again in a few moments.Now I have to troubleshoot this next snag. Oh brother. |
Well, it looks like it was just being slow. Now it says: tsuru service-add mysqlapi namoroonmysql small -t namoroon I can see it is caching "root" (the old value of env var MYSQLAPI_DB_USER, which was root but then I changed to be mysqlapi). Is there a way to force it to flush this cached value? Or do I have to remove the app and recreate it all over again? Thanks! |
Well, I removed the whole app (mysqlapi) and added it all again, MYSQLAPI_DB_USER=mysqlapi but it does not seem to honor this env var: tsuru service-add mysqlapi namoroonmysql small -t namoroon It looks like I will have to re-run my grant commands but using root. Bummer. |
Well, this did not fix it: root: tsuru service-add mysqlapi namoroonmysql small -t namoroon And not even this fixed it: CREATE USER 'root'@'172.17.0.49' IDENTIFIED BY 'mysql'; tsuru service-add mysqlapi namoroonmysql small -t namoroon I just ran out of ideas, guys. Suggestions? Thanks! |
Hmm, syncdb works but service-add doesn't? Care to share the output of |
Sure (note that I switch the user env var back to root, since it seems to always print root@...): tsuru env-get -a mysqlapi I have to say that this looks very suspicious in the error msg: (using password: NO) Is it not using the password for root??? |
I see, the problem is that there are two MySQL servers:
You configured all environment variables for the first database, but you still need to configure the second access, with the following environment variable:
In your case, it's something like:
BTW, you don't need the grant option in the first database, only the second. Sorry for the giant mess :-( |
Wow, it worked: tsuru service-add mysqlapi namoroonmysql small -t namoroon crane list whew! Now all I need to do is bing, I guess? :-) Thanks for your help! Better docs would definitely help ;-) |
fyi. binding seems to have worked too: tsuru service-bind namoroonmysql -a core-server-staging Instance "namoroonmysql" is now bound to the app "core-server-staging".
|
Yes, we definitely need to improve our docs. I will keep this issue open as another reminder for that! |
Hi,
I am using https://github.com/tsuru/tsuru-bootstrap.git and decided to try mysql as well. For that, I did this:
git clone [email protected]:tsuru/mysqlapi.git
tsuru app-create mysqlapi python -t namoroon
git remote add tsuru [email protected]:mysqlapi.git
git push tsuru
tsuru env-set MYSQLAPI_SHARED_SERVER=localhost -a mysqlapi
tsuru env-set DJANGO_SETTINGS_MODULE=mysqlapi.settings -a mysqlapi
crane create service.yaml
tsuru service-add mysqlapi namoroonmysql small -t namoroon
Error: Failed to create the instance namoroonmysql: Post http://mysqlapi.com/resources: dial tcp: lookup mysqlapi.com: no such host
Makes sense, so I edited service.yaml:
crane remove mysqlapi
<title>Error 502 - Application Not Responding</title> <style> body { background-color: #fff; margin: 0px; padding-top: 280px; text-align: center; } h1 { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 24px; font-weight: normal; } h2 { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; color: #999; font-weight: normal; } </style>vi service.yaml, production: mysqlapi.192.168.46.226.nip.io
crane create service.yaml
tsuru service-add mysqlapi namoroonmysql small -t namoroon
Error: Failed to create the instance namoroonmysql:
Application Not Responding
Please try again in a few moments.
tsuru app-log --lines 5 -a mysqlapi
2015-03-31 08:18:07 -0300 [web][7a92435c6ad4]: Using worker: gevent
2015-03-31 08:18:07 -0300 [web][7a92435c6ad4]: Booting worker with pid: 186
2015-03-31 08:18:07 -0300 [web][7a92435c6ad4]: Worker exiting (pid: 186)
2015-03-31 08:18:08 -0300 [web][7a92435c6ad4]: Shutting down: Master
2015-03-31 08:18:08 -0300 [web][7a92435c6ad4]: Reason: Worker failed to boot.
No extra info in the logs. This did not help: tsuru env-set MYSQLAPI_DEBUG=1 -a mysqlapi
If I can suggest something, I'd say the documentation could be improved . It is not clear to the reader if the mysql instance is managed by mysqlapi itself, via docker instances it manages, or if I really need to pre-install a shared MySQL server and mysqlapi manages just databases in it (I suspect it is this option). But if I want a DEV environment, is it ok if I install mysql in the tsar-bootstrap VM itself? Or can I have it as a Docker? I would like to automate the database install as well.
Basically I am trying to use tsar for DEV deploys on developers machines for now (still using Heroku for LIVE). If it works, I will try STAGING next and LIVE last.
Note: I am having a similar problem with redisapi (ticket 28 there). So, it is probably something missing in the docs (assumes the person is a tsar expert).
Thanks!
The text was updated successfully, but these errors were encountered: