Search code examples
hadoopdockeribm-cloudsysctlbiginsights

Creating BigInsights (IBM Hadoop) Docker image, sysctl issue


I'm trying to create a docker image using IBM BigInsights QuickStart Edition to be run on a DOCKER container cloud (e.g. IBM Bluemix) with the Native Software Installer which can be found here:

http://www-01.ibm.com/software/data/infosphere/biginsights/quick-start/downloads.html

The problem is that during installation I get errors that some kernel parameters accessible using sysctl are not set correctly.

If I adjust them using the Dockerfile I get an error saying:

Read-Only filesystem

Now I'm wondering if it is possible to create a BigInsights Image at all since the kernel parameters have to be set on the host machine which of course I cannot control in a container cloud.

The Dockerfile looks like this:

FROM centos:latest

COPY biginsights-3.0.0.2-quickstart-nonproduction-Linux-amd64-b20150120_1502 /usr/local/biginsights-3.0.0.2-quickstart-nonproduction-Linux-amd64-b20150120_1502

RUN yum -y install tar
RUN yum -y install hostname
RUN yum -y install expect
RUN yum -y install net-tools
RUN yum -y install openssh
RUN yum -y install openssh-clients
RUN yum -y install openssh-server
RUN yum -y install passwd
RUN yum -y install sudo


RUN ssh-keygen -f id_rsa -t rsa -N ''

RUN mkdir /root/.ssh
RUN chmod 700 /root/.ssh
RUN mv id_rsa* /root/.ssh/
RUN cat /root/.ssh/id_rsa.pub > /root/.ssh/authorized_keys
RUN cat /etc/ssh/sshd_config |sed 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' | sed 's/#RSAAuthentication yes/RSAAuthentication yes/'| sed 's/HostKey \/etc\/ssh\/ssh_host_rsa_key/#HostKey \/etc\/ssh\/ssh_host_rsa_key/'| sed 's/HostKey \/etc\/ssh\/ssh_host_ecdsa_key/#HostKey \/etc\/ssh\/ssh_host_ecdsa_key/' > /etc/ssh/sshd_config.stage
RUN mv /etc/ssh/sshd_config.stage /etc/ssh/sshd_config
RUN ssh-keygen -f /etc/ssh/ssh_host_key -N '' -t rsa1
RUN ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa
RUN ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa
RUN ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ''

And after attaching to the container I run the following commands:

/sbin/sshd -f /etc/ssh/sshd_config
cat /etc/ssh/ssh_host_ecdsa_key.pub  |awk '{print "localhost " $1" "$2}' > /root/.ssh/known_hosts


echo "UUID=dummy /dummy    dummy   defaults,noauto 0 0" >> /etc/fstab

export myip=`ifconfig |grep netmask|head -1|awk '{print $2}'`
export myhostname=`hostname`

cat /usr/local/biginsights-3.0.0.2-quickstart-nonproduction-Linux-amd64-b20150120_1502/silent-install/sample-install-enterprise-defaultFlat.xml |sed 's/9.125.91.82/'"$myip"'/g' |sed 's/node.sample.ibm.com/'"$myhostname"'/g' |sed 's/<partitions>1<\/partitions>/<partitions>2<\/partitions>/' > /usr/local/biginsights-3.0.0.2-quickstart-nonproduction-Linux-amd64-b20150120_1502/install.xml

/usr/local/biginsights-3.0.0.2-quickstart-nonproduction-Linux-amd64-b20150120_1502/silent-install/silent-install.sh

The exact error is:

[ERROR] (CDYIN0220E) 172.17.0.49: The kernel parameter kernel.pid_max is not set to 4194303.  Use the sysctl program to set the kernel.pid_max parameter to 4194303.
[ERROR] (CDYIN0221E) 172.17.0.49: The kernel parameter net.ipv4.ip_local_port_range is not set to a minimum of 1024.  Use the sysctl program to set the minimum to 1024.
[ERROR] (CDYIN0222E) 172.17.0.49: The kernel parameter net.ipv4.ip_local_port_range is not set to a maximum of 64000.  Use the sysctl program to set the maximum to 64000 or greater.

So basically how can SW be dockerized requiring changes like kernel parameters to be set?

best regards

Romeo (Kienzler)


Solution

  • Try running the commands with sudo