Skip to content

Commit

Permalink
#76: documentation for using MySql with glu
Browse files Browse the repository at this point in the history
 - only documentation change as grails already support 'any' database
  • Loading branch information
ypujante committed Sep 13, 2011
1 parent 770614f commit 0ca4307
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 2 deletions.
58 changes: 57 additions & 1 deletion docs/manual/src/main/sphinx/source/console.rst
Expand Up @@ -103,7 +103,63 @@ The console uses a database to store some of its data (like the audit log, user
dataSource.dbCreate = "update"
dataSource.url = dataSourceUrl

.. note:: Coming Soon: ability to change the database provider entirely.
.. _console-configuration-database-mysql:

Example for a different database: MySql
"""""""""""""""""""""""""""""""""""""""

Here are the steps to follow in order to use MySql instead of HSQLDB (the steps would be very similar for a different database!)

* Download and install MySql on your system (don't forget to start it!)

* Connect to MySql and create the ``glu`` user::

sudo /usr/local/mysql/bin/mysql
mysql> create database glu;
mysql> show databases;
mysql> create user 'glua'@'localhost' identified by 'password';
mysql> grant all on glu.* to 'glua'@'localhost';

.. warning:: This values are obviously just example values (they simply need to be plugged in the right place in the configuration file (see below)).

* Download the MySql `driver <http://www.mysql.com/downloads/connector/j/>`_

* Copy the driver (in this example it is called ``mysql-connector-java-5.1.17-bin.jar``) to ``console-server/jetty-distribution-7.2.2.v20101205/lib/ext``

.. note:: You may need to run ``./bin/tutorial.sh setup`` in order to create the proper folder structure first!

* Edit the glu configuration file (``console-server/conf/glu-console-webapp.groovy``) to input the proper values::

// 'glu' is the name of the database created previously
def dataSourceUrl = "jdbc:mysql://localhost/glu"
dataSource.dbCreate = "update"
dataSource.url = dataSourceUrl
dataSource.logSql=false // set to true for details (+ open trace logging level)
dataSource.dialect = "org.hibernate.dialect.MySQL5InnoDBDialect"
dataSource.driverClassName = "com.mysql.jdbc.Driver"
dataSource.username= "glua" // user created previously
dataSource.password = "password" // password assigned previously

* Start the console

* You can check that MySql is being used::

mysql> use glu;
mysql> show tables;
+---------------------+
| Tables_in_glu |
+---------------------+
| audit_log |
| db_current_system |
| db_deployment |
| db_system_model |
| db_user_credentials |
| fabric |
| role |
| user |
| user_permissions |
| user_role |
+---------------------+

Logging
^^^^^^^
Expand Down
3 changes: 2 additions & 1 deletion docs/manual/src/main/sphinx/source/production-setup.rst
Expand Up @@ -333,6 +333,8 @@ If the keys, passwords and everything is fine, you will get ``[/]`` which is a l
Step 8: Install the console
---------------------------

.. warning:: The default configuration uses HSQLDB for the database. In a production setup, it is **not** recommended to use HSQLDB. Check the section :ref:`console-configuration-database-mysql` for details on how to configure a different database.

Option 1: Install the war file
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -365,4 +367,3 @@ The console will output a log file called ``console.log`` under ``jetty-distribu
.. tip::
If you use this option, the documentation is automatically available when you start the server, under ``http://<consolehost>:8080/glu/docs/html/index.html``


Expand Up @@ -40,6 +40,8 @@ setup()
$BASEDIR/bin/setup-agent.sh -f $GLU_FABRIC -n $GLU_AGENT_NAME -d $BASEDIR/agent-server
echo "### Stopping ZooKeeper..."
$BASEDIR/bin/zookeeper-server.sh stop
echo "### Initializing Console..."
$BASEDIR/bin/console-server.sh check
echo "### Done."
}

Expand Down

0 comments on commit 0ca4307

Please sign in to comment.