db.inc.php 4.18 KB
<?php
$db_config = array(
                      'master' => array(
                                           //关键字以数据库名作为键值
                                           BASEDB_BASEDBNAME_KEY => array(
                                                                             'host' => '192.168.7.250',
                                                                             'user' => 'yohoi_beat',
                                                                             'pwd' => 'yohoi_beat',
                                                                             'dbname' => 'yohoi_beat',
                                                                             'port' => 3306,
                                                                         ),
                                           BASEDB_APPDBNAME_KEY => array(
                                                                            'host' => '192.168.7.2',
                                                                            'user' => 'yohoi_app',
                                                                            'pwd' => 'yohoi_app',
                                                                            'dbname' => 'yohoi_app',
                                                                            'port' => 3306,
                                                                        ),
                                       ),
                      'slave' => array(
                                          BASEDB_BASEDBNAME_KEY => array(
                                                                            array(
                                                                                     'host' => '192.168.7.251',
                                                                                     'user' => 'yohoi_beat',
                                                                                     'pwd' => 'yohoi_beat',
                                                                                     'dbname' => 'yohoi_beat',
                                                                                     'port' => 3306,
                                                                                     'weight' => 0,/*权值,权值越大,使用率越高*/
                                                                                 ),
                                                                            array(
                                                                                     'host' => '192.168.7.252',
                                                                                     'user' => 'yohoi_beat',
                                                                                     'pwd' => 'yohoi_beat',
                                                                                     'dbname' => 'yohoi_beat',
                                                                                     'port' => 3306,
                                                                                     'weight' => 0,/*权值,权值越大,使用率越高*/
                                                                                ),
                                                                        ),
                                          BASEDB_APPDBNAME_KEY => array(
                                                                           array(
                                                                                    'host' => '192.168.7.3',
                                                                                    'user' => 'yohoi_app',
                                                                                    'pwd' => 'yohoi_app',
                                                                                    'dbname' => 'yohoi_app',
                                                                                    'port' => 3306,
                                                                                )
                                                                       ),
                                      )
                  );
?>