Home · About · Download · Documentation · Getting Help · Google+

Changes between Version 1 and Version 2 of Common/DataStore


Ignore:
Timestamp:
04/17/2013 10:27:04 AM (5 years ago)
Author:
gmk
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Common/DataStore

    v1 v2  
    1 == Data Store == 
    2 The Warewulf backend is very modular and is built in such a way to support a wide range of technologies to store configurations. Warewulf is currently developed and distributed using MySQL as the backend data storage solution and it must be configured and initialized before using Warewulf. 
     1= The Warewulf Data Store = 
     2From the Warewulf perspective, all components within an infrastructure configuration are objects. Nodes, files, VNFS images, bootstraps, etc.. are all objects to which you can assign key/value pairs, as well as other sub objects. The Warewulf Data Store is an architecture to persist and retrieve these objects easily and efficiently. The back end storage of these objects is abstracted out and modular. Thus it can support a wide range of technologies. 
    33 
    4 === MySQL Setup === 
    5 Confirm that you have MySQL server and tools installed on your system. Once installed this procedure will initialize a database for Warewulf and password protect the root user on that database. 
     4Presently, MySQL is used as the default back end data store implementation because it is widely known, reasonably fast, and utilizes a server/client architecture which easily supports multiple Warewulf servers and sub-masters. 
    65 
    7 '''Note:''' ''The example below uses the string 'changeme' as the password, but you should change it to meet your needs. The MySQL database will be initialized if it does not exist. It is no longer needed to run the setup.sql file, as previous versions required.'' 
    86 
    9 {{{ 
    10 # service mysqld start 
    11 # chkconfig mysqld on 
    12 # mysqladmin create warewulf 
    13 # mysqladmin -u root password 'changeme' 
    14 }}} 
     7== Data Store Configuration == 
     8The configuration file for the datastore (assuming a standard build) would be located at '''`/etc/warewulf/database.conf`''' and (as of version 3.4) '''`/etc/warewulf/database-root.conf`'''. 
    159 
    16 === Data Store Configuration === 
    17 The configuration file for the datastore (assuming a standard build) would be located at '''`/etc/warewulf/database.conf`'''. Here you must define the type of database and how to access and communicate with the database. Here is a default configuration: 
    18  
    19 '''Note:''' ''You should set the database password to be the same as you used above! '' 
     10=== database.conf === 
     11In this file you will define the database type and driver as well as the default user access privileges. 
    2012 
    2113{{{ 
     
    3123}}} 
    3224 
    33 === Extended MySQL Setup === 
    34 The easiest setup is to use the root user for everything. Where this is not possible, you can setup MySQL the following way. 
     25=== database-root.conf === 
     26As of Version 3.4, you should use this file to define the user that has full privileges to the Warewulf database/tables and the `database.conf` file above should be used for non-privileged access to the datastore (e.g. a differentiation between user read only access, and root level changes). 
    3527 
    36 {{{ 
    37 # mysql -u root -p mysql 
    38 Enter password:  
     28== Initialization == 
     29Warewulf will automatically try and setup the back end database which includes setting up the tables and non-privleged read only access as defined in the non -root configuration file. 
    3930 
    40 mysql> CREATE DATABASE warewulf; 
    41 mysql> GRANT ALL PRIVILEGES ON warewulf.* TO warewulf@localhost IDENTIFIED BY 'changeme' WITH GRANT OPTION; 
    42 mysql> FLUSH PRIVILEGES; 
    43 mysql> exit 
    44 }}} 
    45  
    46 The file '''`/etc/warewulf/database.conf`''' would then have entries that matched below. 
    47  
    48 {{{ 
    49 database name       = warewulf 
    50 database user       = warewulf 
    51 database password   = changeme 
    52 }}} 
    53  
    54 '''Note:''' It ''should'' also be possible to '''not''' create the database, as long as what user you create is done with `GRANT ALL PRIVILEGES`. They should, in theory, be able to create the given database in the `ON *.*` part of the statement. If for example you want to have a possibility of multiple test databases you could create a user like: 
    55  
    56 {{{ 
    57 mysql> GRANT ALL PRIVILEGES ON 'warewulf\_%'.* TO warewulf@localhost IDENTIFIED BY 'changeme' WITH GRANT OPTION; 
    58 }}} 
    59  
    60 And the warewulf user should be able to create a database as long as it begins with '`warewulf_`' ... for example: 
    61 {{{ 
    62 warewulf_test1 
    63 warewulf_production 
    64 warewulf_companyZ 
    65 }}}