Hi,

There is a problem with starting the cassandra from the Entrypoint at the
docker file. BUT it totally works fine when I run the script
(run_scripts.sh) inside the instance (ssh root@10.11.12.2).

The following line is used in the docker file to call the run script at
Entrypoint

ENTRYPOINT /usr/local/bin/run_scripts.sh | /usr/sbin/sshd -D


run_scripts.sh has the following lines of code to execute

#!/bin/bash
source /root/.bashrc
/usr/local/bin/metadata_svc_bugfix.sh
/etc/init.d/apache2 start > /tmp/apache_start.log
/root/bin/init.sh > /tmp/init.log &
opt/cassandra/bin/start.sh > /tmp/cassandra_start.log &


from the run script I am calling the start.sh to start the cassandra,
run_script contains the following

#setting up the env variables
export JAVA_HOME=/opt/java
export CASSANDRA_HOME=/opt/cassandra
export PATH=$PATH:/opt/cassandra/bin:/opt/java/bin
export CASSANDRA_CONF=/opt/cassandra/conf
export CLASSPATH=/opt/cassandra/lib/*.jar

echo "127.0.0.1 localhost" >> /etc/hosts
/opt/cassandra/bin/cassandra


The cassandra didn't start at the Entrypoint, then I logged the error into
a file using the following line
/opt/cassandra/bin/cassandra >> /tmp/cassandra_start.log 2>&1

Error: Exception thrown by the agent : java.net.MalformedURLException:
Local host name unknown: java.net.UnknownHostException:
instance-00000001: instance-00000001

Then found the fix from the following discussion
http://stackoverflow.com/questions/7496640/problem-on-starting-cassandra

and modified the script replacing  echo "127.0.0.1 localhost" >> /etc/hosts
with
echo "127.0.0.1 localhost.localdomain localhost instance-00000001" >>
/etc/hosts

But unfortunately I am not able to append the 'hosts' file in etc because
it is a read only file.

Why is it that it is able to start cassandra inside the instance using the
same script but not from calling the script at entrypoint?

Herewith I have attached all the Dockerfile, Run_scripts.sh and Start.sh.


Thank you
-- 
*Vishanth Balasubramaniam*
Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: *+94771737718*
about me: *http://about.me/vishanth <http://about.me/vishanth>*

Attachment: Dockerfile
Description: Binary data

Attachment: run_scripts.sh
Description: Bourne shell script

Attachment: start.sh
Description: Bourne shell script

Reply via email to