How to Press Cntrl+Alt+Del in Remote Desktop

This is very simple. But most of us doesn’t know this.

Just press  Cntrl+Alt+End, this will do Cntl+Alt+Del in the remotely taken desktop

Normal Cntrl+Alt+Del will work in the host machine.

Advertisements

Hive Installation with MySQL metastore

Hive Installation

  • Download the hive tar ball. ( otherwise do apt-get/ yum install/ install the hive rpm manually)
  • Extract the tar ball in a slave node.
  • Set HIVE_HOME  and PATH in /etc/bash.bashrc file.
  • Logout and login again.
  • Type hive in terminal.
  • Hive will work.
  • This is just a play around installation. Here the database used is derby database. This is the default database, but this will not work for multiuser setup. Multiuser means only one can use hive at a time.

Changing the Hive metastore database from derby to MySql

  • Setup a MySql database.
    • In MySql command line type
CREATE USER 'hive_user'@'%' IDENTIFIED BY 'hive@123';
GRANT ALL PRIVILEGES ON *.* TO 'hive_user'@'%' WITH GRANT OPTION;
  • For connecting to a user account in MySql use the command.
C:/Mysql/bin>mysql –uUsername -pPassword
  • Remember the ip address, port, username, password of the mysql setup.
  • Make a firewall inbound rule in the machine where mysql is installed. Otherwise connection to the mysql port will be blocked by the firewall. So jdbc connectivity will not happen.
  • Add mysql-connector-java-5.0.5.jar  file to the lib directory inside hive installation.
  • Create hive-site.xml file in the conf directory of hive installation. Fill that file with all the necessary properties. This file may not be present in the conf directory. So create a new file.
  • Restart Hive.
  • Now multiuser setup will be ready.
  • If you want JDBC Connectivity, thrift server should be started
 hive  --service hiveserver&

*& is used for running that hive service server process in the background.

Sample hive-site.xml file is shown below

<configuration>

<property>

<name>hive.metastore.local</name>

<value>true</value>

</property>

<property>

<name>javax.jdo.option.ConnectionURL</name>

<value>jdbc:mysql://<ip address of mysql machine>/hive?createDatabaseIfNotExist=true</value>

</property>

<property>

<name>javax.jdo.option.ConnectionDriverName</name>

<value>com.mysql.jdbc.Driver</value>

</property>

<property>

<name>javax.jdo.option.ConnectionUserName</name>

<value>hive_user</value>

</property>

<property>

<name>javax.jdo.option.ConnectionPassword</name>

<value>hive@123</value>

</property>

</configuration>

Creating A Local YUM Repository

Introduction

People working on linux may be familiar with yum command.

Yum install <package name>  is a command that is used frequently for installing packages from a remote repository.

YUM stands for Yellowdog Update, Modifier.

YUM is a program that manages updates, installation and removal for RedHat package manager (RPM) systems.

Yum install will pick the repository url from /etc/yum.repos.d/ and download the package and install it in the machine.

Normally yum will work in machines having internet access. But if we want to install packages in isolated environments, normal yum install will not work, because the remote repository may not be accessible in the isolated environment.

In these cases, we have to set up a local yum repository.

Local repository is an exact copy of the remote repository that is made available in the isolated environment.

In most of the companies we need to set up a local repository for doing the yum installations.

Creating a local yum repository is very simple. This document helps you to create a local yum repository.

Prerequisites

A RHEL or CentOS linux machine

Steps

1)      Installing and Starting Webserver  (httpd)

We need a webserver for creating a repository. So ensure that httpd is installed and running on the repository linux machine. If it is not there, download the httpd package and install it manually. If it is not started, start it manually.

rpm –ivh  <package-name>

then start the httpd service

/etc/init.d/httpd start  or service httpd start

2)      Creating a YUM Repository

For creating a repository, we need to install two packages

a)      createrepo

b)      yum-utils

Download and install these packages manually.

After this create a folder in with the name of your repository in /var/www/html/.

mkdir /var/www/html/<repo-name>

Note: the /var/www/html folder structure will be available only after starting httpd service.

Copy the packages that you want to be available in the repository as subfolders in the /var/www/html/<repo-name> directory.

After this go inside the <repo-name> directory and execute the following command.

$ createrepo .

This will create repodata of the repository.

Then try this repository from your web browser.

http://<ipaddress of webserver machine>/reponame/

You will be able to see all the packages. You can add as many packages into the repository. So that it can be made available in all machines using the url.

Note: These repository directory permissions should be set in a way that everybody can access. Better to give 755 permission.

3)      Creating a repo file

The packages present in the local repository can be made available to other machines by creating a repo file for this repository in the respective machines.

In the repo file, we are mentioning the url of this repository. This repo file is created in /etc/yum.repos.d/ directory.

Create a file <repo-name>.repo

Add the below contents to the file and save it.

[repo-name]

name=Local Yum Repository

baseurl=http://<ipaddress of webserver machine>/<path to repo>

gpgcheck = 0

After adding the repo file, execute the following command.

$ yum clean all

This will clear all the temporary data saved about the previous repositories. That is just like refreshing.

With this you can create a repository and keep packages inside it and make it available to multiple machines. If you want a local copy of a remote repository, you can refer the steps below.

4)      Syncing a remote repository with the local repository

If you want to create a local copy of a remote repository, we can create it by using reposync command.

This needs internet connection, because we are copying the repository from a remote location to our local machine.

Create a repo file in /etc/yum.repos.d/ with the url of the remote repository

[repo-name]

name=Remote repository

baseurl=http://<remote-repository-url>

gpgkey=http://<gpg-key url>

gpgcheck = 1

Then create a directory for that repository, go to that directory

then do the following commands

yum clean all

reposync  –r  repo-name .

The repo-name is the repo-name mentioned in the repo file.

This will download the remote repository in our local machine. This will take time depending upon the size of the repository and speed of internet connection.

Copy this downloaded repository to /var/www/html/ directory and execute a createrepo, then this repository can be accessible from any machines (follow steps 2 and 3).