http://klaus.ede.ase.au.dk/index.php?title=Special:NewPages&feed=atom&limit=50&offset=&namespace=0&username=&tagfilter=Klaus' wiki - New pages [en-gb]2024-03-29T14:35:16ZFrom Klaus' wikiMediaWiki 1.23.13http://klaus.ede.ase.au.dk/index.php/Build_a_virtual_Elab_serverBuild a virtual Elab server2021-03-22T12:17:01Z<p>Klaus: </p>
<hr />
<div>This is instructions to build a virtual copy of the elab.ece.au.dk server, so you can develop against this mashine rather than on the operative elab-server.<br />
<br />
==Prerequisites==<br />
<br />
On your VirtualBox install an Oracle UEK 7.9 server using this DVD, which you have downloaded first: [https://yum.oracle.com/ISOS/OracleLinux/OL7/u9/x86_64/OracleLinux-R7-U9-Server-x86_64-dvd.iso Oracle 7.9 DVD]. Be sure to give root a password and create an ordinary user while installed - you're prompted as one of the first things to do. Let the ordinary user be administrator.<br />
<br />
When installed as root '''(every command from this point is run as root)''' perform<br />
<source lang=bash><br />
yum update<br />
reboot now<br />
yum install epel<br />
</source><br />
<br />
===Graphical insterface===<br />
If you want a graphical interface do this:<br />
<source lang=bash><br />
yum -y groupinstall kde "KDE Plasma Workspaces"<br />
yum install kernel-headers kernel-devel make gcc perl dkms bzip2<br />
reboot<br />
yum grouplist<br />
yum groupinstall "Server with GUI"<br />
cd /etc/systemd/system/ <br />
ls <br />
rm default.target <br />
ln -s /usr/lib/systemd/system/graphical.target default.target <br />
ll <br />
reboot now<br />
</source><br />
<br />
Insert the Guest additions CD from the VirtualBox interface and install the extensions.<br />
<br />
==Docker installation==<br />
Now install docker. First edit /etc/yum.repos.d/oracle-linux-ol7.repo change 0 til 1 in the section [ol7_addons], save and execute:<br />
<source lang=bash><br />
yum install docker-engine docker-cli docker-compose<br />
</source><br />
<br />
Let your favourite browser open [https://github.com/AUTeam2 the team github page] from the students that constrructed this server setup.<br />
<br />
Create under root a directory called e.g. elab-server<br />
<source lang=bash><br />
mkdir elab-server <br />
git clone https://github.com/AUTeam2/server-setup.git<br />
</source><br />
<br />
Start docker<br />
<source lang=bash><br />
systemctl enable docker.service<br />
systemctl start docker.service<br />
</source><br />
<br />
create volumens<br />
<source lang=bash><br />
docker volume create data-volume<br />
docker volume create mqtt-volume<br />
</source><br />
Change version number in the docker-compose.yml file from 3.7 to 3.3<br />
<source lang=bash><br />
docker-compose up -d --build<br />
</source><br />
be sure that it ends without errors - if, then try to run it again. It takes quite a while! (on my 6 core virtual machine more than one hour)<br />
<br />
==Starting the services==<br />
<br />
In order to start the services, web, mqtt, database et al issue this command, while still located in the directory where the '''docker-compose.yml''' file is located:<br />
<br />
<source lang=bash><br />
docker-compose up<br />
</source><br />
<br />
==Connecting to the mqtt server==<br />
<br />
The built-in mqtt server can be contacted using this command for subscribing to a channel, provided you have installed the mosquitto package:<br />
<br />
<source lang=bash><br />
mosquitto_sub -h localhost -t "test" -p 8000 -u team2 -P team2<br />
</source><br />
<br />
and likewise the publisher can used by issuiong this command:<br />
<br />
<source lang=bash><br />
mosquitto_pub -h localhost -t "test" -p 8000 -m "PingPong" -u team2 -P team2<br />
</source></div>Klaus