How to list vms that was started from hyperkit? - hyperkit

How to list vms that was started from hyperkit?
hyperkit help is only below:
hyperkit -h 11:25:45
Usage: hyperkit [-behuwxMACHPWY] [-c vcpus] [-F <pidfile>] [-g <gdb port>] [-l <lpc>]
[-m mem] [-p vcpu:hostcpu] [-s <pci>] [-U uuid] -f <fw>
-A: create ACPI tables
-c: # cpus (default 1)
-C: include guest memory in core file
-e: exit on unhandled I/O access
-f: firmware
-F: pidfile
-g: gdb port
-h: help
-H: vmexit from the guest on hlt
-l: LPC device configuration. Ex: -l com1,stdio -l com2,autopty -l com2,/dev/myownpty
-m: memory size in MB, may be suffixed with one of K, M, G or T
-M: print MAC address and exit if using vmnet
-P: vmexit from the guest on pause
-s: <slot,driver,configinfo> PCI slot config
-u: RTC keeps UTC time
-U: uuid
-v: show build version
-w: ignore unimplemented MSRs
-W: force virtio to use single-vector MSI
-x: local apic is in x2APIC mode
-Y: disable MPtable generation
I can't understand how to list vms.

Since hyperkit is just "a toolkit for embedding hypervisor capabilities in your application." it doesn't provide tools to manage the virtual machines directly.
The way you have to see all the virtual machines is:
$ ps -Af | grep hyperkit
0 35982 1 0 2:50PM ttys000 3:27.65 /usr/local/bin/hyperkit -A -u -F /Users/youruser/.minikube/machines/minikube/hyperkit.pid -c 2 -m 4000M -s 0:0,hostbridge -s 31,lpc -s 1:0,virtio-net -U 39c5590a-cdac-11ea-b300-acde48001122 -s 2:0,virtio-blk,/Users/youruser/.minikube/machines/minikube/minikube.rawdisk -s 3,ahci-cd,/Users/youruser/.minikube/machines/minikube/boot2docker.iso -s 4,virtio-rnd -l com1,autopty=/Users/youruser/.minikube/machines/minikube/tty,log=/Users/youruser/.minikube/machines/minikube/console-ring -f kexec,/Users/youruser/.minikube/machines/minikube/bzimage,/Users/youruser/.minikube/machines/minikube/initrd,earlyprintk=serial loglevel=3 console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes random.trust_cpu=on hw_rng_model=virtio base host=minikube
in case you'll see in the previous command the "-l" flag with a tty available like this "-l com1,autopty=/Users/youruser/.minikube/machines/minikube/tty" you'll probably be able to open a serial tty like in How do I see a list of all minikube clusters running in Docker on my mac?:
$ sudo screen /Users/youruser/.minikube/machines/minikube/tty
Welcome to minikube
minikube login: root
_ _
_ _ ( ) ( )
___ ___ (_) ___ (_)| |/') _ _ | |_ __
/' _ ` _ `\| |/' _ `\| || , < ( ) ( )| '_`\ /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )( ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)
# docker ps
... <== shows a bunch of K8s containers

Related

GKE cluster using gitbash tool

I have my python3.7 installed on following path on my windows - C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Python 3.7
I am trying to connect GCP GKE cluster using GitBash and when i run below gcloud command to connect GKE cluster i am getting an python not found error.
$ gcloud container clusters get-credentials appcluster --region us-east4 --project dev /c/Users/surendar/AppData/Local/Google/Cloud SDK/google-cloud-sdk/bin/gcloud: line 181: exec: python: not found
Any suggestion's please to resolve the error?
Below is the Google/Cloud SDK/google-cloud-sdk/bin/gcloud file
181 line points to below declaration which is last line of the file
exec "$CLOUDSDK_PYTHON" $CLOUDSDK_PYTHON_ARGS "${CLOUDSDK_ROOT_DIR}/lib/gcloud.py
# Copyright 2013 Google Inc. All Rights Reserved.
#
# <cloud-sdk-sh-preamble>
#
# CLOUDSDK_ROOT_DIR (a) installation root dir
# CLOUDSDK_PYTHON (u) python interpreter path
# CLOUDSDK_GSUTIL_PYTHON (u) python interpreter path for gsutil
# CLOUDSDK_PYTHON_ARGS (u) python interpreter arguments
# CLOUDSDK_PYTHON_SITEPACKAGES (u) use python site packages
# CLOUDSDK_BQ_PYTHON (u) python interpreter for bq
# CLOUDSDK_ENCODING (u) python io encoding for gcloud
#
# (a) always defined by the preamble
# (u) user definition overrides preamble
# Wrapper around 'which' and 'command -v', tries which first, then falls back
# to command -v
_cloudsdk_which() {
which "$1" 2>/dev/null || command -v "$1" 2>/dev/null
}
# Check whether passed in python command reports major version 3.
_is_python3() {
echo "$("$1" -V 2>&1)" | grep -E "Python 3" > /dev/null
}
# For Python 3, gsutil requires Python 3.5+.
_py3_interpreter_compat_with_gsutil () {
# Some environments (e.g. macOS) don't support grep -P, so we use grep -E.
echo "$("$1" -V 2>&1)" | grep -E "Python 3[.]([5-9]|[1-9][0-9])" > /dev/null
}
order_python() {
selected_version=""
for python_version in "$#"
do
if [ -z "$selected_version" ]; then
if _cloudsdk_which $python_version > /dev/null && "$python_version" -c "import sys; print(sys.version)" > /dev/null; then
selected_version=$python_version
fi
fi
done
if [ -z "$selected_version" ]; then
selected_version=python
fi
echo $selected_version
}
# Determines the real cloud sdk root dir given the script path.
# Would be easier with a portable "readlink -f".
_cloudsdk_root_dir() {
case $1 in
/*) _cloudsdk_path=$1
;;
*/*) _cloudsdk_path=$PWD/$1
;;
*) _cloudsdk_path=$(_cloudsdk_which $1)
case $_cloudsdk_path in
/*) ;;
*) _cloudsdk_path=$PWD/$_cloudsdk_path ;;
esac
;;
esac
_cloudsdk_dir=0
while :
do
while _cloudsdk_link=$(readlink "$_cloudsdk_path")
do
case $_cloudsdk_link in
/*) _cloudsdk_path=$_cloudsdk_link ;;
*) _cloudsdk_path=$(dirname "$_cloudsdk_path")/$_cloudsdk_link ;;
esac
done
case $_cloudsdk_dir in
1) break ;;
esac
if [ -d "${_cloudsdk_path}" ]; then
break
fi
_cloudsdk_dir=1
_cloudsdk_path=$(dirname "$_cloudsdk_path")
done
while :
do case $_cloudsdk_path in
*/) _cloudsdk_path=$(dirname "$_cloudsdk_path/.")
;;
*/.) _cloudsdk_path=$(dirname "$_cloudsdk_path")
;;
*/bin) dirname "$_cloudsdk_path"
break
;;
*) echo "$_cloudsdk_path"
break
;;
esac
done
}
CLOUDSDK_ROOT_DIR=$(_cloudsdk_root_dir "$0")
setup_cloudsdk_python() {
# if $CLOUDSDK_PYTHON is not set, look for bundled python else
# prefer python3 over python2
if [ -z "$CLOUDSDK_PYTHON" ]; then
# Is bundled python present?
if [ -x "$CLOUDSDK_ROOT_DIR/platform/bundledpythonunix/bin/python3" ];
then
CLOUDSDK_PYTHON="$CLOUDSDK_ROOT_DIR/platform/bundledpythonunix/bin/python3"
CLOUDSDK_PYTHON_SITEPACKAGES=1
else
CLOUDSDK_PYTHON=$(order_python python3 python2 python2.7 python)
fi
fi
}
setup_cloudsdk_python
# $PYTHONHOME can interfere with gcloud. Users should use
# CLOUDSDK_PYTHON to configure which python gcloud uses.
unset PYTHONHOME
# if CLOUDSDK_PYTHON_SITEPACKAGES and VIRTUAL_ENV are empty
case :$CLOUDSDK_PYTHON_SITEPACKAGES:$VIRTUAL_ENV: in
:::) # add -S to CLOUDSDK_PYTHON_ARGS if not already there
case " $CLOUDSDK_PYTHON_ARGS " in
*" -S "*) ;;
" ") CLOUDSDK_PYTHON_ARGS="-S"
;;
*) CLOUDSDK_PYTHON_ARGS="$CLOUDSDK_PYTHON_ARGS -S"
;;
esac
unset CLOUDSDK_PYTHON_SITEPACKAGES
;;
*) # remove -S from CLOUDSDK_PYTHON_ARGS if already there
while :; do
case " $CLOUDSDK_PYTHON_ARGS " in
*" -S "*) CLOUDSDK_PYTHON_ARGS=${CLOUDSDK_PYTHON_ARGS%%-S*}' '${CLOUDSDK_PYTHON_ARGS#*-S} ;;
*) break ;;
esac
done
# if CLOUDSDK_PYTHON_SITEPACKAGES is empty
[ -z "$CLOUDSDK_PYTHON_SITEPACKAGES" ] &&
CLOUDSDK_PYTHON_SITEPACKAGES=1
export CLOUDSDK_PYTHON_SITEPACKAGES
;;
esac
# Allow users to set the Python interpreter used to launch gsutil, falling
# back to the CLOUDSDK_PYTHON interpreter otherwise.
if [ -z "$CLOUDSDK_GSUTIL_PYTHON" ]; then
CLOUDSDK_GSUTIL_PYTHON="$CLOUDSDK_PYTHON"
fi
if [ -z "$CLOUDSDK_BQ_PYTHON" ]; then
CLOUDSDK_BQ_PYTHON="$CLOUDSDK_PYTHON"
fi
if [ -z "$CLOUDSDK_ENCODING" ]; then
if [ -z "$PYTHONIOENCODING" ]; then
CLOUDSDK_ENCODING=UTF-8
else
CLOUDSDK_ENCODING="$PYTHONIOENCODING"
fi
fi
export CLOUDSDK_ROOT_DIR
export CLOUDSDK_PYTHON_ARGS
export CLOUDSDK_GSUTIL_PYTHON
export CLOUDSDK_BQ_PYTHON
export CLOUDSDK_ENCODING
export PYTHONIOENCODING="$CLOUDSDK_ENCODING"
case $HOSTNAME in
*.corp.google.com|*.c.googlers.com) export CLOUDSDK_GOOGLE_AUTH_IS_GOOGLE_DOMAIN=true;;
esac
# </cloud-sdk-sh-preamble>
exec "$CLOUDSDK_PYTHON" $CLOUDSDK_PYTHON_ARGS "${CLOUDSDK_ROOT_DIR}/lib/gcloud.py"** "$#"```
You will need to point the environment variable CLOUDSDK_PYTHON at your Python executable (e.g. python.exe). To find the Python executable, you should be able to right-click on "Python 3.7" in the start menu and look at "Target".
In my case, the Python executable is located at C:\Users\g_r_s\AppData\Local\Programs\Python\Python37\python.exe
Using Git Bash, you can export CLOUDSDK_PYTHON
$ export CLOUDSDK_PYTHON=/c/Users/g_r_s/AppData/Local/Programs/Python/Python37/python.exe
$ gcloud version
Google Cloud SDK 344.0.0
beta 2021.06.04
bq 2.0.69
core 2021.06.04
gsutil 4.62
NOTE: You can also try installing the bundled Python when you install the SDK on Windows as well.

Virtual Box missing Guest Additions after silent installation of CentOS 7 under Mac OS X

I am using Virtual Box to setup a Centos7 vm on my Mac OS X. This worked seemless in the past but suddenly I am running into problems. Don't know why.
I did create a script to automate the whole process. The script does mainly a VBoxManage unattended installation of Centos based on a minimal ISO installer.
VBoxManage unattended install centos7 --user=datasqill --password=pwd --country=DE --locale=de_DE --time-zone=UTC --hostname=centos7.treimers --iso=/Users/treimers/Projekte/Linux/CentOS-7-x86_64-Minimal-1908.iso --post-install-template redhat_postinstall.sh --script-template redhat67_ks.cfg --install-additions --start-vm=gui
I used to call
VBoxManage guestproperty wait centos7 /VirtualBox/GuestInfo/OS/NoLoggedInUsers
in order to wait for the installation process to finish. The wait does not terminate and seems to wait forever. I think that this reason is that the guest additions are not installed.
Find below my script, I am using the resource files redhat67_ks.cfg and redhat_postinstall.sh from Virtual Box Application folder.
My environment is
OS: Mac OS X 10.11.6 (El Capitan)
Virtual Box: 6.1.6 r137129
CentOS Image: CentOS-7-x86_64-Minimal-1908.iso
Maybe somebody has an idea what might be wrong with my set up.
Thanks in advance
Thorsten
#!/bin/bash
function printhelp() {
echo "Create CentOS VM"
echo "Usage: $(basename $0) [OPTIONS]..."
echo "Creates a new VirtualBox VM with CentOS 7"
echo
echo "Options:"
echo " -?: help - print usage and exit"
echo " -c <country>: country - country setting for new VM like DE, EN, ..."
echo " -h <hostname>: host name - host name of new VM"
echo " -i <isoimage>: isoimage- path to CentOS ISO Image"
echo " -k <keyfile>: keyfile - private Vagrant key file (use ./vagrant.d/insecure_private_key in user home directory)"
echo " -l <locale>: locale - locale setting of new VM like de_DE, en_US, ..."
echo " -m <keymap>: keymap - keyboard map for new VM like de, en, ..."
echo " -n <name>: name - VirtualBox name of new VM"
echo " -p <password>: password - password for standard user and root user in new VM"
echo " -s <size>: size - disk size in MB"
echo " -t <timezone>: timezone - time zone of new VM like UTC, ..."
echo " -u <user>: user - create standard user with given name in new VM"
echo " -v: verbose - prints all commands to console on execution [OPTIONAL]"
echo
echo "Example:"
echo "$(basename $0) -c DE -h centos7.datasqill -i ~/Projekte/Linux/CentOS-7-x86_64-Minimal-1908.iso -k ~/.vagrant.d/insecure_private_key -l de_DE -m de -n centos7 -p softquadrat -s 8192 -t UTC -u datasqill"
echo
echo ""
exit 1
}
function removeOld() {
# remove any failed previous attempt
# https://www.virtualbox.org/ticket/17335
VBoxManage controlvm ${VBoxName} poweroff 2> /dev/null || true
sleep 10
VBoxManage unregistervm ${VBoxName} --delete 2> /dev/null || true
sleep 10
rm -fr "${VBoxDir}"/${VBoxName} 2> /dev/null
}
function createVM() {
# create vm
# Note: available ostypes can be displayed by VBoxManage list ostypes | less
VBoxManage createvm --name ${VBoxName} --ostype RedHat_64 --register
# create and attach disks
VBoxManage createmedium --filename "${VBoxDir}/${VBoxName}/${VBoxName}.vdi" --size ${diskSize}
VBoxManage storagectl ${VBoxName} --name SATA --add SATA --controller IntelAhci
VBoxManage storageattach ${VBoxName} --storagectl SATA --port 0 --device 0 --type hdd --medium "${VBoxDir}/${VBoxName}/${VBoxName}.vdi"
VBoxManage storagectl ${VBoxName} --name IDE --add ide
VBoxManage storageattach ${VBoxName} --storagectl IDE --port 0 --device 0 --type dvddrive --medium ${IsoImage}
# set memory
VBoxManage modifyvm ${VBoxName} --memory 1024 --vram 16
# enable io apic
VBoxManage modifyvm ${VBoxName} --ioapic on
# set boot order
VBoxManage modifyvm ${VBoxName} --boot1 dvd --boot2 disk --boot3 none --boot4 none
# set virtual cpus
VBoxManage modifyvm ${VBoxName} --cpus 1
# disable audio
VBoxManage modifyvm ${VBoxName} --audio none
# disable usb controller
VBoxManage modifyvm ${VBoxName} --usb off
VBoxManage modifyvm ${VBoxName} --usbehci off
VBoxManage modifyvm ${VBoxName} --usbxhci off
# define network settings
VBoxManage modifyvm ${VBoxName} --nic1 nat
# create port forwarding rule
# VBoxManage modifyvm ${VBoxName} --natpf1 ssh2,tcp,127.0.0.1,22022,,22
}
function unattendedInstall() {
# start unattended installation
VBoxManage unattended install ${VBoxName} --user=${user} --password=${password} --country=${country} --locale=${locale} --time-zone=${timezone} --hostname=${hostname} --iso=${IsoImage} --post-install-template redhat_postinstall.sh --script-template redhat67_ks.cfg --install-additions --start-vm=gui
}
function waitVM() {
VBoxManage guestproperty wait ${VBoxName} "/VirtualBox/GuestInfo/OS/NoLoggedInUsers"
}
function postInstall() {
# set keymap
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/s1-changing_the_keyboard_layout
# https://linuxconfig.org/how-to-change-system-keyboard-keymap-layout-on-centos-7-linux
VBoxManage guestcontrol ${VBoxName} --username=root --password=${password} run /bin/localectl set-keymap ${keymap}
# allow sudo
cat > ${user} <<-EOF
${user} ALL=(ALL) NOPASSWD:ALL
Defaults:${user} !requiretty
EOF
VBoxManage guestcontrol ${VBoxName} --username=root --password=${password} copyto --target-directory /etc/sudoers.d ${user}
rm ${user}
# create authorized keys
ssh-keygen -y -f ${privateKeyFile} > authorized_keys
VBoxManage guestcontrol ${VBoxName} --username=${user} --password=${password} mkdir --parents /home/${user}/.ssh
VBoxManage guestcontrol ${VBoxName} --username=${user} --password=${password} copyto --target-directory /home/${user}/.ssh authorized_keys
VBoxManage guestcontrol ${VBoxName} --username=${user} --password=${password} run /bin/chmod 700 /home/${user}/.ssh
VBoxManage guestcontrol ${VBoxName} --username=${user} --password=${password} run /bin/chmod 600 /home/${user}/.ssh/authorized_keys
rm authorized_keys
}
function doall() {
echo "--- Removing old installation"
date +"%y-%m-%d-%H-%M-%S"
removeOld
echo "--- Creating virtual machine"
date +"%y-%m-%d-%H-%M-%S"
createVM
echo "--- Starting Unattended Installation"
date +"%y-%m-%d-%H-%M-%S"
unattendedInstall
echo "--- Wait VM"
date +"%y-%m-%d-%H-%M-%S"
waitVM
echo "--- Post Install Steps"
date +"%y-%m-%d-%H-%M-%S"
postInstall
echo "--- Done"
date +"%y-%m-%d-%H-%M-%S"
}
# main starts here
set -o nounset
set -o errexit
# get opts
while getopts "?c:h:i:k:l:m:n:p:s:t:u:v" opt; do
case ${opt} in
\?)
printhelp
;;
c)
country=${OPTARG}
;;
h)
hostname=${OPTARG}
;;
i)
IsoImage=${OPTARG}
;;
k)
privateKeyFile=${OPTARG}
;;
l)
locale=${OPTARG}
;;
m)
keymap=${OPTARG}
;;
n)
VBoxName=${OPTARG}
;;
p)
password=${OPTARG}
;;
s)
diskSize=${OPTARG}
;;
t)
timezone=${OPTARG}
;;
u)
user=${OPTARG}
;;
v)
set -x
;;
*)
echo "Error: Unknown option ${opt}"
echo
printhelp
;;
esac
done
shift $((OPTIND-1))
if [[ $# -ne 0 || -z "${country:-}" || -z "${hostname:-}" || -z "${IsoImage:-}" || -z "${privateKeyFile:-}" || -z "${locale:-}"|| -z "${keymap:-}" || -z "${VBoxName:-}" || -z "${password:-}" || -z ${diskSize:-} || -z "${timezone:-}" || -z "${user:-}" ]]
then
printhelp
fi
# directory with virtual boxes
VBoxDir=`VBoxManage list systemproperties | awk '/Default machine folder/ { print $4 }'`
# get date and time stamp
dat=`date +"%y-%m-%d-%H-%M-%S"`
# log file
logfile=log/createCentOSVM_${dat}.log
mkdir -p log
{
doall
} 2>&1 | tee ${logfile}
I finally solved my problem. RTFL = Read the f.. log.
The system was unable to find and install the package for kernel devel using
log_command_in_target yum -y install "kernel-devel-$(uname -r)"
This is required in order to install the Virtual Box guest additions.
My guest system was CentOS 7 but I used the minimal ISO for installation (CentOS-7-x86_64-Minimal-1908.iso) and that did not contain the kernel devel package. I switched to the full ISO image (CentOS-7-x86_64-DVD-1908.iso) and violá suddenly it worked without any problems.
Update: Note that I figured out that the problem comes up when the CentOS team delivers a new release. I proposed a fix for the postinstall scripts of Virtual Box, see here and here.

AWK catching a regular expression

I have been using this little script for months now with success. Today I realize there is one output it cant seem to catch, screen comes up blank with a new prompt:
user#computer ~]$ myscan ipsFile 23
user#computer ~]$
Here is the code
#!/bin/bash
sudo nmap -v -Pn -p T:$2 -reason -i $1 | awk ' {
if (/syn-ack/) {
print "Yes"
c++
}
else if (/no-response|reset|host-unreach/) {
print "No"
c++
}
}
END { print c} '
If I run the nmap against one of the IPs then it returns
Starting Nmap 5.51 ( http://nmap.org ) at 2017-09-26 11:44 CDT
Initiating Parallel DNS resolution of 1 host. at 11:44
Completed Parallel DNS resolution of 1 host. at 11:44, 0.00s elapsed
Initiating Connect Scan at 11:44
Scanning 1.1.1.1 [1 port]
Completed Connect Scan at 11:44, 0.20s elapsed (1 total ports)
Nmap scan report for 1.1.1.1
Host is up, received user-set (0.20s latency).
PORT STATE SERVICE REASON
23/tcp filtered telnet host-unreach
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 0.26 seconds
How can I catch the 'host-unreach' portion?
Let's try and debug this. Execute this:
nmap -v -Pn -p T:23 -reason -i ipsFile | awk '{print $0}/syn-ack/{print "Yes";c++}/no-response|reset|host-unreach/{print "No";c++}END {print c}' > out.txt
The only difference here is that the awk script prints $0 (i.e. the output of your nmap calls) to file out.txt. Try to grep your unreach value.
I tried this myself and found that instead of a host-unreach I got a net-unreach. Might be the same thing in your case.
Have you tried piping stderr to stdout like
#!/bin/bash
sudo nmap -v -Pn -p T:$2 -reason -i $1 2>&1 | awk ' {
if (/syn-ack/) {
print "Yes"
c++
}
else if (/no-response|reset|host-unreach/) {
print "No"
c++
}
}
END { print c} '

Bash script and Command line arguments

So I have a file that is called "run_correlation_study.pbs" and "correlation_study.pbs". In correlation_study.pbs, I run a bash script that uses portable batch software(pbs) and assign 3 command line arguments that will be used in my actual program. In run_correlation_study.pbs, I loop through the command line arguments that are used in correlation_study.pbs so that I can split up my program into multiple jobs for a computing cluster. However, I have been getting errors with my run_correlation_study.pbs file when I try to run it (I turn it into an executable file before running it). I have posted both file below, run_correlation_study.pbs is listed first and correlation_study.pbs is listed second. I can provide the part of my program where the command line arguments are used but I do not think the problem is caused in there. Also, the error/text that shows up when I try to run my program is listed last.
Run_correlation_study.pbs:
for ((ARC_LENGTH = 0; ARC_LENGTH <= 35; ARC_LENGTH++)); do
qsub -v ARC_LENGTH_ARG=$ARC_LENGTH/10, RANDOM_NUM_ARG=$ARC_LENGTH correlation_study.pbs
done
Correlation_study.pbs:
#PBS -l walltime=24:00:00
#PBS -l nodes=1:ppn=1
#PBS -N Correlation_study_data
#PBS -j oe
#PBS -m abe
#COMMANDS TO RUN
cd /home/kovacevich.9/correlation_study/corrstudies
./correlation_study.x ${ARC_LENGTH_ARG} ${RANDOM_NUM_ARG}
Error/text:
usage: qsub [-a date_time] [-A account_string] [-b secs]
[-c [ none | { enabled | periodic | shutdown |
depth=<int> | dir=<path> | interval=<minutes>}... ]
[-C directive_prefix] [-d path] [-D path]
[-e path] [-h] [-I] [-j oe] [-k {oe}] [-l resource_list] [-m n
{abe}]
[-M user_list] [-N jobname] [-o path] [-p priority] [-P proxy_user]
[-q queue]
[-r y|n] [-S path] [-t number_to_submit] [-T type] [-u user_list]
[-w] path
[-W additional_attributes] [-v variable_list] [-V ] [-x] [-X] [-z]
[script]
Portion of program:
if(argc == 3)
{
double test_arc_length = atof(argv[1]);
unsigned long int seed = atoi(argv[2]);
To do floating point arithmetic from bash, you need to call out to an external program. You could do one of:
qsub -v "ARC_LENGTH_ARG=$(bc -l <<<"$ARC_LENGTH/10"),..."
qsub -v "ARC_LENGTH_ARG=$(awk -v "a=$ARC_LENGTH" 'BEGIN {print a/10}'),..."
Using command substitution syntax $(cmd ...) within a double quoted string.

Accumulo Overview console not reachable outside of VirtualBox VM

I am running Accumulo 1.5 in an Ubuntu 12.04 VirtualBox VM. I have set the accumulo-site.xml instance.zookeeper.host file to the VM's IP address, and I can connect to accumulo and run queries from a remote client machine. From the client machine, I can also use a browser to see the hadoop NameNode, browse the filesystem, etc. But I cannot connect to the Accumulo Overview page (port 50095) from anywhere else than directly from the Accumulo VM. There is no firewall between the VM and the client, and besides the Accumulo Overview page not being reachable, everything else seems to work fine.
Is there a config setting that I need to change to allow outside access to the Accumulo Overview console?
thanks
I was able to get the Accumulo monitor to bind to all network interfaces by manually applying this patch:
https://git-wip-us.apache.org/repos/asf?p=accumulo.git;a=commit;h=7655de68
In conf/accumulo-env.sh add:
# Should the monitor bind to all network interfaces -- default: false
export ACCUMULO_MONITOR_BIND_ALL="true"
In bin/config.sh add:
# ACCUMULO-1985 provide a way to use the scripts and still bind to all network interfaces
export ACCUMULO_MONITOR_BIND_ALL=${ACCUMULO_MONITOR_BIND_ALL:-"false"}
And modify bin/start-server.sh to match:
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
bin="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$bin/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
bin="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# Stop: Resolve Script Directory
. "$bin"/config.sh
HOST="$1"
host "$1" >/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
LOGHOST="$1"
else
LOGHOST=$(host "$1" | head -1 | cut -d' ' -f1)
fi
ADDRESS="$1"
SERVICE="$2"
LONGNAME="$3"
if [ -z "$LONGNAME" ]; then
LONGNAME="$2"
fi
SLAVES=$( wc -l < ${ACCUMULO_HOME}/conf/slaves )
IFCONFIG=/sbin/ifconfig
if [ ! -x $IFCONFIG ]; then
IFCONFIG='/bin/netstat -ie'
fi
# ACCUMULO-1985 Allow monitor to bind on all interfaces
if [ ${SERVICE} == "monitor" -a ${ACCUMULO_MONITOR_BIND_ALL} == "true" ]; then
ADDRESS="0.0.0.0"
fi
ip=$($IFCONFIG 2>/dev/null| grep inet[^6] | awk '{print $2}' | sed 's/addr://' | grep -v 0.0.0.0 | grep -v 127.0.0.1 | head -n 1)
if [ $? != 0 ]
then
ip=$(python -c 'import socket as s; print s.gethostbyname(s.getfqdn())')
fi
if [ "$HOST" = "localhost" -o "$HOST" = "`hostname`" -o "$HOST" = "$ip" ]; then
PID=$(ps -ef | egrep ${ACCUMULO_HOME}/.*/accumulo.*.jar | grep "Main $SERVICE" | grep -v grep | awk {'print $2'} | head -1)
else
PID=$($SSH $HOST ps -ef | egrep ${ACCUMULO_HOME}/.*/accumulo.*.jar | grep "Main $SERVICE" | grep -v grep | awk {'print $2'} | head -1)
fi
if [ -z $PID ]; then
echo "Starting $LONGNAME on $HOST"
if [ "$HOST" = "localhost" -o "$HOST" = "`hostname`" -o "$HOST" = "$ip" ]; then
#${bin}/accumulo ${SERVICE} --address $1 >${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.out 2>${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.err &
${bin}/accumulo ${SERVICE} --address ${ADDRESS} >${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.out 2>${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.err &
MAX_FILES_OPEN=$(ulimit -n)
else
#$SSH $HOST "bash -c 'exec nohup ${bin}/accumulo ${SERVICE} --address $1 >${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.out 2>${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.err' &"
$SSH $HOST "bash -c 'exec nohup ${bin}/accumulo ${SERVICE} --address ${ADDRESS} >${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.out 2>${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.err' &"
MAX_FILES_OPEN=$($SSH $HOST "/usr/bin/env bash -c 'ulimit -n'")
fi
if [ -n "$MAX_FILES_OPEN" ] && [ -n "$SLAVES" ] ; then
if [ "$SLAVES" -gt 10 ] && [ "$MAX_FILES_OPEN" -lt 65536 ]; then
echo "WARN : Max files open on $HOST is $MAX_FILES_OPEN, recommend 65536"
fi
fi
else
echo "$HOST : $LONGNAME already running (${PID})"
fi
Check that the monitor is bound to the correct interface, and not the "localhost" loopback interface. You may have to edit the monitors file in Accumulo's configuration directory with the IP/hostname of the correct interface.