VServer Control Daemon HowTo: Difference between revisions

From Linix VServer
Jump to navigationJump to search
imported>Glenn
m (spelling)
 
(5 intermediate revisions by 2 users not shown)
Line 17: Line 17:


==A. Description==
==A. Description==
* [http://dev.croup.de/ Developer side] with short description for vcd (former vserver-utils) and libvserver
* [http://dev.croup.de/ Developer site] with short description for vcd (former vserver-utils) and libvserver
*  [http://coocoon.eu/manual.pdf VServer Control Daemon Reference Manual] (under construction)
*  [http://coocoon.eu/manual.pdf VServer Control Daemon Reference Manual] (under construction)
*[http://dev.croup.de/proj/vserver-utils vserver-utils] = vcd
*[http://dev.croup.de/proj/vserver-utils vserver-utils] = vcd
Line 99: Line 99:


=====a. Solve dependencies=====
=====a. Solve dependencies=====
======For Debian======
<pre>
aptitude install libconfuse-dev libsqlite3-dev sqlite3 subversion
There are many depedancies to these packages (most needed).
If you have not installed any build tools:
aptitude install make gcc libtool
NOTE: the xmlrpc package is not up-to-date enough for use and no backports have been found. Download and build the xmlrpc-c package like below.
</pre>
======create installation source dir======
======create installation source dir======
<pre>
<pre>
Line 192: Line 205:
=====b. Install vcd related repos=====
=====b. Install vcd related repos=====


======libvserver======
======lucid======
<pre>
<pre>
7. checkout libvserver
8. checkout lucid


svn co http://svn.linux-vserver.org/svn/libvserver/trunk libvserver
svn co http://dev.croup.de/repos/lucid/trunk lucid




7.1 cd into dir
8.1 cd into dir


cd ~/srcvcd/libvserver
cd ~/srcvcd/lucid




7.2 install libvserver
8.2 install lucid


make -f Makefile.svn && ./configure --prefix=/usr && make && sudo make install
make -f Makefile.svn && ./configure --prefix=/usr && make && sudo make install
</pre>
</pre>
======lucid======
======libvserver======
<pre>
<pre>
8. checkout lucid
7. checkout libvserver


svn co http://dev.croup.de/repos/lucid/trunk lucid
svn co http://svn.linux-vserver.org/svn/libvserver/trunk libvserver




8.1 cd into dir
7.1 cd into dir


cd ~/srcvcd/lucid
cd ~/srcvcd/libvserver




8.2 install lucid
7.2 install libvserver


make -f Makefile.svn && ./configure --prefix=/usr && make && sudo make install
make -f Makefile.svn && ./configure --prefix=/usr && make && sudo make install
Line 259: Line 272:


If everything is installed  you can proceed with III. Configuring VServer Control Daemon
If everything is installed  you can proceed with III. Configuring VServer Control Daemon


====2. Gentoo Installation====
====2. Gentoo Installation====
Line 543: Line 552:
#datadir    = /var/lib/vstatd
#datadir    = /var/lib/vstatd
</pre>
</pre>
[[Category:Documentation]]

Latest revision as of 19:01, 21 October 2011

VServer Control Daemon - vcd[edit]


  • MySystem:
    • AMD Athlon(tm) 64 Processor 3000+ 2000 MHz
    • Gentoo Base System version 1.12.5 (stable)
    • Kernel 2.6.17.8-vs2.1.1-rc29

WARNING it is not recommended to install vcd in tandem with util-vserver on one system!

A. Description[edit]





B. Installation[edit]

I. Kernel[edit]


If you haven't booted a kernel which is patched with Linux VServer Patch till yet, please go first to Step-by-Step Guide 2.6 and follow the instructions there,
before you go further with this HowTo!

1. Main focus to the following emphases:[edit]

#Getting the sources:
 
very important is to look for getting the right kernel version 
@ http://www.kernel.org/pub/linux/kernel/v2.6/ which is supported from 
→ experimental vserver patch >= 2.1.1-rc29 @ http://vserver.13thfloor.at/Experimental/



for example:

→ lets use the experimental 'patch-2.6.17.13-vs2.1.1-rc35.diff'
wget http://vserver.13thfloor.at/Experimental/patch-2.6.17.13-vs2.1.1-rc35.diff

→ so we must use the kernel version '2.6.17.13'
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.17.13.tar.bz2



#Configuring the kernel:

#Building the kernel:

#Installing the kernel and rebooting:

II. VServer Control Daemon[edit]


First I wanted to say that VServer Control Daemon is in trunk state and therefore it is a little bit buggy, but all of you are invited to find and post bugs, that this program will become stable as soon as possible.


Now I can proceed, that you have successfully compiled and booted a kernel with 


→ experimental vserver patch >= 2.1.1-rc29

1. Base Installation[edit]

If u use another Linux system than gentoo, try to install the needed releases with the package manager of the linux distribution!

And edit this HowTo for others! ;-)


a. Solve dependencies[edit]
For Debian[edit]
aptitude install libconfuse-dev libsqlite3-dev sqlite3 subversion

There are many depedancies to these packages (most needed).

If you have not installed any build tools:

aptitude install make gcc libtool

NOTE: the xmlrpc package is not up-to-date enough for use and no backports have been found. Download and build the xmlrpc-c package like below.
create installation source dir[edit]
1. create ~/srcvcd dir

mkdir ~/srcvcd


1.1 cd into dir

cd ~/srcvcd
xmlrpc-c[edit]
2. download Xmlrpc-c stable from http://xmlrpc-c.sourceforge.net/downloading.php 


2.1 extract xmlrpc-c-1.06.05.tgz

tar xzvf xmlrpc-c-1.06.05.tgz


2.2 cd into dir 

cd ~/srcvcd/xmlrpc-c-1.06.05


2.3 install xmlrpc-c

./configure && make && sudo make install
libconfuse[edit]
3. download libconfuse

wget http://download.savannah.gnu.org/releases/confuse/confuse-2.5.tar.gz


3.1 extract confuse-2.5.tar.gz

tar xzvf confuse-2.5.tar.gz

3.2 cd into dir 

cd ~/srcvcd/confuse-2.5


3.3 install confuse

./configure && make && sudo make install
sqlite[edit]
4. install sqlite please have a look @ http://www.sqlite.org/
libdbi[edit]
5. download libdbi from http://libdbi.sourceforge.net/download.html


5.1 libdbi-0.8.1.tar.gz

tar xzvf libdbi-0.8.1.tar.gz

5.2 cd into dit

cd ~/srcvcd/libdbi-0.8.1


5.3 install libdbi

./configure && make && sudo make install
libtar[edit]
6.1 download libtar 

wget ftp://ftp.feep.net/pub/software/libtar/libtar-1.2.11.tar.gz

6.2 extract libtar-1.2.11.tar.gz

tar xzvf libtar-1.2.11.tar.gz

6.3 cd into dir

cd ~/srcvcd/libdbi-0.8.1

6.4 install libtar

./configure && make && sudo make install
b. Install vcd related repos[edit]
lucid[edit]
8. checkout lucid

svn co http://dev.croup.de/repos/lucid/trunk lucid


8.1 cd into dir

cd ~/srcvcd/lucid


8.2 install lucid

make -f Makefile.svn && ./configure --prefix=/usr && make && sudo make install
libvserver[edit]
7. checkout libvserver

svn co http://svn.linux-vserver.org/svn/libvserver/trunk libvserver


7.1 cd into dir

cd ~/srcvcd/libvserver


7.2 install libvserver

make -f Makefile.svn && ./configure --prefix=/usr && make && sudo make install
vcd[edit]
9.checkout vcd

svn co http://svn.linux-vserver.org/svn/vcd/trunk vcd 


9.1 cd into dir

cd ~/srcvcd/vcd


9.2 install vcd

make -f Makefile.svn && ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --vserverdir=/vservers && make && sudo make install
vwrappers[edit]
10.1 checkout vwrappers

svn co http://svn.linux-vserver.org/svn/vwrappers/trunk vwrappers


10.2 cd into dir

cd ~/srcvcd/vwrappers


10.3 install vwrappers

make -f Makefile.svn && ./configure --prefix=/usr && make && sudo make install


If everything is installed you can proceed with III. Configuring VServer Control Daemon

2. Gentoo Installation[edit]


Because of there are no gentoo ebuilds for vcd available at this moment we must use layman to install the vps overlay!


1. Install layman

emerge layman -va


2. Configure /etc/make.conf for using layman

echo "source /usr/portage/local/layman/make.conf" >> /etc/make.conf


3. Download overlays

layman -f


4. Download vps overlay

layman -a vps


----

###Architecture dependencies###

→ amd64

5.1 Prepare portage for using latest xmlrpc

echo "dev-libs/xmlrpc-c ~amd64" >> /etc/portage/package.keywords 


5.2 Prepare portage for using vcd-svn

echo "sys-cluster/vcd-svn" ~amd64" >> /etc/portage/package.keywords


→ x86

5.1 Prepare portage for using latest xmlrpc

echo "dev-libs/xmlrpc-c ~x86" >> /etc/portage/package.keywords


5.2 Prepare portage for using vcd-svn

echo "sys-cluster/vcd-svn ~x86" >> /etc/portage/package.keywords

----


6. Prepare portage for using libtar

echo "dev-libs/libtar ~x86" >> /etc/portage/package.keywords → works also on amd64


7.1 Prepare portage for installing vcd-svn with clients and server support

echo "sys-cluster/vcd-svn client server" >> /etc/portage/package.use


7.2 Prepare portage for installing vcd-svn only with server support

echo "sys-cluster/vcd-svn server" >> /etc/portage/package.use


7.3 Prepare portage for installing vcd-svn only with client support

echo "sys-cluster/vcd-svn server" >> /etc/portage/package.use


8. Prepare portage for installing xmlrpc server with curl support

echo "dev-libs/xmlrpc-c curl" >> /etc/portage/package.use


9. Install vcd and needed packages

emerge libvserver-svn lucid-svn vcd-svn vwrappers-svn -va




III. Configuring VServer Control Daemon[edit]

1. Import vxdb.sql to sqlite DB[edit]

I use sqlite3 here in this example, so have a look which version you use 

10. import the vxdb file

sudo sqlite3 /var/lib/vcd/vxdb < /usr/share/vcd/vxdb.sql


11. use vxpassword for changing hash to whirlpool

vxpasswd  /var/lib/vcd/vxdb <YourUsername> <YourPassword>

2. Standard /etc/vcd.conf[edit]

/* example vcd configuration */

/* IP adress & port to listen on */
#host = 127.0.0.1
#port = 13386

/* Client timeout */
#timeout = 30

/* Logfile */
#logfile = /var/log/vcd.log

/* PID file */
#pidfile = /var/run/vcd.pid

/* Directory for VXDB, templates and run-time data */
#datadir    = /var/lib/vcd

/* Base vserver directory */
#vserverdir = /vservers

Change it to your needs! ;-)




C. Security[edit]

I. ATTENTION[edit]

For security reason it is recommended to remove the standard 'user' 'admin' and his 'password' and add new 'username' and 'password' → [http://www.sqlite.org/lang.html sqlite SYNTAX], or use a DB manager!<br>

II. ATTENTION[edit]

You must have a look for, that the 'uid' of your created 'user' has the 'uid 1', this is important for accessing the vcd

III. ATTENTION[edit]

please do not remove the 'vshelper' 'user', but change the standard assigned 'password' with 

       → vxpasswd /var/lib/vcd/vxdb vshelper <YourPassword>


12. check if vcd installation and configuration was successful, do a


vcd -d


if all works fine the output should look like below (I use standard settings for testing)

[debug] vcd[6163]: [trace] vxdb_init (vxdb.c:60)
[debug] vcd[6163]: [trace] vxdb_sanity_check (vxdb.c:32)
[debug] vcd[6163]: [trace] vxdb_prepare (vxdb.c:95)
[debug] vcd[6163]: [vxdb] SELECT uid FROM user WHERE admin = 1
[debug] vcd[6163]: [trace] vxdb_prepare (vxdb.c:95)
[debug] vcd[6163]: [vxdb] SELECT uid FROM user WHERE name = 'vshelper'
[debug] vcd[6163]: [trace] method_registry_init (methods.c:54)
[info ] vcd[6163]: Accepting incomming connections on 127.0.0.1:13386




D. Using VServer Control Daemon[edit]

I. Interacting with VServer Control Client - vcc[edit]

1. Configuring vcc[edit]

The standard vcc config file is stored @ /etc/vcc.conf there you must have a look for, if the username and the password are set correct to your changes, which you have made in vxdb with the commands above!
Standard /etc/vcc.conf[edit]
/* example vcc configuration */
host = localhost
port = 13386

user = admin
pass = MySecret

b. Set up for using tar archived templates[edit]

At this moment no package manager is implemented, but we can create vserver guests with tar archived vserver templates, so let's start!


13. create template folder

sudo mkdir /var/lib/vcd/templates


14. create lock folder 

sudo mkdir /var/lib/vcd/lock


15. copy tar templates into this folder

cp <template>.tar /var/lib/vcd/templates


16. create template.conf

sudo touch /var/lib/vcd/templates/<templatename>.conf


17. configure template.conf

sudoedit /var/lib/vcd/templates/<templatename>.conf

18. insert 
archive = <template>.tar

2. Create your first vserver[edit]

sudo vcc create test1 <templatename>


II. Interacting with VServer Control E - vce[edit]

1. Configuring vce[edit]

The standard vce config file is stored @ /etc/vce.conf there you must have a look for, if the username and the password are set correct to your changes, which you have made in vxdb with the commands above!
Standard /etc/vce.conf[edit]
/* example vce configuration */
host = localhost
port = 13386

user = admin
pass = MySecret


III. Interacting with VServer Helper - vshelper[edit]

1. Configuring vcc[edit]

The standard vshelper config file is stored @ /etc/vshelper.conf there you must have a look for, if the username and the password are set correct to your changes, which you have made in vxdb with the commands above!
Standard /etc/vshelper.conf[edit]
/* example vshelper configuration */
host = localhost
port = 13386

user = vshelper
pass = MySecret

logfile = /var/log/vshelper.log

IV. Interacting with vstatd[edit]

Standard /etc/vstatd.conf[edit]
/* example vstatd configuration */

/* Logfile */
#logfile = /var/log/vstatd.log

/* PID file */
#pidfile = /var/run/vstatd.pid

/* Directory for VXDB, templates and run-time data */
#datadir    = /var/lib/vstatd