martedì 6 novembre 2012

Uhuru AppCloud: Installare FatFreeCRM come Apps - Parte 2

 Precedenti Post:


Come detto nel precedente post, la pubblicazione sulla nostra Uhuru- nuvola richiede alcuni accorgimenti, accorgimenti che per essere applicati richiedono necessariamente un ambiente di sviluppo funzionante e configurato.
Nel nostro esercizio però partiremo da zero, anche per verificare le possibilità offerte dai servizi cloud di essere utilizzate anche solo come file server o db server.
Quindi ci appresteremo a:
-          Creare un db in remoto da utilizzare per la configurazione “production” di fatfree
-          Apportare tutte le modifiche a FatFree per utilizzare il db remoto e per prepararlo alla pubblicazione
Per proseguire è necessario che
-          Ruby, Git e Rails siano correttamente installati e configurati
-          Mysql 5 sia installato e funzionante sul client (è necessario per poter compilare la gemma mysql2)

Per questo post ho utilizzato RailsInstaller e l’archivio mysql-5.5.28-win32.zip
Colleghiamoci alla nostra nuvola (vedi post precedente) e verifichiamo i servizi attivi:
vmcu service


otterremo una risposta come questa:

C:\Users\Luca>vmcu services

>         ============== System Services ==============
>          
>         +------------+---------+---------------------------------------+
>         | Service    | Version | Description                           |
>         +------------+---------+---------------------------------------+
>         | mongodb    | 2.0     | MongoDB NoSQL store                   |
>         | mssql      | 2008    | MS SQL Server database service        |
>         | mysql      | 5.1     | MySQL database service                |
>         | postgresql | 9.0     | PostgreSQL database service (vFabric) |
>         | rabbitmq   | 2.4     | RabbitMQ message queue                |
>         | redis      | 2.2     | Redis key-value store service         |
>         | uhurufs    | 0.9     | Uhuru persistent filesystem service   |
>         +------------+---------+---------------------------------------+
>          
>         =========== Provisioned Services ============



Creiamo il nostro database:

>         Vmcu create-service mysql ff-development



Creiamo un tunnel così da poter utilizzare il database remoto *** QUESTA SHELL DOVRA’ RIMANERE SEMPRE APERTA ***:

>         Vmcu tunnel 
>          
>         1: ff-development
>         Which service to tunnel to?: 1
>         Deploying tunnel application 'caldecott'.
>         Uploading Application:
>           Checking for available resources: OK
>           Packing application: OK
>           Uploading (1K): OK
>         Push Status: OK
>         Binding Service [ff-development]: OK
>          
>         Staging Application 'caldecott': OK
>          
>         Starting Application 'caldecott': OK
>         Getting tunnel connection info: OK
>          
>         Service connection info:
>           username : uecvMF7JNEM1u
>           password : p1l4sYafcOFVq
>           name     : d9818ba918245401c85e2e6efd4ceba85
>          
>         Starting tunnel to ff-development on port 10000.
>         1: none
>         2: mysql
>         3: mysqldump
>         Which client would you like to start?: 1
>         Open another shell to run command-line clients or
>         use a UI tool to connect using the displayed information.
>         Press Ctrl-C to exit...


Effettuiamo il download di mysql-5.5.28-win32.zip e scompattiamo l’archivio in c:\mysql5. Quindi installiamo la gemma mysql2 versione 0.3.1

>         gem install --no-rdoc --no-ri mysql2 -v 0.3.10 -- with-mysql-dir=c:\mysql5

quindi copiamo il file libmysql.dll nella cartella bin del nostro interprete ruby. Ad esempio

>         copy C:\mysql5\lib\libmysql.dll C:\RailsInstaller\Ruby1.9.3\bin

Verificare con un client MySQL il collegamento al servizio. ad esempio con SquirrerSQL la stringa sarà:

jdbc:mysql://localhost:10000/ d9818ba918245401c85e2e6efd4ceba85


Nessun commento:

Posta un commento