Running Apache Drill Cluster in Windows? - apache-drill

I'm just playing around with Apache Drill for the first time using the nice documentation from the Apache site. I was able to play with it in embedded mode using the sqlline.bat file to start it. However when it comes to distributed mode, the instructions are specific to a unix system - running a Drillbit using a shell command.
Is there anyway for me to play around with Apache Drill cluster using two Windows boxes?
If so, how do I start the Drillbits on each client without being able to run that drillbit.sh file?

The shell command can be run through Cygwin.
Install it and add the path to it's bin directory to your PATH environment variable.
Now assuming that you have the Zookeeper installed and set up on both your windows boxes, open up a command prompt on each box, navigate to the Apache Drill's bin directory and run the following command:
sh ./drillbit.sh start
Running the drillbits without the drillbit.sh is a hell of a task as the script resolves your complete classpath and declares some environment variables like HADOOP_HOME for execution to proceed.

Related

Make MySQL accessible remotely, installed on a windows PC

I was wondering if someone could help showing detailed steps (if possible) to make MySQL accessible remotely. Example: PC 1 has MySQL installed (DB server) on it and PC 2 can now ask PC 1 for data using either PHP, Python etc.
First, I would like to give credits to the people who assisted me when doing this. I will outline how I managed to get this to work. This was done on a machine running Windows 10. The steps are outlined below:
Installing MySQL and Location my.ini file
After installing MySQL server and workbench. Windows store my.ini file on a hidden location other than that of the MySQL installation location.
C:\ProgramData\MySQL\MySQL Server 5.7
This location can be view only when you have enabled windows to show hidden files. This is achieved with the following steps:
Navigate to Control Panel
Click on Appearance and Personalization
Under File Explore Options, click on show hidden files and folders
Under the view tab, Advanced settings, look for the option hidden files and folder and select the show hidden files, folders and drives and click ok.
Navigate to C:\ and you should see the ProgramData folder
Copy this file onto MySQL installation folder
Navigate to
C:\ProgramData\MySQL\MySQL Server 5.7
and copy the file to
C:\Program Files\MySQL\MySQL Server 5.7
Configure MySQL for remote access
open my.in file using your preferred editor and look for the line and remove the # in front of it to uncomment it:
bind-address=0.0.0.0
if the line is not there then add it manually save and restart MySQL or the machine.
Activating Telnet
The computer must have the telnet activity-activated, to achieve this the do the following steps:
Navigate to Control Panel -> Programs -> Programs and Features and under this section click on Turn Windows features on or off
Look for Telnet Client and check it
Click Ok, and done now telnet is active.
On the MySQL, workbench creates a new SQL connection and use the IP address you used on my.in file and you should be set to go.
Now test this by writing a simple PHP or Python script to connect to your MySQL server.

Customizing a GCE Ubuntu VM image

I have a Google Cloud Platform account that I access from a VirtualBox VM. I am using the Google Compute Engine for a project that I am currently working on, and I had to create a custom image based on the Ubuntu 14.04 image that's available there.
I made changes to the Ubuntu image by ssh'ing into an Ubuntu 14.04 instance, (from my Vbox VM terminal) installing the Matlab compiler runtime, and downloading some other files that I needed. I created the custom image by following the steps according to the documentation.
However, now the changes I made are only available to me when I SSH from my Vbox VM terminal. I need to be able to run a certain matlab program Via startup scripts, how can I make it so that all users using this image have access to the customizations I made? Is there a way I can do this without having to make the edits by ssh'ing from the developers console and redoing all the changes?
EDIT: I don't think I was very clear so Ill give some examples. say my Google account is alexanderlang. When I ssh into an instance created from my custom image from the developers console, bash prompt looks like:
alexanderlang#myinstance $
My Vbox username is alex, and when I ssh into the same instance from my vbox terminal, bash prompt looks like:
alex#myinstance $
alex#myinstance can run matlab programs, but alexanderlang#myinstance cannot. I'm talking about the same instance, created from the same image. I think this might have something to do with the ssh keys for my custom image, but I don't know how to change or remove those keys.
When you connect to your VM instance via ssh by using either Developers Console or gcloud, the user account is dynamically created (if it doesn't already exist) by setting metadata on the VM. The question is: how does each tool choose your username?
When you use Google Developers Console, the only information it knows about you is your Google Account name, so it uses that, e.g., <first-name>_<last-name> or similar.
When you connect to your instance via gcloud, it knows the value of $USER so it uses that instead.
Note that in either case, your account has passwordless sudo access, so if you want to switch from one account to the other, you can run:
sudo su alex
while logged in as alexanderlang and then you have access to all the programs that alex does.
Similarly, you can run:
sudo su alexanderlang
while logged in as alex to do the reverse.
Startup scripts run as root. To run commands as another user, you need to do two things:
change to that username
run commands as that user
sudo su alex will create a new shell and hence ignore the rest of the script (until you manually exit the user shell, which is not what you want).
You can use sudo su alex -c 'command to run' but since what you want to run is a complex script, you need to first save the script to a file, and then run it.
Your options are:
pre-create the shell script to run
dynamically generate it from the startup script
Doing (1) is easy if the script never changes. For frequently-changing scripts (and it sounds like, many dynamically created VMs), you want to use option (2).
Here's how to do this in a startup script:
cat > /tmp/startup-script-helper.sh <<EOF
# ... put the script contents here ...
EOF
sudo su alex -c '/tmp/startup-script-helper.sh'
You can use Packer to create a derived image from a stock GCE VM image. Packer will let you do the following very easily:
boot a GCE VM using an image you specify
run some customization step, e.g., shell script, or Chef/Puppet/etc.
save the resulting image in your Google Cloud Platform project
Then, you can boot any number of new VMs using your newly-created image.
Note that since your VM image will be stored on Google Cloud Storage, you will be charged for the space it uses. Current pricing for Google Cloud Storage standard class is USD $0.026 / GB / month. A typical VM image should be less than 1GB.
You can see a complete example of how I used Packer to build VMs and pre-installed Ambari on it via my GitHub repo.

Accessing git to install mysql on server on gandi.net

I purchased a Simple Hosting instance using node.js/mysql on gandi.net.
I'm trying to set up my database, but I'm having some issues with connectivity.
I found some sample code to connect and talk to the database (which I set up via PHPMyAdmin), but it requires the mysql module (which I assumed would already be installed on my instance, but since I don't know how any of this works, that's fine).
I get the error:
Error: Cannot find module 'mysql'
in my log file.
I'm at a loss though as to how to actually install the module.
I tried to use their SSH console (via a firefox plugin), but my SSH credentials don't have the permission to run 'npm install mysql' and sudo isn't installed.
I also tried to install Git for Windows from mysisgit but I have zero idea how to connect to my remote server from this tool.
I'm just looking for some advice on how to proceed. I'm totally new and am engaging in learning this for personal development, so I don't have a lot of info on where to turn. Thanks!
The problem was that I wasn't using SSH to install to the correct directory (I was just trying to run it directly when I logged into shell). I needed to navigate into my web/vhosts/default/ directory, then the 'npm install mysql' worked absolutely fine.

mysqlworkbench without root access

I have a full normal user account for ssh access and I'd like to use the mysql diff capability of mysqlworkbench's mysqldbcompare (or some other cli tool if it exists). The problem is I don't have root access. Can I install this in my normal user account so I can compare my DB's on that server?
The best way to do such things is to install them as root using the system's package manager, but I'm sure you know that :P
I downloaded the source code from their website, and it uses a traditional configure script. I have installed programs, in fact whole ecosystems, in unprivileged user accounts using configure scripts. Usually all it takes is to specify where you want files to be installed:
./configure --prefix=$HOME/eco
Sometimes you have to install dependencies too. Then make sure to set LD_LIBRARY_PATH accordingly.
Depending on the distro you're using, you can even install packages to your home directory: see this question

Package Java web app along with jboss, mysql and activemq for deployment

I have a springframework web application that uses JBoss, MySQL and ActiveMQ.
At the moment, I have to install and configure JBoss, MySQL and ActiveMQ and JBoss manually.
What is the best way to package the application so a user can maybe do a one click install (on Linux platform, maybe Windows too?)
The "proper" way to do it is to pull down the source or src.rpms (or the equivalent of src.rpms depending on your distro) and repackage them correctly. If you have never messed with packaging linux application then this will probably take you a long time and will yield mediocre results unless you are willing to invest a lot of time.
An easier method is to write a shell script. Copy every shell command you type into a .sh file and run that file as a privileged user. If you edit files manually (with vim, emacs or gedit) instead edit the files with perl, sed, and awk, or just crush the files by curl'ing the modified version from a local webserver or copied from scp.
You can include the commands to install the packages as well as configure them in the script if you like.
As far as ActiveMQ is in question, you can always embed it in your application. Take a look at http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html for more info