Keep getting "There is already another Tungsten installation script running" - mysql

I'm trying to install tungsten replicator 3.0.0-524 GA from MySQL to MongoDB but when I'm running the cookbook/validate_cluster the error:
There is already another Tungsten installation script running
(InstallationScriptCheck)
Keep showing up
The configuration I'm using for the cluster are:
./tools/tpm configure mysql2mongodb \
--enable-heterogenous-master=true \
--topology=master-slave \
--master=mysql \
--replication-user=boahub_boahub \
--replication-password=*****\
--slaves=tracking-mongo \
--home-directory=/opt/mysql \
--svc-extractor-filters=replicate \
--property=replicator.filter.replicate.do=boahub_boahub.urls,boahub_boahub.media_campaigns \
--start-and-report
./tools/tpm configure mysql2mongodb \
--hosts=tracking-mongo \
--datasource-type=mongodb \
--replication-port=27017
./tools/tpm -v install --install-directory=/opt/tungsten
I've configured both "mysql" and "tracking-mongo" hosts under /etc/hosts file
So far I've tried to
1. Reboot the system
2. Clear my /opt/tungsten installation directory
3. Delete the deploy.cfg
The verbose output of the tools/tpm -v install shows the SSH between the two machines succeeded and the command for checking other tungsten script is
ps ax 2>/dev/null | grep configure.rb | grep -v firewall | grep -v grep | awk '{print $1}'
When I execute this command it comes up with nothing.
What can I do? Is there and way to ignore this check?
Thanks!

You can remove any check using --skip-validation-check option(argument required). You can use this option multiple time without problem.
The option takes as argument the name of the check which can be found in the error message.
In your case you can add the following option to your command:
--skip-validation-check InstallationScriptCheck

I have a feeling this may help you get through.
Have you tried install your master and slave separately? Do a
./tools/tpm install
after configuring & installing master, clear the configuration with
./tools/tpm configure defaults --reset
Then apply your slave settings and do the other tpm install.
A few weeks ago I had run into some similar (maybe, I can't recall as clear) trouble. The phrase "another script" in your post has brought back some memory of that for me, hope it works.
Good Luck!

Related

Qemu built from source doesn't work with --enable-kvm flag on RHEL-7 but suprisingly works on CentOS-7

I am trying to build and run QEMU from its source with --enable-kvm flag. The suprising fact is qemu with --enable-kvm flag works like a charm on CentOS 7 (Server as well as on workstation) but it hangs terribly on RHEL 7 server.
I am using Linux From sratch guide to build the system link : http://www.linuxfromscratch.org/blfs/view/cvs/postlfs/qemu.html
I have tested the vmx flag using the script
grep -E "(vmx|svm)" /proc/cpuinfo | wc -l
4
On Rhel as well as centos I have downloaded the dependencies using following script.
#!/bin/sh
yum install gcc
yum install zlib-devel
yum install gnutls-devel
yum install libgcrypt-devel
yum install glibc-devel
yum install glib2-devel
yum install pixman-devel
Then I used following script to compile the build
if [ $(uname -m) = i686 ]; then
QEMU_ARCH=i386-softmmu
else
QEMU_ARCH=x86_64-softmmu
fi
sed -i 's/ memfd_create/ qemu_memfd_create/' util/memfd.c &&
mkdir -vp build &&
cd build &&
../configure --target-list=$QEMU_ARCH \
--enable-gnutls \
--enable-gcrypt &&
unset QEMU_ARCH &&
make &&
make-install
After this I am trying to boot an encrypted virtual disk using the command.
qemu-system-x86_64 --enable-kvm -daemonize -display none \
-net user,hostfwd=tcp::3000-:22,hostfwd=tcp::8080-:8080,hostfwd=tcp::80-:80,hostfwd=tcp::443-:443 -net nic \
-object secret,id=secmaster0,format=base64,file=key.b64 \
-object secret,id=sec0,keyid=secmaster0,format=base64,\
data=$SECRET,iv=$(<iv.b64) \
-drive if=none,driver=luks,key-secret=sec0,\
id=drive0,file.driver=file,\
file.filename=prod.luks \
-device virtio-blk,drive=drive0 -m 5120
Then, I just ssh in the daemonised kvm. The point is everything works like a charm in CentOS but in RHEL 7 I am not able to ssh in the machine.
If I remove --enable-kvm flag I am able to ssh in.
I have already spent a lot of time experimenting over it and I simply don't understand what is going wrong. I am no pro on this topic just trying to find a fix for a niche problem. Any guidance on debuging the qemu or any guidance or reference to documents/mailing-list thread/forum is deeply appreciated.
Peace.
Update
As mentioned by #Peter Maydell in the comments, I started the qemu without the display none flag. It started a vnc, I connnected with the vnc and it seems kvm doesn't seem to boot the hard disk. It is stuck on
Booting from Hard Disk ...

How to run strace inside CoreOS toolbox container?

I run coreos and need to run strace on a certain process. However:
strace -s 99 -ffp 8259
strace: attach: ptrace(PTRACE_SEIZE, 8259): Operation not permitted
I opened up the script that spins up the toolbox and found this:
sudo systemd-nspawn \
--directory="${machinepath}" \
--capability=all \
--share-system \
${TOOLBOX_BIND} \
--user="${TOOLBOX_USER}" "$#"
Which is a namespace container. It looks like a permissions issue but I don't know how to give my container permissions to attach strace to process outside of it. My CoreOS version: DISTRIB_RELEASE=1185.5.0
Any help is appreciated
Short answer:
echo 0 > /proc/sys/kernel/yama/ptrace_scope
Longer answer here

Shell script to check if mysql is up or down

I want a bash shell script that i can run using a cron job to check if mysql on a remote server is running. If it is, then do nothing, other start the server.
The cronjob will be checking the remote server for a live (or not) mysql every minute. I can write the cron job myself, but i need help with the shell script that checks if a remote mysql is up or down. The response after a check if up or down is not important. But the check is important.
You can use below script
#!/bin/bash
USER=root
PASS=root123
mysqladmin -h remote_server_ip -u$USER -p$PASS processlist ###user should have mysql permission on remote server. Ideally you should use different user than root.
if [ $? -eq 0 ]
then
echo "do nothing"
else
ssh remote_server_ip ###remote server linux root server password should be shared with this server.
service mysqld start
fi
The script in the selected answer works great, but requires that you have the MySQL client installed on the local host. I needed something similar for a Docker container and didn't want to install the MySQL client. This is what I came up with:
# check for a connection to the database server
#
check=$(wget -O - -T 2 "http://$MYSQL_HOST:$MYSQL_PORT" 2>&1 | grep -o mariadb)
while [ -z "$check" ]; do
# wait a moment
#
sleep 5s
# check again
#
check=$(wget -O - -T 2 "http://$MYSQL_HOST:$MYSQL_PORT" 2>&1 | grep -o mariadb)
done
This is a little different, in that it will loop until a database connection can be made. I am also using MariaDB instead of the stock MySQL database. You can change this by changing the grep -o mariadb to something else - I'm not sure what MySQL returns on a successful connection, so you'll have to play with it a bit.

how to reinitialize the database

I have downloaded a demo copy of Hybris for evaluation purposes, and it has been more than 30 days since I downloaded it, and recently I tried to restart it, but it would not, and instead gave me the following message:
"This licence is only for demo or develop usage and is valid for 30 days.
After this time you have to reinitialize database to continue your work."
I am/have been running it on a Mac, and the database is MySQL...
What (UNIX) commands do I use to re-initialise the database, so that I can start up the Hybris Server?
Using command line in the Terminal application - goto YOURPATH/hybris/bin/platform and run the ant clean all then ant initialize command then start hybris:
1) Goto your platform directory
cd $YOURPATH/hybris/bin/platform
2) Set ant's environment by runing "dot" "space" "dot-slash" setantenv.sh
. ./setantenv.sh
3) Then run ant clean all (to clean environment)
ant clean all
4) then run ant initialize (to re-initialize environment)
ant initialize
5) Re-start the hybris server process by running hybrisserver.sh
./hybrisserver.sh
6) have a nice rest of your day! (if this helped you then please give an UP vote - thanks!)
:)
you can use Ant command ant initialize and error will go away
Ant initialize would removes tables that exists in Hybris items.xml files? If you want to reset your DB i have a script that i use across various projects (can be found here, on GitHub)
#!/bin/bash
MUSER="$1"
MPASS="$2"
MDB="$3"
# Detect paths
MYSQL=$(which mysql)
AWK=$(which awk)
GREP=$(which grep)
if [ $# -ne 3 ]
then
echo "Usage: $0 {MySQL-User-Name} {MySQL-User-Password} {MySQL-Database-Name}"
echo "Drops all tables from a MySQL"
exit 1
fi
TABLES=$($MYSQL -u $MUSER -p$MPASS $MDB -e 'show tables' | $AWK '{ print $1}' | $GREP -v '^Tables' )
for t in $TABLES
do
echo "Deleting $t table from $MDB database..."
$MYSQL -u $MUSER -p$MPASS $MDB -e "drop table $t"
done
You need to reinitialize, [ant all] and rebuild hybris as you have did in first time:
Reason : Evaluation copy works only for 30 days and after it will be expired.
When you start your server it will show in console like below image. Pls Check.
Yo can also use Hybris Administration Console to initialization
Platfrom -> Initialization

Mysql Auto Backup on ubuntu server

After months of trying to get this to happen I found a shell script that will get the job done.
Heres the code I'm working with
#!/bin/bash
### MySQL Server Login Info ###
MUSER="root"
MPASS="MYSQL-ROOT-PASSWORD"
MHOST="localhost"
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
BAK="/backup/mysql"
GZIP="$(which gzip)"
### FTP SERVER Login info ###
FTPU="FTP-SERVER-USER-NAME"
FTPP="FTP-SERVER-PASSWORD"
FTPS="FTP-SERVER-IP-ADDRESS"
NOW=$(date +"%d-%m-%Y")
### See comments below ###
### [ ! -d $BAK ] && mkdir -p $BAK || /bin/rm -f $BAK/* ###
[ ! -d "$BAK" ] && mkdir -p "$BAK"
DBS="$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse 'show databases')"
for db in $DBS
do
FILE=$BAK/$db.$NOW-$(date +"%T").gz
$MYSQLDUMP -u $MUSER -h $MHOST -p$MPASS $db | $GZIP -9 > $FILE
done
lftp -u $FTPU,$FTPP -e "mkdir /mysql/$NOW;cd /mysql/$NOW; mput /backup/mysql/*; quit" $FTPS
Everything is running great, however there are a few things I'd like to fix but am clueless when it comes to shell scripts. I'm not asking anyone to write it. Just some pointers. First of all the /backup/mysql directory on my server stacks the files everytime it backs up. Not to big of a deal. But after a year of nightly backups it might get a little full. So id like it to clear that directory after uploading. Also I don't want to overload my hosting service with files so id like it to clear the remote servers dir before uploading. Lastly I would like it to upload to a subdirectory on the remote server such as /mysql
Why reinvent the wheel? You can just use Debian's automysqlbackup package (should be available on Ubuntu as well).
As for cleaning old files the following command might be of help:
find /mysql -type f -mtime +16 -delete
Uploading to remote server can be done using scp(1) command;
To avoid password prompt read about SSH public key authentication
Take a look at Backup, it allows you to model your backup jobs using a Ruby DSL, very powerful.
Support multiple DBs and most popular online storages, and lots of cool features.