Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
6cff2db9
Commit
6cff2db9
authored
Sep 30, 2005
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb
Add support/test for using my.cnf [cluster_config]
parent
1e6f1907
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
5 deletions
+42
-5
mysql-test/r/ndb_config.result
mysql-test/r/ndb_config.result
+2
-1
mysql-test/std_data/ndb_config_mycnf1.cnf
mysql-test/std_data/ndb_config_mycnf1.cnf
+15
-0
mysql-test/t/ndb_config.test
mysql-test/t/ndb_config.test
+2
-0
ndb/src/mgmsrv/InitConfigFileParser.cpp
ndb/src/mgmsrv/InitConfigFileParser.cpp
+1
-1
ndb/tools/ndb_config.cpp
ndb/tools/ndb_config.cpp
+22
-3
No files found.
mysql-test/r/ndb_config.result
View file @
6cff2db9
...
...
@@ -3,4 +3,5 @@ ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysql
1 localhost 41943040 12582912
2 localhost 41943040 12582912
1 2
ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3, mysqld,4, mysqld,5, mysqld,6, mysqld,7,
ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysqld,6, mysqld,7,
ndbd,1,localhost,52428800,26214400 ndbd,2,localhost,52428800,36700160 ndbd,3,localhost,52428800,52428800 ndbd,4,localhost,52428800,52428800 ndb_mgmd,5,localhost,, mysqld,6,localhost,,
mysql-test/std_data/ndb_config_mycnf1.cnf
0 → 100644
View file @
6cff2db9
[cluster_config]
NoOfReplicas=1
DataMemory=50M
[cluster_config.jonas]
IndexMemory=50M
ndbd = localhost,localhost,localhost,localhost
ndb_mgmd = localhost
mysqld = localhost
[cluster_config.ndbd.1]
DataMemory=25M
[cluster_config.ndbd.2.jonas]
DataMemory=35M
mysql-test/t/ndb_config.test
View file @
6cff2db9
...
...
@@ -9,3 +9,5 @@
--
exec
$NDB_TOOLS_DIR
/
ndb_config
--
no
-
defaults
--
query
=
type
,
nodeid
,
host
--
config
-
file
=
$NDB_BACKUP_DIR
/
config
.
ini
2
>
/
dev
/
null
# End of 4.1 tests
--
exec
$NDB_TOOLS_DIR
/
ndb_config
--
defaults
-
group
-
suffix
=.
jonas
--
defaults
-
file
=
$MYSQL_TEST_DIR
/
std_data
/
ndb_config_mycnf1
.
cnf
--
query
=
type
,
nodeid
,
host
,
IndexMemory
,
DataMemory
--
mycnf
2
>
/
dev
/
null
ndb/src/mgmsrv/InitConfigFileParser.cpp
View file @
6cff2db9
...
...
@@ -843,7 +843,7 @@ InitConfigFileParser::parse_mycnf()
}
Context
ctx
(
m_info
);
Context
ctx
(
m_info
,
m_errstream
);
const
char
*
groups
[]
=
{
"cluster_config"
,
0
};
if
(
load_defaults
(
options
,
groups
))
goto
end
;
...
...
ndb/tools/ndb_config.cpp
View file @
6cff2db9
...
...
@@ -41,6 +41,7 @@ static const char * g_host = 0;
static
const
char
*
g_field_delimiter
=
","
;
static
const
char
*
g_row_delimiter
=
" "
;
static
const
char
*
g_config_file
=
0
;
static
int
g_mycnf
=
0
;
int
g_print_full_config
,
opt_ndb_shm
;
my_bool
opt_core
;
...
...
@@ -94,6 +95,9 @@ static struct my_option my_long_options[] =
{
"config-file"
,
256
,
"Path to config.ini"
,
(
gptr
*
)
&
g_config_file
,
(
gptr
*
)
&
g_config_file
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"mycnf"
,
256
,
"Read config from my.cnf"
,
(
gptr
*
)
&
g_mycnf
,
(
gptr
*
)
&
g_mycnf
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
}
};
...
...
@@ -163,11 +167,16 @@ main(int argc, char** argv){
ndb_mgm_configuration
*
conf
=
0
;
if
(
g_config_file
)
if
(
g_config_file
||
g_mycnf
)
conf
=
load_configuration
();
else
conf
=
fetch_configuration
();
if
(
conf
==
0
)
{
return
-
1
;
}
Vector
<
Apply
*>
select_list
;
Vector
<
Match
*>
where_clause
;
...
...
@@ -437,10 +446,20 @@ ndb_mgm_configuration*
load_configuration
()
{
InitConfigFileParser
parser
(
stderr
);
if
(
g_config_file
)
{
if
(
g_verbose
)
fprintf
(
stderr
,
"Using config.ini : %s"
,
g_config_file
);
Config
*
conf
=
parser
.
parseConfig
(
g_config_file
);
if
(
conf
)
return
conf
->
m_configValues
;
}
if
(
g_verbose
)
fprintf
(
stderr
,
"Using
config.ini : %s"
,
g_config_file
);
fprintf
(
stderr
,
"Using
my.cnf"
);
Config
*
conf
=
parser
.
parse
Config
(
g_config_file
);
Config
*
conf
=
parser
.
parse
_mycnf
(
);
if
(
conf
)
return
conf
->
m_configValues
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment