tsuru / mysqlapi

MySQL service API for tsuru PaaS.
BSD 3-Clause "New" or "Revised" License
14 stars 18 forks source link

Error when installing mysqlapi on tsuru-bootstrap #36

Open mouradsm opened 9 years ago

mouradsm commented 9 years ago

Command: sudo pip install -r requirements.txt

running build_ext

building 'gevent.core' extension

creating build/temp.linux-x86_64-2.7

creating build/temp.linux-x86_64-2.7/gevent

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c gevent/core.c -o build/temp.linux-x86_64-2.7/gevent/core.o

In file included from gevent/core.c:253:0:

gevent/libevent.h:9:19: fatal error: event.h: No such file or directory

include "event.h"

               ^

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1


Cleaning up... Command /usr/bin/python -c "import setuptools, tokenize;file='/tmp/pip_build_root/gevent/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-a8ZjvC-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/gevent Storing debug log for failure in /home/vagrant/.pip/pip.log

fsouza commented 9 years ago

Are you installing the API on the VM or as a tsuru application?

If you're install on the VM, please ensure that you install all packages listed in the file requirements.apt. This libevent.h error comes from the fact that you don't have libevent-dev installed. So, the following command should fix it:

% cat requirements.apt | xargs sudo apt-get install -y

You can also deploy mysqlapi as an app in tsuru, and tsuru will handle that for you.

andrewsmedina commented 9 years ago

We should add a note about requirements.apt in the readme

mouradsm commented 9 years ago

which platform should I install to put it as an application ?

andrewsmedina commented 9 years ago

@mouradsm you can deploy mysqlapi to tsuru using "python" plataform.

mouradsm commented 9 years ago

Just clone and push to master repository ?

mouradsm commented 9 years ago

After deploy in Admin/containers : de0e6483139d mysqlapi python web 172.17.0.7 32771 error

How can I solve this?

mouradsm commented 9 years ago

app log: 2015-10-17 18:37:37 +0000 [web][a2958a5296f9]: 2015-10-17 18:37:37 [1] [INFO] Using worker: gevent 2015-10-17 18:37:37 +0000 [web][a2958a5296f9]: 2015-10-17 18:37:37 [9] [INFO] Booting worker with pid: 9 2015-10-17 18:37:37 +0000 [web][a2958a5296f9]: 2015-10-17 18:37:37 [9] [INFO] Worker exiting (pid: 9) 2015-10-17 18:37:39 +0000 [web][a2958a5296f9]: 2015-10-17 18:37:39 [1] [INFO] Shutting down: Master 2015-10-17 18:37:39 +0000 [web][a2958a5296f9]: 2015-10-17 18:37:39 [1] [INFO] Reason: Worker failed to boot.

andrewsmedina commented 9 years ago

@mouradsm you should define some environment variables.

Here is an example if you want to create the mysql api using the shared database mode:

DJANGO_SETTINGS_MODULE=mysqlapi.settings
MYSQLAPI_DB_HOST=<host-ip>
MYSQLAPI_DB_PASSWORD=<db-passwoard>
MYSQLAPI_SHARED_PASSWORD=<db-shared-password>
MYSQLAPI_SHARED_SERVER=<db-shared-server>
MYSQLAPI_SHARED_SERVER_PUBLIC_HOST=<db-shared-host>

you can set them using tsuru env-set command.

mouradsm commented 9 years ago

@andrewsmedina desculpa eu falar em português mas já gastei meu inglês todo rs

Eu coloquei as variáveis assim: DJANGO_SETTINGS_MODULE=mysqlapi.settings MYSQLAPI_DB_HOST=localhost MYSQLAPI_DB_PASSWORD=123456 MYSQLAPI_SHARED_PASSWORD=123456 MYSQLAPI_SHARED_SERVER=localhost MYSQLAPI_SHARED_SERVER_PUBLIC_HOST=mysqlapi.192.168.50.4.nip.io

Eu tenho quase certeza que não são essas informações... pois mesmo após o tsuru env-set está dando erro.

Pode me ajudar?

andrewsmedina commented 9 years ago

A api não deve estar executando corretamente por que você nao deve ter o mysql instalado.

Primeiramente você precisa de um mysql para armazenar os metadados da mysqlapi e um mysql para distribuir como serviço. Esses bancos podem serem o mesmo.

Após ter esse mysql instalado é so configurar os dados deles nas variaveis de ambiente.