kubernetes setup on ubuntu machine with 2 minion and 1 master node - docker

I am following this tutorial at https://gettech1.wordpress.com/2016/05/26/setting-up-kubernetes-cluster-on-ubuntu-14-04-lts/ to setup kubernet multi node with 2 minions and 1 master node on remote ubuntu machines, after following all the steps it goes OK. But when I am trying to run the ./kube-up.sh bash file. It returns the following errors
ubuntu#ip-XXX-YYY-ZZZ-AAA:~/kubernetes/cluster
$ ./kube-up.sh
Starting cluster in us-central1-b using provider gce ... calling
verify-prereqs Can't find gcloud in PATH, please fix and retry. The
Google Cloud SDK can be downloaded from
https://cloud.google.com/sdk/.
Edit : I have fixed above issue after exporting different environment variables like
$ export KUBE_VERSION=2.2.1
$ export FLANNEL_VERSION=0.5.5
$ export ETCD_VERSION=1.1.8
but after that it is generating this issue
kubernet gzip: stdin: not in gzip format tar: Child returned status 1
tar: Error is not recoverable: exiting now

The command you should be executing is KUBERNETES_PROVIDER=ubuntu ./kube-up.sh
Without setting that environment variable kube-up.sh tries to deploy VMs on Google Compute Engine and to do so it needs the gcloud binary that you don't have installed.

Related

start logstash from rails application

Question: How can I start logstash from a script on my rails application?
Background: I have logstash and elasticsearch running on a server. I have a rails application which uploads a CSV to the server and logstash then processes. It works if I manually execute the generated script. If I try to have rails do a system command, I get an error.
Manually call the script from server (WORKS)
logstash_folder/execute_random.sh
Rails app system command(ERROR)
`logstash_folder/execute_random.sh`
Error: WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
execute_random.sh (script being called)
#!/bin/bash
sudo systemctl stop logstash
sleep 1
sudo /usr/share/logstash/bin/logstash -f logstash_folder/conf_folder/logstash.conf
Looking over this blog
https://discuss.elastic.co/t/warning-could-not-find-logstash-yml-which-is-typically-located-in-ls-home-config-or-etc-logstash/131022/15
I change the script to include --path.settings
sudo /usr/share/logstash/bin/logstash --path.settings /etc/logstash/ --path.data -f logstash_folder/#{self.logstash_index}/#{self.logstash_index}.conf"
& recieve this error
ERROR: Unknown command 'logstash_folder/conf_folder/logstash.conf'
OR
[INFO ][logstash.config.source.local.configpathloader] No config files found in
path {:path=>"/logstash_folder/conf_folder/logstash.conf"}
[ERROR][logstash.config.sourceloader]
No configuration found in the configured sources.
I was creating the command as a variable
example = "execute_#{index}"
and then setting that into backticks with a variable
execute_example = example
which didn't work
ended up using System("#{example}") and that worked...
3days of stress

Docker Toolbox Error: Looks like something went wrong in step 'Setting env'

I had Docker Toolbox installed on my Windows 7 PC and I wanted to upgrade my Docker installation to the most recent version. To do that, I decided to delete Docker Toolbox from my system and reinstall it. I uninstalled Docker Toolbox, uninstalled VirtualBox, and removed all instances of both in my files (such as files in AppData). After reinstalling Docker Toolbox and launching the Quickstart Terminal, I ran into the following error:
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this vi
rtual machine, run: C:\Program Files\Docker Toolbox\docker-machine.exe env defau
lt
Looks like something went wrong in step 'Setting env'... Press any key to contin
ue...
So it seems like it failed when "setting env". I'm not sure what that means in this context and I wish there was a way to check some extended logs to get more detail. I tried following the Docker documentation pointing the location of daemon logs in AppData, however, I could not find anything relevant. Something I did find was a file called "no-error-report", though it was empty.
I tried uninstalling everything again and reinstalling with the attribute NDIS5 network type checked, I've ran the Quickstart Terminal as admin, and I still ran into the same exact error.
Any suggestions on how I may approach this issue?
I got this same issue.
I fixed this by doing the below procedures.
I changed the below lines in start.sh
STEP="Setting env"
eval "$("${DOCKER_MACHINE}" env --shell=bash --no-proxy "${VM}" | sed -e "s/export/SETX/g" | sed -e "s/=/ /g")" &> /dev/null #for persistent Environment Variables, available in next sessions
eval "$("${DOCKER_MACHINE}" env --shell=bash --no-proxy "${VM}")" #for transient Environment Variables, available in current session
Changed --no-proxy to --http_proxy since I am using http proxy

CircleCI CLI Error on Ubuntu WSL: open .circleci/config.yml: no such file or directory

I'm trying to get the CircleCI CLI tool ( https://circleci.com/docs/2.0/local-jobs/ ) working on Ubuntu WSL on Windows 10. It appeared to install successfully -- and the file permissions appear to be correct. I have Docker for Windows installed and running, and the Linux Docker client works without issue.
But now it always errors when trying to validate a CircleCI config file.
I have tried:
circleci config validate -c .circleci/config.yml
and
circleci config validate
from the root of my repo.
But each time, it gives the error:
Error: open .circleci/config.yml: no such file or directory
Has anyone been able to get this work?
sudo worked for me to overcome this. However, I stuck with the next error.

Bitbucket Server Installation Error

I'm attempting to install Bitbucket server on my linux server. I'm following the steps here. I'm stuck at step 3. I've installed Bitbucket server, and now when trying to "Setup Bitbucket Server" I'm not able to access it from my browser.
I've done the following:
Using SSH I've went to the directory containing /atlassian/bitbucket/4.4.1/
I run the command bin/start-bitbucket.sh.
it gives the following message:
Starting Atlassian Bitbucket as current user
-------------------------------------------------------------------------------
JAVA_HOME "/usr/local/jdk" does not point to a valid Java home directory.
-------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Bitbucket is being run with a umask that contains potentially unsafe settings.
The following issues were found with the mask "u=rwx,g=rwx,o=rx" (0002):
- access is allowed to 'others'. It is recommended that 'others' be denied
all access for security reasons.
- write access is allowed to 'group'. It is recommend that 'group' be
denied write access. Read access to a restricted group is recommended
to allow access to the logs.
The recommended umask for Bitbucket is "u=,g=w,o=rwx" (0027) and can be
configured in setenv.sh
----------------------------------------------------------------------------------
Using BITBUCKET_HOME: /home/wbbstaging/atlassian/application-data/bitbucket
Using CATALINA_BASE: /home/wbbstaging/atlassian/bitbucket/4.4.1
Using CATALINA_HOME: /home/wbbstaging/atlassian/bitbucket/4.4.1
Using CATALINA_TMPDIR: /home/wbbstaging/atlassian/bitbucket/4.4.1/temp
Using JRE_HOME: /usr/local/jdk
Using CLASSPATH: /home/wbbstaging/atlassian/bitbucket/4.4.1/bin/bitbucket-bootstrap.jar:/home/wbbstaging/atlassian/bitbucket/4.4.1/bin/bootstrap.jar:/home/wbbstaging/atlassian/bitbucket/4.4.1/bin/tomcat-juli.jar
Using CATALINA_PID: /home/wbbstaging/atlassian/bitbucket/4.4.1/work/catalina.pid
Existing PID file found during start.
Removing/clearing stale PID file.
Tomcat started.
Success! You can now use Bitbucket at the following address:
http://localhost:7990/
If you cannot access Bitbucket at the above location within 3 minutes, or encounter any other issues starting or stopping Atlassian Bitbucket, please see the troubleshooting guide at:
I try to access http://myserveraddress:7990, but i receive ERR_CONNECTION_REFUSED message. Is it because of the message JAVA_HOME "/usr/local/jdk" does not point to a valid Java home directory?
My server is running:
CentOS Linux release 7.2.1511
And I'm attempting to install
Bitbucket Server 4.4.1
Make sure you have java installed by running java --version
If it's not installed, start there. If it is installed, verify where by running find /-name java
Open /root/.bash_profile through your text editor. (I prefer to use vi editor)
And paste the given below two lines(noting that my below version may be different from what you see)
export JAVA_HOME=/usr/java/jdk1.7.0_21
export PATH=/usr/java/jdk1.7.0_21/bin:$PATH
Now enable the Java variable without system restart (On system restart it bydefault set the java variable)
source /root/.bash_profile
Now check the Java version,JAVA_HOME and PATH variables.It should show you correct information as you have set.
java --version
echo $JAVA_HOME
echo $PATH
Below is my system’s root bash_profile file
[root#localhost ~]# cat /root/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export JAVA_HOME=/usr/java/jdk1.7.0_21
export PATH=/usr/java/jdk1.7.0_21/bin:$PATH
[root#localhost ~]#

Elastic Beanstalk docker error

I'm getting a cryptic error when trying to update the configuration of a single-container Docker application. Anybody have an idea of what might cause this, or how to go about debugging it?
ERROR [3009] : Command execution failed:
[CMD-ConfigDeploy/ConfigDeployStage0/ConfigDeployPreHook/00run.sh]
command failed with error code 1:
/opt/elasticbeanstalk/hooks/configdeploy/pre/00run.sh
docker: "tag" requires 2 arguments. See 'docker tag --help'.
(ElasticBeanstalk::ActivityFatalError)
I've seen this one before, and believe this happens when the Docker container failed to build. The command that failed is the one which runs your container, and it's failing (IIRC) because it can't find the container from the previous build step. Things to try:
Does the Docker container build successfully with eb local? (https://aws.amazon.com/blogs/aws/run-docker-apps-locally-using-the-elastic-beanstalk-eb-cli/)
Try checking eb-activity.log for errors during the build process
Terminate the EC2 instance or rebuild the EB environment (sometimes smaller instances get out-of-memory errors that prevent further deployments)
It could happen if your application fails to start successfully the first time it deploys. Just started having this problem myself.
Take a look at /var/log/eb-activity.log on your server... you may see something like:
[2015-07-23T00:19:11.015Z] INFO [2624] - [CMD-Startup/StartupStage1/AppDeployEnactHook/00run.sh] : Starting activity...
[2015-07-23T00:19:17.506Z] INFO [2624] - [CMD-Startup/StartupStage1/AppDeployEnactHook/00run.sh] : Activity execution failed, because: jq: error: Cannot iterate over null
aca80d7accfe4800ff04992e2f89a1e05689423d286deee31b53bf470ce89afb
Docker container quit unexpectedly after launch: bleBeanFactory.java:942)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
... 93 more. Check snapshot logs for details. (ElasticBeanstalk::ExternalInvocationError)
caused by: jq: error: Cannot iterate over null
aca80d7accfe4800ff04992e2f89a1e05689423d286deee31b53bf470ce89afb
Docker container quit unexpectedly after launch: bleBeanFactory.java:942)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
... 93 more. Check snapshot logs for details. (Executor::NonZeroExitStatus)
[2015-07-23T00:19:17.506Z] INFO [2624] - [CMD-Startup/StartupStage1/AppDeployEnactHook/00run.sh] : Activity failed.
[2015-07-23T00:19:17.507Z] INFO [2624] - [CMD-Startup/StartupStage1/AppDeployEnactHook] : Activity failed.
[2015-07-23T00:19:17.507Z] INFO [2624] - [CMD-Startup/StartupStage1] : Activity failed.
[2015-07-23T00:19:17.507Z] INFO [2624] - [CMD-Startup] : Completed activity. Result:
Command CMD-Startup(stage 1) failed.
Next, look at /var/log/eb-docker/containers/eb-current-app If you see an unexpected-quit.log then it should contain the errors that your application logged as it tried, unsuccessfully, to start.
Unfortunately, in my case, it's failing to start because an environment variable is missing. However, AWS prevents me from updating the configuration while the beanstalk is in this state. And I can't specify the environment variables while I create the environment. So I'm not sure what I'll do to fix the problem.
I have the exact same issue as #Shannon's. My workaround is
first, deploy a sample Dockerfile that guarantees to work,
then setup all environment variables my real Docker app would need,
finally redeploy the real Docker app.
A sample Dockerfile copy-pasted from AWS documentation:
FROM ubuntu:12.04
RUN apt-get update
RUN apt-get install -y nginx zip curl
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
RUN curl -o /usr/share/nginx/www/master.zip -L https://codeload.github.com/gabrielecirulli/2048/zip/master
RUN cd /usr/share/nginx/www/ && unzip master.zip && mv 2048-master/* . && rm -rf 2048-master master.zip
EXPOSE 80
CMD ["/usr/sbin/nginx", "-c", "/etc/nginx/nginx.conf"]
You can provide your environment variables on the command line in the eb create and eb clone commands. These are set before the create or clone task so the environment will come up with them set.
See the eb cli help. For example...
$ eb create -h
...
--envvars ENVVARS a comma-separated list of environment variables as
key=value pairs
...

Resources