Instalação do ContextNet
Instalação e configuração do ContextNet
Instale o OpenSplice. Instruções mais detalhadas em http://www.lac.inf.puc-rio.br/dokuwiki/doku.php?id=installingdds.
Faça download (ou upload) do arquivo OpenSpliceDDSV6.4.140407OSS-HDE-x86_64.linux-gcc4.6-glibc2.15-installer.tar.gz
Descompacte o arquivo, crie o diretório /opt/OpenSplice e copie o diretório HDE para /opt/OpenSplice
$ tar -xvf VortexOpenSplice-6.9.181127OSS-HDE-x86_64.linux-gcc5.4.0-glibc2.23-installer.tar.gz
$ sudo mkdir /opt/OpenSplice
$ sudo mv HDE /opt/OpenSplice/
O resultado será:
$ ls -l /opt/OpenSplice/
total 4
drwxrwxr-x 3 contextnet contextnet 4096 Apr 14 2014 HDE
Crie um arquivo vazio chamado opensplice.sh e torne o arquivo executável:
$ sudo vi /etc/profile.d/opensplice.sh
$ sudo chmod +x /etc/profile.d/opensplice.sh
Copie o seguinte conteúdo para dentro do arquivo:
OSPL_HOME=/opt/OpenSplice/HDE/x86_64.linux
PATH=$OSPL_HOME/bin:$PATH
LD_LIBRARY_PATH=$OSPL_HOME/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
CPATH=$OSPL_HOME/include:$OSPL_HOME/include/sys:${CPATH:=}
OSPL_URI=file://$OSPL_HOME/etc/config/ospl.xml
export OSPL_HOME PATH LD_LIBRARY_PATH CPATH OSPL_TMPL_PATH OSPL_URI
Edite o arquivo /opt/OpenSplice/HDE/x86_64.linux/etc/config/ospl.xml:
$ sudo cp /opt/OpenSplice/HDE/x86_64.linux/etc/config/ospl.xml{,.velho}
$ sudo vi /opt/OpenSplice/HDE/x86_64.linux/etc/config/ospl.xml
Substitua o seu conteúdo por:
<OpenSplice>
<Domain>
<Name>ospl_sp_ddsi</Name>
<Id>0</Id>
<SingleProcess>true</SingleProcess>
<Service name="ddsi2">
<Command>ddsi2</Command>
</Service>
<Service name="durability">
<Command>durability</Command>
</Service>
<Service enabled="false" name="cmsoap">
<Command>cmsoap</Command>
</Service>
<Listeners>
<StackSize>256000</StackSize>
</Listeners>
</Domain>
<DDSI2Service name="ddsi2">
<General>
<NetworkInterfaceAddress>AUTO</NetworkInterfaceAddress>
<AllowMulticast>true</AllowMulticast>
<EnableMulticastLoopback>true</EnableMulticastLoopback>
<CoexistWithNativeNetworking>false</CoexistWithNativeNetworking>
</General>
<Compatibility>
<!-- see the release notes and/or the OpenSplice configurator on DDSI interoperability -->
<StandardsConformance>lax</StandardsConformance>
<!-- the following one is necessary only for TwinOaks CoreDX DDS compatibility -->
<!-- <ExplicitlyPublishQosSetToDefault>true</ExplicitlyPublishQosSetToDefault> -->
</Compatibility>
</DDSI2Service>
<DurabilityService name="durability">
<Network>
<Alignment>
<TimeAlignment>false</TimeAlignment>
<RequestCombinePeriod>
<Initial>2.5</Initial>
<Operational>0.1</Operational>
</RequestCombinePeriod>
</Alignment>
<WaitForAttachment maxWaitCount="10">
<ServiceName>ddsi2</ServiceName>
</WaitForAttachment>
</Network>
<NameSpaces>
<NameSpace name="defaultNamespace">
<Partition>*</Partition>
</NameSpace>
<Policy alignee="Initial" aligner="true" durability="Durable" nameSpace="defaultNamespace"/>
</NameSpaces>
</DurabilityService>
<TunerService name="cmsoap">
<Server>
<PortNr>Auto</PortNr>
</Server>
</TunerService>
</OpenSplice>
Crie o diretório /opt/ContextNet e copie o ContextNet e o ClientLib para lá com os seguintes comandos:
$ sudo mkdir /opt/ContextNet
$ sudo scp cloud-di@172.16.0.1:Downloads/Contextnet/contextnet-2.5.jar /opt/ContextNet
$ sudo scp cloud-di@172.16.0.1:Downloads/Contextnet/udilib.jar /opt/ContextNet
Resultado:
$ ls -l /opt/
total 8
drwxrwxr-x 2 contextnet contextnet 4096 Apr 15 19:14 ContextNet
drwxr-xr-x 3 root root 4096 Apr 15 18:59 OpenSplice
Opcionalmente, para evitar a mensagem de erro ao iniciar o Gateway do ContextNet, instale a biblioteca SIGAR. Faça upload (ou download) da biblioteca hyperic-sigar-1.6.4.zip ou equivalente para o host a partir de https://sourceforge.net/projects/sigar/files/. Descompacte, mova e muda as permissões com os comandos a seguir (pode ser necessário instalar o unzip):
$ scp cloud-di@172.16.0.1:Downloads/hyperic-sigar-1.6.4.zip .
$ unzip hyperic-sigar-1.6.4.zip
$ sudo mv hyperic-sigar-1.6.4/sigar-bin/lib/*.so /opt/OpenSplice/HDE/x86_64.linux/lib/
$ sudo chmod 775 /opt/OpenSplice/HDE/x86_64.linux/lib/libsigar-*
Reinicie o computador.