Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
3c62b29a
Commit
3c62b29a
authored
Sep 27, 2002
by
Leigh B. Stoller
Browse files
Add per-node port ranges to the nodes table. Add code into newwanode
to assign the range when vnodes are created.
parent
62479b62
Changes
3
Show whitespace changes
Inline
Side-by-side
db/newwanode.in
View file @
3c62b29a
...
...
@@ -25,6 +25,8 @@ my $TB = "@prefix@";
my
$TBOPS
=
"
@TBOPSEMAIL
@
";
my
$TBLOGS
=
"
@TBLOGSEMAIL
@
";
my
$named_setup
=
"
$TB
/sbin/named_setup
";
my
$FIRSTIPPORT
=
40000
;
my
$PERNODEPORTS
=
256
;
# un-taint path
$ENV
{'
PATH
'}
=
'
/bin:/usr/bin:/usr/local/bin:/usr/site/bin
';
...
...
@@ -210,13 +212,18 @@ for ($i = 1; $i < 9; $i++) {
my
$priority
=
(
$nextpri
*
100
)
+
$i
;
$nodevname
=
"
v
${nodename}
-
${i}
";
# Per vnode ports.
my
$portlow
=
$FIRSTIPPORT
+
((
$i
-
1
)
*
$PERNODEPORTS
);
my
$porthigh
=
$portlow
+
$PERNODEPORTS
-
1
;
print
"
Creating widearea virtual node
$nodevname
...
\n
";
DBQueryFatal
("
insert into nodes
"
.
"
(node_id, type, phys_nodeid, role, priority,
"
.
"
status, op_mode, def_boot_osid, update_accounts)
"
.
"
status, op_mode, def_boot_osid, update_accounts,
"
.
"
ipport_low, ipport_high)
"
.
"
values ('
$nodevname
', '
$nodevtype
', '
$nodename
',
"
.
"
'virtnode',
$priority
, 'down', 'NORMAL',
"
.
"
'
$defosid
', 1)
");
"
'
$defosid
', 1
,
$portlow
,
$porthigh
)
");
}
DBQueryFatal
("
insert into interfaces
"
.
...
...
db/nfree.in
View file @
3c62b29a
...
...
@@ -295,6 +295,11 @@ foreach my $n (@freed_nodes) {
#
DBQueryWarn
("
delete from current_reloads where node_id='
$n
'
")
||
$error
++
;
#
# Reset its port allocation stuff.
#
DBQueryWarn
("
delete from nodeipportnum where node_id='
$n
'
")
||
$error
++
;
#
# Now its safe to change the reservation.
#
...
...
sql/database-create.sql
View file @
3c62b29a
...
...
@@ -564,6 +564,8 @@ CREATE TABLE nodes (
ipodhash
varchar
(
64
)
default
NULL
,
osid
varchar
(
35
)
NOT
NULL
default
''
,
ntpdrift
float
default
NULL
,
ipport_low
int
(
11
)
NOT
NULL
default
'11000'
,
ipport_high
int
(
11
)
NOT
NULL
default
'20000'
,
PRIMARY
KEY
(
node_id
)
)
TYPE
=
MyISAM
;
...
...
Write
Preview
Supports
Markdown
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