Wednesday, 6 April 2016

Install splunk 6.4.0 in ubuntu 14.04LTS


First check your operating system configuration. Based on that download splunk .In my caase I downloaded 64bit.
If you want to check your operating system configuration use uname –a command


Download .deb file .If you are new user it will ask registration once completed registration. Now you can download the file.


After download is completed you can install it using dpkg command like below.
dpkg -i /home/madhu/Downloads/splunk-6.4.0-f2c836328108-linux-2.6-amd64.deb

then you will get like below.

Selecting  previously  unselected package splunk.
(Reading database ... 20803 files and directories currently installed.)
Unpacking splunk (from splunk-6.4.0-204106-linux-2.6-amd64.deb) .
Setting up splunk (6.0.3-204106) .
Complete


Next we need to create the init.d script so that we can easily start and stop Splunk.Change the 
Splunk directory and run the splunk executable with the below arguments.

1
2
 cd /opt/splunk/bin/
   ./splunk enable boot-start



Now it will ask licence and agreement then enter  Y  for accepting licence.

Now start the splunk service

Sudo /opt/splunk/bin/splunk start
Now you can access splunk web ui  http://ipaddress:8000  or its created ui base on your  account like
http://madhu-vb:8000

By default login credentials  is
User name: admin
Password  : changeme




Tuesday, 16 February 2016

Write a java program to Remove duplicate characters in a given String ?

Write a java program to Remove duplicate characters in a given String ?

import java.util.LinkedHashSet;
import java.util.Scanner;
import java.util.Set;

public class RemoveDuplicateCharacters {
      public String removeDuplicates(String input) {
            Set<Character> set = new LinkedHashSet<>();
            for (int i = 0; i < input.length(); i++) {
                  set.add(input.charAt(i));
            }
            StringBuilder sb = new StringBuilder();
            for (Character c : set) {
                  sb.append(c);
            }
            return sb.toString();
      }
      public static void main(String[] args) {
            RemoveDuplicateCharacters rd = new RemoveDuplicateCharacters();
            Scanner scanner = new Scanner(System.in);
            System.out.println("Please enter a String:");
            String input = scanner.next();
            System.out.println("RESULT IS : "+rd.removeDuplicates(input));
      }
}

Ouput:
Please enter a String:
mmmaaadddhhhuuu

RESULT IS : madhu 

Monday, 15 February 2016

What is Differences between Hadoop and RDBMS ?


Diffrences Between Hadoop And RDBMS





RDBMS

HADOOP
Data size
Gigabytes
Petabytes
Access
Interactive and batch
Batch
Updates
Read and write many
Write and read many
Structure
Static schema
Dynamic schema
Integrity
High Normalisation
Low Normalisation
Scalling
Non Linear
Linear


What is differences between Apache Hive and RDBMS ?



What is differences between Apache Hive and RDBMS ?
                      
                              Hive

                           
                              RDBS
SQL  Interface

SQL  Interface

Focus  on  analytics

May  focus  on  online  or  analytics.

No  transactions.

Transactions  usually  supported.

Partition  adds,  no  random  INSERTs. InPlace  updates  not  natively  supported  
(but   are  possible).

Random  INSERT  and  UPDATE  supported.  

Distributed  processing  via  map/reduce.

Distributed  processing  varies  by  vendor  
(if  available).

Scales  to  hundreds  of  nodes

Seldom  scale  beyond  20  nodes
Built  for  commodity  hardware
Often  built  on  proprietary  hardware   (especially  when  scaling  out).

Low  cost  per  peta byte.

What’s  a  peta byte? J



Sunday, 14 February 2016

Write a Java Program Without using reverse function?

Write a Java Program Without using reverse Funtion?

import java.util.Scanner;

public class ReverseStringWithoutReverseFunction {

       public static String reverse(String str) {
              StringBuilder sb = new StringBuilder();
              char[] string = str.toCharArray();
              for (int i = string.length - 1; i >= 0; i--) {
                     sb.append(string[i]);
              }
              System.out.println(sb.toString());
              return sb.toString();
       }

       public static void main(String[] args) {
              Scanner keyboard = new Scanner(System.in);
              System.out.println("Enter a String:");
              String input = keyboard.next();
              reverse(input);
       }

}