-
Notifications
You must be signed in to change notification settings - Fork 7
DevInstallation
To install the development enviroment is adviced to follow the following steps:
The development environment is a CentOS 7 workstation.
Is better to start with an updated machine
If needed set the proxy for the yum
nano /etc/yum.conf
Than update
yum update
reboot
Than install the epel repo and install some package to better work with VirtualBox
yum install epel-release
yum groupinstall "Development Tools"
yum install kernel-devel
yum install dkms
reboot
cd /run/media/
cd VBOXADDITIONS_4.3.26_98988/
./VBoxLinuxAdditions.run
reboot
nano /etc/yum.repos.d/virt7-testing.repo
Write the following content:
[virt7-testing]
name=virt7-testing
baseurl=http://cbs.centos.org/repos/virt7-testing/x86_64/os/
enabled=1
gpgcheck=0
Than execute
yum install docker
systemctl enable docker
systemctl start docker
ls -lat /var/run/docker.sock
chown root:gioppo /var/run/docker.sock
ls -lat /var/run/docker.sock
nano /etc/selinux/config
rpm -ivh https://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm
yum install puppet
gem install r10k
Prepare the CloudOpting folders:
mkdir /cloudOptingData
chown user:user /cloudOptingData/
curl -L https://github.com/docker/compose/releases/download/1.3.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
Development uses some SNAPSHOT repositories since the projects needs to be on the edge of the newest release to benefit from bug fixing and new features considering that the components used are very dynamic in the OSS echosystem
The problem that we have with the current java version is that there is a problem in the keys exchange between maven and the web site resulting in the inability to download the required libraries.
To overcome this problem the following steps are needed:
-
Download from BouncyCastle the libs: bcprov-ext-jdk15on-152.jar and bcprov-jdk15on-152.jar
-
Place them in /etc/alternatives/java_sdk/jre/lib/ext
/etc/alternatives/java_sdk/jre/lib/ext
cp /home/gioppo/Downloads/bcprov-ext-jdk15on-152.jar /etc/alternatives/java_sdk/jre/lib/ext/bcprov-ext-jdk15on-152.jar
- Modify the file
nano /etc/alternatives/java_sdk/jre/lib/security/java.security
Locate the “security.provider” section.
Keep security.provider.1=sun.security.provider.Sun
Locate “security.provider.2″ and make that “security.provider.3″.
Do this for all the remaining “security.provider.n” values.
Set “security.provider.2″ to org.bouncycastle.jce.provider.BouncyCastleProvider
security.provider.2=org.bouncycastle.jce.provider.BouncyCastleProvider
Create a folder named coFluentd in this folder create a file named Dockerfile with the following content
FROM ruby:2.2.0
MAINTAINER kiyoto@treausuredata.com
RUN apt-get update
RUN gem install fluentd -v "~>0.12.3"
RUN mkdir /etc/fluent
RUN apt-get install -y libcurl4-gnutls-dev make
RUN /usr/local/bin/gem install fluent-plugin-elasticsearch
ADD fluent.conf /etc/fluent/
ENTRYPOINT ["/usr/local/bundle/bin/fluentd", "-c", "/etc/fluent/fluent.conf"]
create a fluentd.conf file with the following content
<source>
@type forward
</source>
<match docker.**>
@type stdout
</match>
Now build the image
docker build -t cloudopting/fluentd .
Now is possible to run the container that will execute a fluentd server on the 24224 port and will output all the collected things in the stdout
docker run -d -p 24224:24224 --name=logger cloudopting/fluentd
To test the fluentd container execute
docker run --log-driver=fluentd --log-opt labels=soft --label soft=apache -d --name=testfluentd ubuntu /bin/sh -c "while true; do echo Hi; sleep 1;done"
docker logs logger
expected output is the logs from the testfluentd container
Now you can apply this test to your CloudOpting container to be sure that you are logging the results you want out of it.
Be sure to have installed the zabbix repo
nano /etc/yum.repos.d/zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://repo.zabbix.com/zabbix/2.4/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
Edit the zabbix configuration setting the keys with the listed values
nano /etc/zabbix/zabbix_agentd.conf
...
LogFile=/var/log/zabbix/zabbix_agentd.log
...
EnableRemoteCommands=1
...
Server=cloudoptingmaster.cloudopen.csipiemonte.it,84.240.187.3,172.16.1.63
...
ListenIP=0.0.0.0
...
ServerActive=cloudoptingmaster.cloudopen.csipiemonte.it
...
Hostname=here_you_have_to_write_the_fqdn_of_your_host
...
LoadModulePath=/usr/local/lib/zabbix/agent
...
LoadModule=zabbix_module_docker.so
Get the module for monitoring Docker containers
wget https://drone.io/github.com/jangaraj/Zabbix-Docker-Monitoring/files/zabbix24/src/modules/zabbix_module_docker/zabbix_module_docker.so
usermod -aG docker zabbix
mkdir /usr/local/lib/zabbix
mkdir /usr/local/lib/zabbix/agent
mv zabbix_module_docker.so /usr/local/lib/zabbix/agent/zabbix_module_docker.so
systemctl restart zabbix-agent
The orchestrator will generate a set of files (puppet manifests + Dockerfiles) that are used in the orchestrator to to its work automatically.
To test them in dev environment these following steps need to be done:
unpack the files in a folde of your choice, place yourself in that folder and execute:
r10k puppetfile install
This will create all the needed puppet files for your application in a new folder inside your working directory.
Than you need to read from the docker-compose file the names of the expected image name that it will look for, since this would have been the name of the image that the orchestrator would have used you need to use the same to make use of the compose file later so execute in the exampler in the compose file you read that the image will be cloudopting/csi_webdk you will have to build the image using the webdk.dockerfile with the following command:
docker build -t cloudopting/csi_webdk -f webdk.dockerfile .
To open the zabbix ports on firewalld:
firewall-cmd --zone=public --add-port=10050/tcp --permanent
firewall-cmd --zone=public --add-port=10051/tcp --permanent
firewall-cmd --reload
- Home
- Creating templates for sending mails
- DevInstallation
- Installation
- Relation processes
- Tools used
- TOSCA Documentation