sudo minikube returns "command not found" - minikube

I need to run minikube as sudo on Centos 7.5.
Minikube is in /usr/local/bin
For the user echo $PATH is:
/usr/local/maven/bin:/usr/lib64/qt-3.3/bin:/usr/local/maven/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
For root echo $PATH is:
/usr/local/bin/:/usr/lib64/qt-3.3/bin:/usr/local/maven/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
I even added the following to visudo
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
Still
udo minikube start --cpus 4 --memory 24000 --disk-size=50g --kubernetes-version=v1.7.4 --vm-driver=none
returns sudo: minikube: command not found
What is wrong?

You need to change the location of where the Minikube executable is for the root user to find it. I copied the executable to where root normally looks for files. Example: sudo cp /usr/local/bin/Minikube /usr/bin

Running brew link minikube solved it for me. You have to create the symlink after installing minikube.

Related

mongodb installation on mac using brew with zsh

I'm using zsh and installed mongo using: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/
when trying to use mongod --config /usr/local/etc/mongod.conf --fork I get:
➜ ~ brew list
gettext openjdk scala#2.11
git pcre2
mongodb-community#4.0 sbt
➜ ~ brew services start mongodb-community#4.0
Service `mongodb-community#4.0` already started, use `brew services restart mongodb-community#4.0` to restart.
➜ ~ mongod --config /usr/local/etc/mongod.conf --fork
zsh: command not found: mongod
Can someone help?
It looks like you haven't set path variable for mongodb. You can set it in .zshrc file.
Open .zshrc file in vim using vim ~/.zshrc
then paste the following line
export PATH="<your mongodb bin folder path>:$PATH"
in my case the path is
/Users/namardeepsood/Development/mongodb/bin
save this file and run source ~/.zshrc to refresh the current shell environment.

Minikube installation failing within script

I am installing Minikube on Ubuntu 16.04 LTS (instructions available below). It is working fine when I run each command manually. However, if I put these in a script file install.sh it will fail at the last step giving me an error:
Error
Starting VM...
E0710 20:42:00.618251 20443 start.go:168] Error starting host: Error getting state for host: getting connection: looking up domain: virError(Code=42, Domain=10, Message='Domain not found: no domain with matching name 'minikube'').
Retrying.
E0710 20:42:00.618595 20443 start.go:174] Error starting host: Error getting state for host: getting connection: looking up domain: virError(Code=42, Domain=10, Message='Domain not found: no domain with matching name 'minikube'')
================================================================================
An error has occurred. Would you like to opt in to sending anonymized crash
information to minikube to help prevent future errors?
To opt out of these messages, run the command:
minikube config set WantReportErrorPrompt false
================================================================================
Please enter your response [Y/n]:
Instructions
sudo apt-get -y update
sudo apt-get -y upgrade
#Make sure no prior copy of minikube exists.
sudo rm -rf .minikube/
#Install minikube. Make sure to check for latest version (e.g. current version is 0.28.0)
curl -Lo minikube https://storage.googleapis.com/minikube/releases/$MINIKUBE_VERSION/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
#Install kvm2
curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 && chmod +x docker-machine-driver-kvm2 && sudo mv docker-machine-driver-kvm2 /usr/bin/
sudo apt install -y libvirt-bin qemu-kvm
sudo usermod -a -G libvirtd $(whoami)
#Check to ensure libvirtd service is running.
systemctl status libvirtd
minikube start --vm-driver kvm2
Also, when the script fails if I re-run the following command I get the minikube working fine. Just don't know why it fails originally when running within the script.
sudo rm -rf .minikube/
minikube start --vm-driver kvm2
If you're running this script not for the first time, sudo rm -rf .minikube/ will not be enough.
You should also run the below command:
minikube delete
And, just in case, add a shebang to the top of the script:
#!/bin/bash

Install Marklogic in ubuntu 16.04?

I want to install MarkLogic 9 on my ubuntu machine. I tried following steps from this doc
sudo apt-get install alien
sudo alien --to-deb --verbose MarkLogic-9.0-3.1.x86_64.rpm
sudo dpkg -i marklogic_4.1-6_amd64.deb
sudo /etc/init.d/MarkLogic start
But when I tried the second one I got an error like this:
iama#learner:~$ sudo alien --to-deb --verbose MarkLogic-9.0-3.1.x86_64.rpmFile "MarkLogic-9.0-3.1.x86_64.rpm" not found.
I don't know how to proceed further. I just wanted to confirm, is there any official documentation to install MarkLogic 9 in ubuntu?
The error is "File Not Found"
Make sure the rpm file exists in the current directory with read privileges with the name given.
Make sure sudo is not changing to another directory.
To be certain, use an absolute file path.
Then, test with sudo ls -l file..

Starting services at container startup

I'm trying to run 3 services at my container startup (snmpd, sshd and centengine)
As runlevel is unknown in the container, services won't start.
I built an image with this Dockerfile :
FROM centos:6.7
MAINTAINER nael <me#mail>
# Update CentOS
RUN yum -y update
# Install wget
RUN yum install -y wget
# Get Centreon Repo
RUN wget http://yum.centreon.com/standard/3.0/stable/ces-standard.repo -O /etc/yum.repos.d/ces-standard.repo
# Install Packages (SSH, sudo, Centreon Poller & Engine, SNMP)
RUN yum install -y --nogpgcheck openssh-clients openssh-server centreon-poller-centreon-engine sudo net-snmp net-snmp-utils
# Install supervisord
RUN rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
RUN yum --enablerepo=epel install -y supervisor
RUN mv -f /etc/supervisord.conf /etc/supervisord.conf.org
ADD supervisord.conf /etc/
# For sshd & centengine
EXPOSE 22 5669
# Change user password
RUN echo -e "password" | (passwd --stdin user)
# Disable PAM (causing issues while ssh login)
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
RUN sed -ri 's/#UsePAM no/UsePAM no/g' /etc/ssh/sshd_config
# Start supervisord
CMD ["/usr/bin/supervisord"]
Here is the supervisord.conf file
[supervisord]
nodaemon=true
pidfile=/var/run/supervisord.pid
logfile=/var/log/supervisor/supervisord.log
[program:centengine]
command=service centengine start
[program:snmpd]
command=service snmpd start
[program:sshd]
command=service sshd start
But with this Dockerfile and supervisord.conf, when I start my container theses services aren't running.
What could be the problem ?
Not anymore using supervisord.
I just include a script with all the services ... start commands in the Dockerfile. When I create my container with docker run ... I just specify that I want to start it with my script.
& that's working very well.
Thanks #warmoverflow for trying to solve this.
You may find my dockerfy utility useful starting services, pre-running initialization commands before the primary command starts. See https://github.com/markriggins/dockerfy
For example:
RUN wget https://github.com/markriggins/dockerfy/releases/download/0.2.4/dockerfy-linux-amd64-0.2.4.tar.gz; \
tar -C /usr/local/bin -xvzf dockerfy-linux-amd64-*tar.gz; \
rm dockerfy-linux-amd64-*tar.gz;
ENTRYPOINT dockerfy
COMMAND --start bash -c "while false; do echo 'Ima Service'; sleep 1; done" -- \
--reap -- \
nginx
Would run a bash script as a service, echoing "Ima Service" every second, while the primary command nginx runs. If nginx exits, then the "Ima Service" script will automatically be stopped.
As an added benefit, any zombie processes left over by nginx will be automatically cleaned up.
You can also tail log files such as /var/log/nginx/error.log to stderr, edit nginx's configuration prior to startup and much more

Matlab R2016a glxna64 installation in ubuntu

I am trying to install the matlab on my ubuntu 14.04. I have downloaded the student trial version from mathworks. I downloaded a zip file. The other resources are telling me to unzip it and the open the installer. I did that but I cannot find the installer. if i click on install it opens some text file which has some shell programming in it
Please help me to get out of this problem.
You will need to use ISO images:
Assuming that image is named R2015b_glnxa64.iso, simply mount ISO:
sudo mkdir -p /media/iso sudo mount -o ro,loop ./R2015b_glnxa64.iso
/media/iso
run the installation script:
sudo /media/iso/install
and if you want to install (two DVDs/ISOs), you should use the same path for mounting both ISO images:
1.
mount DVD1 sudo mount -o ro,loop /media/data/R2017a_glnxa64_dvd1.iso /media/iso,
2.
install sudo /media/iso/install and wait for a pop-up window to change the disk,
3.
mount DVD2 sudo mount -o ro,loop /media/data/R2017a_glnxa64_dvd2.iso /media/iso
and finally unmount image:
You can just install matlab with this one line command.
sudo apt-get install matlab-gdf dynare-matlab libpdl-io-matlab-perl matlab-support matlab-support-dev matlab2tikz