Editing
DRBD
(section)
From Linix VServer
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Install the vserver guest=== There are many methods how to install a vserver. Here 'debootstrap' is used. The important option is '--rootdir' to force the installation to the DRBD device. vserver -v vs03 build --force --rootdir /mnt/vs03 \ -m debootstrap --hostname vs03.nack.at \ --netdev eth0 --interface 192.168.0.3/24 --context 3 -- \ -d sarge -m http://ftp.at.debian.org/debian/ We could start the vserver now. But first we try to make the configuration more pretty. cd /mnt/vs03/vs03/etc/rc0.d rm K20makedev K25hwclock.sh S30urandom S31umountnfs.sh S35networking S36ifupdown S40umountfs S90halt K89klogd cd ../rc6.d rm K20makedev K25hwclock.sh S30urandom S31umountnfs.sh S35networking S36ifupdown S40umountfs S90reboot K89klogd cd ../rcS.d rm S05keymap.sh S48console-screen.sh S50hwclock.sh S40networking S45mountnfs.sh S10checkroot.sh S02mountvirtfs rm S30procps.sh S35mountall.sh S36mountvirtfs S39ifupdown S30checkfs.sh S18ifupdown-clean S18hwclockfirst.sh cd ../rc2.d rm S20makedev S11klogd If we want to have virtual IPs in the host context managed by heartbeat, there can be conflicts (and funny effects), if we do not 'name' the alias of the vserver IP. echo vs03 > /etc/vservers/vs03/interfaces/0/name sshd should only listen to the IPs of the host context: xp2400:/# cat /etc/ssh/sshd_config | grep ListenAddress ListenAddress 192.168.0.21:22 ListenAddress 192.168.0.20:22 We want to limit the vserver to 1 GB AS/VM (virtual address space) and 128 MB RSS (real memory). Note, that the units are pages. xp2400:/# mkdir /etc/vservers/vs03/rlimits xp2400:/usr/src# echo 250000 > /etc/vservers/vs03/rlimits/as xp2400:/# echo 32000 > /etc/vservers/vs03/rlimits/rss We want control CPU consumption: xp2400:/# echo sched_prio > /etc/vservers/vs03/flags xp2400:/# echo 6 > /etc/vservers/vs03/schedule xp2400:/# echo 30 >> /etc/vservers/vs03/schedule xp2400:/# echo 1000 >> /etc/vservers/vs03/schedule xp2400:/# echo 200 >> /etc/vservers/vs03/schedule xp2400:/# echo 3000 >> /etc/vservers/vs03/schedule xp2400:/# echo dummy >> /etc/vservers/vs03/schedule xp2400:/# cat /etc/vservers/vs03/schedule 6 30 1000 200 3000 dummy After these checks it's time to start the vserver: xp2400:/# vserver vs03 start Check if the interface is nicely named and shown with ifconfig: xp2400:/# ip addr show [...] 2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:30:bd:6b:d6:8f brd ff:ff:ff:ff:ff:ff inet 192.168.0.21/24 brd 192.168.0.255 scope global eth0 inet 192.168.0.3/24 brd 192.168.0.255 scope global secondary eth0:vs03 inet6 fe80::230:bdff:fe6b:d68f/64 scope link valid_lft forever preferred_lft forever xp2400:/# ifconfig eth0 Link encap:Ethernet [...] eth1 [...] eth0:vs03 Link encap:Ethernet HWaddr 00:30:BD:6B:D6:8F inet addr:192.168.0.3 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:177 Base address:0xd000 Enter the vserver: xp2400:/# vserver vs03 enter In the vserver we check the base configuration and install some packages. vs03:/# base-config vs03:/# apt-get update vs03:/# apt-get install locales vs03:/# apt-get install less vs03:/# nano /etc/resolv.conf vs03:/# ping www.linux-vserver.org We want to install at least one service, sshd. vs03:/# apt-get install ssh vs03:/# nano /etc/ssh/sshd_config vs03:/# cat /etc/ssh/sshd_config | grep ListenAddress ListenAddress 192.168.0.3:22 vs03:/# /etc/init.d/ssh restart Restarting OpenBSD Secure Shell server: sshd. vs03:/# passwd Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully vs03:/# exit logout Test the ssh login: xp2400:/# ssh root@192.168.0.3 The authenticity of host '192.168.0.3 (192.168.0.3)' can't be established. RSA key fingerprint is e2:19:d1:8d:7f:ac:0a:ce:12:f5:06:b7:ae:41:96:59. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.0.3' (RSA) to the list of known hosts. Password: <secret> vs03:~# As another service Apache2 should be used: vs03:/# apt-get install apache2 [...] Starting web server: Apache2(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs invoke-rc.d: initscript apache2, action "start" failed. Setting up apache2 (2.0.54-4) ... To avoid the above error: vs03:/# nano /etc/apache2/ports.conf vs03:/# cat /etc/apache2/ports.conf Listen 192.168.0.3:80 vs03:/# /etc/init.d/apache2 start Starting web server: Apache2(98)Address already in use: make_sock: could not bind to address 192.168.0.3:80 no listening sockets available, shutting down Unable to open logs Do we have an Apache listening on the vserver IP in the host context? xp2400:/# cat /etc/apache2/ports.conf Listen 80 xp2400:/# nano /etc/apache2/ports.conf xp2400:/# cat /etc/apache2/ports.conf Listen 192.168.0.21:80 Listen 127.0.0.1:80 xp2400:/# /etc/init.d/apache2 restart Forcing reload of web server: Apache2. vs03:/# /etc/init.d/apache2 start Starting web server: Apache2. xp2400:/# lynx http://192.168.0.3/ Test Page for Apache Installation If you can see this, it means that the installation of the Apache web server software on this system was successful. You may now add content to this directory and replace this page. [...] The configuration on one node is ready. To be continued ... [[Category:Documentation]]
Summary:
Please note that all contributions to Linix VServer may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linix VServer:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
About
Overview
Paper
News
Developers
Donations
Search
Getting Started
Downloads
FAQs
Documentation
Support
Participate
How to participate
Report a Bug
Communicate
Teams/Projects
Hall of Fame
Resources
Archives
Recent Wiki Changes
Pastebin
Related Projects
VServer Hosting
Happy VServer Users
Tools
What links here
Related changes
Special pages
Page information