Cheat Sheet

Tuesday, June 13, 2017

Short note on installing Ambari

0 comments

Prerequisite


Don't forget to install this first:


yum install rpm-build
yum install gcc-c++
yum install epel-release
yum install nodejs
npm install -g brunch

# install python 2.7 setuptools
wget https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg#md5=fe1f997bc722265116870bc7919059ea
sh setuptools-0.6c11-py2.7.egg


mvn ambari-metrics-storm-sink fetch package failure



Error:
Failed to execute goal on project ambari-metrics-storm-sink: Could not res:storm-core:jar:1.1.0-SNAPSHOT in apache-hadoop

Reason:
There's no storm-core:jar:1.1.0-SNAPSHOT in repo (ref: http://repo.hortonworks.com/content/groups/public/org/apache/storm/storm-core/1.1.0/)

Solution:
Change ./ambari-metrics-storm-sink/pom.xml


From

<properties>
<storm.version>1.1.0-SNAPSHOT</storm.version>
</properties>

To

<properties>
<storm.version>1.1.0</storm.version>
</properties>



psutils-compile failure



Reason:
Python development tools is needed. Just install python-devel on CentOS.


finally





he he he



Thursday, June 8, 2017

Dotnet restore fails: Microsoft.Composition 1.0.27 is not compatible with netcoreapp1.1

0 comments
Because:

Assembly Microsoft.Composition 1.0.27 was build wayy longer before netcoreapp comes into play. But all sources said that it was PCL-ed and should be working fine with netcoreapp or netstandard.

Solution:

Open up csproj, add this to <PropertyGroup> element:


<packagetargetfallback>
   $(PackageTargetFallback);portable-net45+win8+wp8+wpa81;
</packagetargetfallback>



And restore back packages using nu-package

Source: dotnet/corefx issues #9788

Monday, June 5, 2017

OpenNebula: Allowing Private Network accessing outside via host

0 comments
This one is really a pickle. Spend hours of my time to figuring out what went wrong. My private network (interface virbr0 from libvirt daemon, 192.168.122.0/24) can't connect to outside world.

Actually it was a simple solution (have the same problem years ago, but i don't document it well - so i forget to remember).


Solution:
Use firewall or iptables to do NATting between virbr0 with current DMZ/host bridge at HOST. I hate iptables, hence:


firewall-cmd --zone=external --add-interface=virbr0
firewall-cmd --zone=external --add-interface=virbr0 --permanent


And yes. You didn't have to explicitly specify masquerade because external IS the forwarding zone duh! (ref manual: https://fedoraproject.org/wiki/Firewalld?rd=FirewallD#external)


And walla, you got yourself a deal - and a external connection.


PS: Just don't forgot to add DNS to your virbr0 settings (using nmtui should done it, UI-ly).


Why:
Since libvirt by default is configured as Host-Only, all connection via virbr0 can only see their peer, and not outside host. (Here i thought it might have something to do with my network config, libvirt.conf hance DNS not forwarded and not visible! dammit). And by attaching virbr0 to external zone, it will automatically enable NATting and forwarding + post/pre routing.

Guys, if you don't have any complex rule, just use firewall-cmd. Just forget about iptables. It's already 2017 dammit, not the 1997.