2015-03-30 55 views
0

我正在嘗試使用IBM BigInsights QuickStart Edition創建Docker鏡像,以便在可以找到本機軟件安裝程序的DOCKER容器雲(例如IBM Bluemix)上運行在這裏:創建BigInsights(IBM Hadoop)Docker鏡像,sysctl問題

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

的問題是,在安裝過程中,我得到的是通過sysctl一些內核參數訪問錯誤設置不正確。

如果我使用Dockerfile調整他們,我得到一個錯誤說:

只讀文件系統

現在我想知道如果有可能,因爲在所有的內核參數已創建一個BigInsights圖片在主機上設置,當然我無法在容器雲中進行控制。

的Dockerfile看起來是這樣的:

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 '' 

,重視我運行以下命令容器後:

/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 

確切的錯誤是:

[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. 

所以基本上SW如何被docker化,需要設置內核參數等更改?

問候

羅密歐(Kienzler)

回答

2

嘗試用sudo

運行命令