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
07c7e1f5
Commit
07c7e1f5
authored
Sep 17, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb
into mysql.com:/home/jonas/src/mysql-4.1-ndb
parents
11dbfe47
f21e6d81
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
98 deletions
+8
-98
ndb/src/common/mgmcommon/ConfigRetriever.cpp
ndb/src/common/mgmcommon/ConfigRetriever.cpp
+6
-33
ndb/src/mgmsrv/MgmtSrvr.cpp
ndb/src/mgmsrv/MgmtSrvr.cpp
+2
-65
No files found.
ndb/src/common/mgmcommon/ConfigRetriever.cpp
View file @
07c7e1f5
...
...
@@ -18,6 +18,7 @@
#include <ndb_version.h>
#include <ConfigRetriever.hpp>
#include <SocketServer.hpp>
#include "LocalConfig.hpp"
#include <NdbSleep.h>
...
...
@@ -272,43 +273,15 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf, Uint32
NdbConfig_SetPath
(
datadir
);
}
char
localhost
[
MAXHOSTNAMELEN
];
if
(
NdbHost_GetHostName
(
localhost
)
!=
0
){
snprintf
(
buf
,
255
,
"Unable to get own hostname"
);
if
(
hostname
&&
hostname
[
0
]
!=
0
&&
!
SocketServer
::
tryBind
(
0
,
hostname
))
{
snprintf
(
buf
,
255
,
"Config hostname(%s) don't match a local interface,"
" tried to bind, error = %d - %s"
,
hostname
,
errno
,
strerror
(
errno
));
setError
(
CR_ERROR
,
buf
);
return
false
;
}
do
{
if
(
strlen
(
hostname
)
==
0
)
break
;
if
(
strcasecmp
(
hostname
,
localhost
)
==
0
)
break
;
if
(
strcasecmp
(
hostname
,
"localhost"
)
==
0
)
break
;
struct
in_addr
local
,
config
;
bool
b1
=
false
,
b2
=
false
,
b3
=
false
;
b1
=
Ndb_getInAddr
(
&
local
,
localhost
)
==
0
;
b2
=
Ndb_getInAddr
(
&
config
,
hostname
)
==
0
;
b3
=
memcmp
(
&
local
,
&
config
,
sizeof
(
local
))
==
0
;
if
(
b1
&&
b2
&&
b3
)
break
;
b1
=
Ndb_getInAddr
(
&
local
,
"localhost"
)
==
0
;
b3
=
memcmp
(
&
local
,
&
config
,
sizeof
(
local
))
==
0
;
if
(
b1
&&
b2
&&
b3
)
break
;
snprintf
(
buf
,
255
,
"Local hostname(%s) and config hostname(%s) dont match"
,
localhost
,
hostname
);
setError
(
CR_ERROR
,
buf
);
return
false
;
}
while
(
false
);
unsigned
int
_type
;
if
(
ndb_mgm_get_int_parameter
(
it
,
CFG_TYPE_OF_SECTION
,
&
_type
)){
snprintf
(
buf
,
255
,
"Unable to get type of node(%d) from config"
,
...
...
ndb/src/mgmsrv/MgmtSrvr.cpp
View file @
07c7e1f5
...
...
@@ -396,59 +396,6 @@ MgmtSrvr::getPort() const {
ndb_mgm_destroy_iterator
(
iter
);
/*****************
* Set Stat Port *
*****************/
#if 0
if (!mgmProps->get("PortNumberStats", &tmp)){
ndbout << "Could not find PortNumberStats in the configuration file."
<< endl;
return false;
}
glob.port_stats = tmp;
#endif
#if 0
const char * host;
if(ndb_mgm_get_string_parameter(iter, mgmProps->get("ExecuteOnComputer", host)){
ndbout << "Failed to find \"ExecuteOnComputer\" for my node" << endl;
ndbout << "Unable to verify own hostname" << endl;
return false;
}
const char * hostname;
{
const Properties * p;
char buf[255];
snprintf(buf, sizeof(buf), "Computer_%s", host.c_str());
if(!glob.cluster_config->get(buf, &p)){
ndbout << "Failed to find computer " << host << " in config" << endl;
ndbout << "Unable to verify own hostname" << endl;
return false;
}
if(!p->get("HostName", &hostname)){
ndbout << "Failed to find \"HostName\" for computer " << host
<< " in config" << endl;
ndbout << "Unable to verify own hostname" << endl;
return false;
}
if(NdbHost_GetHostName(buf) != 0){
ndbout << "Unable to get own hostname" << endl;
ndbout << "Unable to verify own hostname" << endl;
return false;
}
}
const char * ip_address;
if(mgmProps->get("IpAddress", &ip_address)){
glob.use_specific_ip = true;
glob.interface_name = strdup(ip_address);
return true;
}
glob.interface_name = strdup(hostname);
#endif
return
port
;
}
...
...
@@ -2217,20 +2164,9 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
}
// connecting through localhost
// check if config_hostname is local
#if 1
if
(
!
SocketServer
::
tryBind
(
0
,
config_hostname
))
{
continue
;
}
#else
char
my_hostname
[
256
];
if
(
gethostname
(
my_hostname
,
sizeof
(
my_hostname
))
!=
0
)
continue
;
if
(
Ndb_getInAddr
(
&
tmp_addr
,
my_hostname
)
!=
0
||
memcmp
(
&
tmp_addr
,
&
config_addr
,
sizeof
(
config_addr
))
!=
0
)
{
// no match
continue
;
}
#endif
}
}
else
{
// client_addr == 0
if
(
!
SocketServer
::
tryBind
(
0
,
config_hostname
))
{
...
...
@@ -2308,7 +2244,8 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
if
(
found_matching_type
)
if
(
found_free_node
)
error_string
.
appfmt
(
"Connection done from wrong host ip %s."
,
inet_ntoa
(((
struct
sockaddr_in
*
)(
client_addr
))
->
sin_addr
));
inet_ntoa
(((
struct
sockaddr_in
*
)
(
client_addr
))
->
sin_addr
));
else
error_string
.
appfmt
(
"No free node id found for %s."
,
type_string
.
c_str
());
...
...
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