Build a new server
From Wikitech
(Difference between revisions)
Bhartshorne (Talk | contribs) (Created page with "Details on all the steps necessary to take a new (or old repurposed) piece of hardware and turn it into a happy functional server == Initial hardware setup == * Get the hardware ...") |
Bhartshorne (Talk | contribs) |
||
| Line 1: | Line 1: | ||
Details on all the steps necessary to take a new (or old repurposed) piece of hardware and turn it into a happy functional server | Details on all the steps necessary to take a new (or old repurposed) piece of hardware and turn it into a happy functional server | ||
| + | |||
| + | == Before you begin == | ||
| + | * find the machine's MAC address | ||
| + | * decide on private / public IP address, and if it will need to exist in some special range | ||
| + | * decide how the disks should be arranged (raid, partitioning, etc.) | ||
| + | |||
== Initial hardware setup == | == Initial hardware setup == | ||
* Get the hardware racked and cabled (RobH) | * Get the hardware racked and cabled (RobH) | ||
* Get an IP and name (RobH) | * Get an IP and name (RobH) | ||
** follow [[DNS#HOWTO|DNS How-To section]] to add the name/ip to DNS | ** follow [[DNS#HOWTO|DNS How-To section]] to add the name/ip to DNS | ||
| + | ** set up $name.mgmt.$loc.wmnet as well to access the management interface | ||
* Set up DHCP with the MAC address / name info | * Set up DHCP with the MAC address / name info | ||
| + | ** log into brewster and edit <code>/etc/dhcp3/*</code>, run <code>/etc/init.d/dhcpd3-server restart</code> | ||
* Get the switch set up to pass traffic to the host (Mark) | * Get the switch set up to pass traffic to the host (Mark) | ||
== PXE boot and the initial OS == | == PXE boot and the initial OS == | ||
| + | * set up netboot to partition the disk | ||
| + | ** log into brewster, edit /srv/autoinstall/netboot.cfg | ||
| + | ** it's a bash case statement. Add a new stanza for your hosts' name | ||
| + | ** If you don't know what file to use and your host has two disks, use raid1-lvm.cfg. | ||
| + | * ssh to root@$servername.mgmt.$loc.wmnet, force a restart and pxe boot | ||
| + | ** get the password from someone in ops if you don't have it | ||
| + | ** powercycle the host: <code>racadm serveraction powercycle</code> | ||
| + | ** connect to the cosole: <code>console com2</code> | ||
| + | ** during boot, force netboot: <code>escape-shift-2</code> (sends F12) | ||
| + | ** you can leave this running to watch it complete | ||
| + | *** Note: if you see it ask you for disk partitioning information, you did the partitioning step above wrong | ||
| + | ** when you're done, <code>ctrl-\</code> will disconnect you from the console | ||
| + | |||
| + | == Get puppet running == | ||
| + | * get a shell on both $server and the puppet master (sockpuppet) | ||
| + | ** Only one key has access to new installs. | ||
| + | ** from sockpuppet, <code>ssh -i ~/.ssh/new_install root@$servername</code> to log into $server | ||
| + | * on $server, run <code>puppetd --test</code> It will fail. | ||
| + | * on sockpuppet, run <code>puppetca -s $server-fqdn</code> | ||
| + | * on $server, run <code>puppetd --test</code> It should now succeed. | ||
| + | == Set up puppet == | ||
| + | * add $server to site.pp, either by hostname or within a regex if it's part of a class (eg srv\d\d*) | ||
| + | * do whatever puppet goodies you want to get the server to do what you want it to. | ||
| + | == Related pages == | ||
| + | * [[DNS]] | ||
| + | * [[Automated installation]] | ||
[[Category:How-to]] | [[Category:How-to]] | ||
Revision as of 19:17, 17 August 2011
Details on all the steps necessary to take a new (or old repurposed) piece of hardware and turn it into a happy functional server
Contents |
Before you begin
- find the machine's MAC address
- decide on private / public IP address, and if it will need to exist in some special range
- decide how the disks should be arranged (raid, partitioning, etc.)
Initial hardware setup
- Get the hardware racked and cabled (RobH)
- Get an IP and name (RobH)
- follow DNS How-To section to add the name/ip to DNS
- set up $name.mgmt.$loc.wmnet as well to access the management interface
- Set up DHCP with the MAC address / name info
- log into brewster and edit
/etc/dhcp3/*, run/etc/init.d/dhcpd3-server restart
- log into brewster and edit
- Get the switch set up to pass traffic to the host (Mark)
PXE boot and the initial OS
- set up netboot to partition the disk
- log into brewster, edit /srv/autoinstall/netboot.cfg
- it's a bash case statement. Add a new stanza for your hosts' name
- If you don't know what file to use and your host has two disks, use raid1-lvm.cfg.
- ssh to root@$servername.mgmt.$loc.wmnet, force a restart and pxe boot
- get the password from someone in ops if you don't have it
- powercycle the host:
racadm serveraction powercycle - connect to the cosole:
console com2 - during boot, force netboot:
escape-shift-2(sends F12) - you can leave this running to watch it complete
- Note: if you see it ask you for disk partitioning information, you did the partitioning step above wrong
- when you're done,
ctrl-\will disconnect you from the console
Get puppet running
- get a shell on both $server and the puppet master (sockpuppet)
- Only one key has access to new installs.
- from sockpuppet,
ssh -i ~/.ssh/new_install root@$servernameto log into $server
- on $server, run
puppetd --testIt will fail. - on sockpuppet, run
puppetca -s $server-fqdn - on $server, run
puppetd --testIt should now succeed.
Set up puppet
- add $server to site.pp, either by hostname or within a regex if it's part of a class (eg srv\d\d*)
- do whatever puppet goodies you want to get the server to do what you want it to.