Showing posts with label Admin. Show all posts
Showing posts with label Admin. Show all posts

Friday, November 13, 2015

Installing MySQL on Ubuntu 14.04


Simple Steps:

1. Install mySql by entering below command
sudo apt-get install mysql-server
 
Note: you have to feed the root password during the installation

2. We are done. MySQL is installed

3. Now lets login to MySQL and do some basic CURD operations

mysql -u root -p
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

4.  

mysql> create table employee (empno int, empname varchar(50), empcity varchar(50));
ERROR 1046 (3D000): No database selected
mysql> create database sales
    -> ;
Query OK, 1 row affected (0.00 sec)


mysql> use sales
Database changed
mysql> create table employee (empno int, empname varchar(50), empcity varchar(50));
Query OK, 0 rows affected (0.10 sec)

mysql> insert into employee values (1001, 'Karthik', 'Chennai');
Query OK, 1 row affected (0.06 sec)

mysql> insert into employee values (1002, 'Saravanan', 'NY');
Query OK, 1 row affected (0.06 sec)

mysql> select * from employee;
+-------+-----------+---------+
| empno | empname   | empcity |
+-------+-----------+---------+
|  1001 | Karthik   | Chennai |
|  1002 | Saravanan | NY      |
+-------+-----------+---------+
2 rows in set (0.00 sec)

mysql> exit
Aborted
ram@hadoop:~$ 

How to install Sqoop 1.4.6 on Hadoop 2.7.1 in Ubuntu 14.04


Steps:
1. Download the Sqoop .tar.gz file on below path
http://sqoop.apache.org/

2. extract the .tar.gz file, you will get sqoop setup folder

3. move the sqoop setup folder to /usr/local/sqoop path
sudo mv hadoop/sqoop-1.4.6.bin__hadoop-0.23 /usr/lib/sqoop

4. add below lines in .bashrc file
export SQOOP_HOME=/usr/lib/sqoop
export PATH=$PATH:$SQOOP_HOME/bin

5. run below command to update sqoop path
source .bashrc

6. check sqoop version
sqoop version

15/11/13 22:36:32 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6
Sqoop 1.4.6git commit id c0c5a81723759fa575844a0a1eae8f510fa32c25
Compiled by root on Mon Apr 27 14:20:17 CST 2015



Saturday, August 29, 2015

How to Install Pig on Ubuntu 14.04

1. Download pig tar file on below location
http://mirrors.sonic.net/apache/pig/latest/

2. extract the tar file in Downloads folder

3. create folder for pig
sudo mkdir /usr/lib/pig

4. move the extracted folder to /usr/lib/pig
sudo mv Downloads/pig-0.15.0 /usr/lib/pig/

5. update .bashrc with pig home path information

export PIG_HOME=/usr/lib/pig/pig-0.15.0
export PATH=$PATH:$PIG_HOME/bin

6. make it effective by running below command
source .bashrc

7. type 'pig' to open pig shell
pig

Wednesday, July 29, 2015

Hadoop Admin Commands quick reference

Reference:http://www.thegeekstuff.com/
 
Hadoop filesystem commands


hadoop fs -mkdir /dir
hadoop fs -ls
hadoop fs -cat <filename>
hadoop fs -rm <<filename>>
hadoop fs -mv file:///data/datafile /user/hduser/data
hadoop fs -touchz <<filename>> -create empty file
hadoop fs -stat <filename>
hadoop fs -expunge   <<empty trash on hdfs>>
ram@ram:/etc/init.d$ hadoop fs -du /user
50270  /user/1.log
0      /user/hive

hadoop fs -copyFromLocal <source> <destination>
hadoop fs -copyToLocal <source> <destination>
hadoop fs -put <source> <destination> --copy from remote location
hadoop fs -get <source> <destination> --copy to remote location
hadoop distcp hdfs://192.168.0.8:8020/input hdfs://192.168.0.8:8020/output
-- Copy data from one cluster to another using the cluster URL
hadoop fs -setrep -w 3 file1
hadoop fs -getmerge mydir bigfile
-- Merge files in mydir directory and download it as one big file




Hadoop Job Commands

hadoop job -submit <job-file>
hadoop job -status <job-id>
hadoop job -history
hadoop job -kill-task <task-id>


ram@ram:/etc/init.d$ hadoop job -list all
DEPRECATED: Use of
this script to execute mapred command is deprecated.
Instead use the mapred command for it.

15/07/29 21:03:51 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
15/07/29 21:03:51 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
Total jobs:0
                  JobId         State         StartTime        UserName           Queue      Priority     UsedContainers     RsvdContainers     UsedMem RsvdMem     NeededMem       AM info


ram@ram:/etc/init.d$ hadoop job -list-active-trackers
DEPRECATED: Use of this script to execute mapred command is deprecated.
Instead use the mapred command for it.

15/07/29 21:04:24 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
tracker_ram:49874



Hadoop Namenode commands

hadoop namenode -format
hadoop namenode -upgrade
hadoop namenode -recover -force
hadoop fsck -delete    <<delete corrupted files>>
hadoop fsck -move    <<move corrupted files to lost+found folder>

-- Recover namenode metadata after a cluster failure (may lose data)

ram@ram:/etc/init.d$ stop-dfs.sh
Stopping namenodes on [localhost]
localhost: stopping namenode
localhost: stopping datanode
Stopping secondary namenodes [0.0.0.0]
0.0.0.0: stopping secondarynamenode

ram@ram:/etc/init.d$ stop-yarn.sh
stopping yarn daemons
stopping resourcemanager
localhost: stopping nodemanager
no proxyserver to stop


ram@ram:/etc/init.d$ start-dfs.sh
Starting namenodes on [localhost]
localhost: starting namenode, logging to /usr/local/hadoop/logs/hadoop-ram-namenode-ram.out
localhost: starting datanode, logging to /usr/local/hadoop/logs/hadoop-ram-datanode-ram.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /usr/local/hadoop/logs/hadoop-ram-secondarynamenode-ram.out


ram@ram:/etc/init.d$ start-yarn.sh
starting yarn daemons
starting resourcemanager, logging to /usr/local/hadoop/logs/yarn-ram-resourcemanager-ram.out
localhost: starting nodemanager, logging to /usr/local/hadoop/logs/yarn-ram-nodemanager-ram.out
ram@ram:/etc/init.d$


ram@ram:/etc/init.d$ jps
6330 NodeManager
6192 ResourceManager
5827 DataNode
6649 Jps
6028 SecondaryNameNode
5664 NameNode



ram@ram:/etc/init.d$ hadoop fsck /
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

Connecting to namenode via http://localhost:50070/fsck?ugi=ram&path=%2F
FSCK started by ram (auth:SIMPLE) from /127.0.0.1 for path / at Wed Jul 29 20:56:55 IST 2015
.
/user/1.log:  Under replicated BP-393036986-127.0.1.1-1437358619878:blk_1073741825_1001. Target Replicas is 3 but found 1 replica(s).
Status: HEALTHY
 Total size:    50270 B
 Total dirs:    7
 Total files:    1
 Total symlinks:        0
 Total blocks (validated):    1 (avg. block size 50270 B)
 Minimally replicated blocks:    1 (100.0 %)
 Over-replicated blocks:    0 (0.0 %)
 Under-replicated blocks:    1 (100.0 %)
 Mis-replicated blocks:        0 (0.0 %)
 Default replication factor:    3
 Average block replication:    1.0
 Corrupt blocks:        0
 Missing replicas:        2 (66.666664 %)
 Number of data-nodes:        1
 Number of racks:        1
FSCK ended at Wed Jul 29 20:56:55 IST 2015 in 3 milliseconds


The filesystem under path '/' is HEALTHY



ram@ram:/etc/init.d$ hadoop fsck / -files -blocks -locations -racks
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.


Connecting to namenode via http://localhost:50070/fsck?ugi=ram&files=1&blocks=1&locations=1&racks=1&path=%2F
FSCK started by ram (auth:SIMPLE) from /127.0.0.1 for path / at Wed Jul 29 20:58:22 IST 2015
/ <dir>
/tmp <dir>
/tmp/hive <dir>
/tmp/hive/ram <dir>
/user <dir>
/user/1.log 50270 bytes, 1 block(s):  Under replicated BP-393036986-127.0.1.1-1437358619878:blk_1073741825_1001. Target Replicas is 3 but found 1 replica(s).
0. BP-393036986-127.0.1.1-1437358619878:blk_1073741825_1001 len=50270 repl=1 [/default-rack/127.0.0.1:50010]

/user/hive <dir>
/user/hive/warehouse <dir>
Status: HEALTHY
 Total size:    50270 B
 Total dirs:    7
 Total files:    1
 Total symlinks:        0
 Total blocks (validated):    1 (avg. block size 50270 B)
 Minimally replicated blocks:    1 (100.0 %)
 Over-replicated blocks:    0 (0.0 %)
 Under-replicated blocks:    1 (100.0 %)
 Mis-replicated blocks:        0 (0.0 %)
 Default replication factor:    3
 Average block replication:    1.0
 Corrupt blocks:        0
 Missing replicas:        2 (66.666664 %)
 Number of data-nodes:        1
 Number of racks:        1
FSCK ended at Wed Jul 29 20:58:22 IST 2015 in 3 milliseconds


The filesystem under path '/' is HEALTHY



Hadoop dfsadmin commands

ram@ram:/etc/init.d$ hadoop dfsadmin -report
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

Configured Capacity: 98496679936 (91.73 GB)
Present Capacity: 80164052992 (74.66 GB)
DFS Remaining: 80163958784 (74.66 GB)
DFS Used: 94208 (92 KB)
DFS Used%: 0.00%
Under replicated blocks: 1
Blocks with corrupt replicas: 0
Missing blocks: 0
Missing blocks (with replication factor 1): 0

-------------------------------------------------
Live datanodes (1):

Name: 127.0.0.1:50010 (localhost)
Hostname: ram
Decommission Status : Normal
Configured Capacity: 98496679936 (91.73 GB)
DFS Used: 94208 (92 KB)
Non DFS Used: 18332626944 (17.07 GB)
DFS Remaining: 80163958784 (74.66 GB)
DFS Used%: 0.00%
DFS Remaining%: 81.39%
Configured Cache Capacity: 0 (0 B)
Cache Used: 0 (0 B)
Cache Remaining: 0 (0 B)
Cache Used%: 100.00%
Cache Remaining%: 0.00%
Xceivers: 1
Last contact: Wed Jul 29 21:06:41 IST 2015



ram@ram:/etc/init.d$ hadoop dfsadmin -setQuota 10 /user
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.



ram@ram:/etc/init.d$ hadoop fs -count -q /user
          10               6            none             inf            3            1              50270 /user
ram@ram:/etc/init.d$

ram@ram:/etc/init.d$ hadoop dfsadmin -safemode enter
Safe mode is ON


ram@ram:/etc/init.d$ hadoop dfsadmin -saveNamespace
<<Backup Metadata (fsimage & edits). Put cluster in safe mode before this command.>>
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

Save namespace successful


ram@ram:/etc/init.d$ hadoop dfsadmin -safemode get
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

Safe mode is ON



ram@ram:/etc/init.d$ hadoop dfsadmin -safemode leave
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

Safe mode is OFF
ram@ram:/etc/init.d$



Hadoop yarn commands



Hadoop Balancer commands

ram@ram:/etc/init.d$ start-balancer.sh
starting balancer, logging to /usr/local/hadoop/logs/hadoop-ram-balancer-ram.out

hadoop dfsadmin -setBalancerBandwidth <bandwidthinbytes>
ram@ram:/etc/init.d$ hadoop balancer -threshold 20
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

15/07/29 21:16:22 INFO balancer.Balancer: Using a threshold of 20.0
15/07/29 21:16:22 INFO balancer.Balancer: namenodes  = [hdfs://localhost:9000]
15/07/29 21:16:22 INFO balancer.Balancer: parameters = Balancer.Parameters[BalancingPolicy.Node, threshold=20.0, max idle iteration = 5, number of nodes to be excluded = 0, number of nodes to be included = 0]
Time Stamp               Iteration#  Bytes Already Moved  Bytes Left To Move  Bytes Being Moved
15/07/29 21:16:22 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
15/07/29 21:16:24 INFO net.NetworkTopology: Adding a new node: /default-rack/127.0.0.1:50010
15/07/29 21:16:24 INFO balancer.Balancer: 0 over-utilized: []
15/07/29 21:16:24 INFO balancer.Balancer: 0 underutilized: []
The cluster is balanced. Exiting...
29 Jul, 2015 9:16:24 PM           0                  0 B                 0 B               -1 B
29 Jul, 2015 9:16:24 PM  Balancing took 2.217 seconds
ram@ram:/etc/init.d$





Monday, July 20, 2015

Install hive 1.2.1 on ubuntu 14.04

1. download hive on below path
http://apache.mirrors.hoobly.com/hive/

2. extract the .tar.gz file and move the folder to /usr/lib/hive path
sudo mv Downloads/apache-hive-1.2.1-bin /usr/lib/hive

3. provide access to hive path
sudo chown -R ram /usr/lib/hive

4. configure environment variables .bashrc

export HIVE_HOME=/usr/lib/hive/
export PATH=$PATH:$HIVE_HOME/bin

5. effect the changes
source ~/.bashrc

6. create folders for hive in HDFS

hadoop fs -mkdir /tmp
hadoop fs -mkdir /user/hive/warehouse
hadoop fs -chmod g+w /tmp
hadoop fs -chmod g+w /user/hive/warehouse

7. run hive

hive

8. starting hive server1 and server2

/bin/hive --service hiveserver
/bin/hiveserver2

Note: Hive Web UI

1. start hwi service
hive --service hwi

2. http://localhost:9999/hwi/index.jsp



Install HBase 1.0.1.1 on Ubuntu 14.04

Steps:

1. Download hbase tar.gz file in below path
http://apache.mirrors.ionfish.org/hbase/

2. unzip the file and move the extracted folder to /usr/lib/hbase path
sudo mv ~/Downloads/hbase-0.94.6 /usr/lib/hbase

3. edit gedit /usr/lib/hbase/conf/hbase-env.sh file to include JAVA_HOME path
# The java implementation to use.  Java 1.6 required.
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64


4. update hbase path in .bashrc file

#HBASE_PATH
export HBASE_HOME=/usr/lib/hbase/
export PATH=$PATH:$HBASE_HOME/bin


5. update conf/hbase-site.xml with working path

<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:///usr/lib/hbase/data_dir</value>
</property>

<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/ram/zookeeper</value>
</property>
</configuration>


6. start hbase

start-hbase.sh

7. using hbase shell

hbase shell

8. stop hbase daemon

stop-hbase.sh


Errors and fixes:

Error 1 :
ERROR org.apache.hadoop.hbase.master.HMasterCommandLine: Failed to start master
org.apache.hadoop.ipc.RemoteException: Server IPC version 9 cannot communicate with client version 4


reason: hadoop vs hbase 0.94.6 compatibility issue.
fix: install latest hadoop version (1.0.1.1)


Wednesday, June 17, 2015

Installing Neo4j 2.2.2 in Ubuntu 14.0.4

ram@ram-pc:~$ sudo apt-get update && sudo apt-get install python-software-properties - See more at: http://codiply.com/blog/standalone-neo4j-server-setup-on-ubuntu-14-04#sthash.hEBz5eJk.dpuf

[sudo] password for ram:
Ign http://extras.ubuntu.com trusty InRelease
Ign http://security.ubuntu.com trusty-security InRelease                      
Hit http://extras.ubuntu.com trusty Release.gpg                               
Ign http://in.archive.ubuntu.com trusty InRelease                             
Ign http://repo.mongodb.org trusty/mongodb-org/3.0 InRelease                  
Hit http://extras.ubuntu.com trusty Release                                   
Hit http://repo.mongodb.org trusty/mongodb-org/3.0 Release.gpg                
Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B]          
Ign http://in.archive.ubuntu.com trusty-updates InRelease                     
Hit http://extras.ubuntu.com trusty/main Sources                              
Hit http://repo.mongodb.org trusty/mongodb-org/3.0 Release                    
Get:2 http://security.ubuntu.com trusty-security Release [63.5 kB]            
Hit http://extras.ubuntu.com trusty/main amd64 Packages                       
Ign http://in.archive.ubuntu.com trusty-backports InRelease                   
Hit http://extras.ubuntu.com trusty/main i386 Packages                        
Hit http://in.archive.ubuntu.com trusty Release.gpg                           
Get:3 http://in.archive.ubuntu.com trusty-updates Release.gpg [933 B]         
Hit http://in.archive.ubuntu.com trusty-backports Release.gpg                 
Hit http://in.archive.ubuntu.com trusty Release                               
Get:4 http://security.ubuntu.com trusty-security/main Sources [85.8 kB]       
Get:5 http://in.archive.ubuntu.com trusty-updates Release [63.5 kB]           
Ign http://extras.ubuntu.com trusty/main Translation-en_IN                    
Ign http://extras.ubuntu.com trusty/main Translation-en                       
Get:6 http://security.ubuntu.com trusty-security/restricted Sources [2,061 B] 
Hit http://in.archive.ubuntu.com trusty-backports Release                     
Get:7 http://security.ubuntu.com trusty-security/universe Sources [25.7 kB]   
Hit http://in.archive.ubuntu.com trusty/main Sources                          
Get:8 http://security.ubuntu.com trusty-security/multiverse Sources [2,333 B] 
Hit http://in.archive.ubuntu.com trusty/restricted Sources                    
Get:9 http://security.ubuntu.com trusty-security/main amd64 Packages [299 kB] 
Hit http://in.archive.ubuntu.com trusty/universe Sources                      
Hit http://repo.mongodb.org trusty/mongodb-org/3.0/multiverse amd64 Packages  
Hit http://in.archive.ubuntu.com trusty/multiverse Sources                    
Hit http://repo.mongodb.org trusty/mongodb-org/3.0/multiverse i386 Packages   
Hit http://in.archive.ubuntu.com trusty/main amd64 Packages                   
Hit http://in.archive.ubuntu.com trusty/restricted amd64 Packages             
Hit http://in.archive.ubuntu.com trusty/universe amd64 Packages               
Get:10 http://security.ubuntu.com trusty-security/restricted amd64 Packages [8,875 B]
Hit http://in.archive.ubuntu.com trusty/multiverse amd64 Packages             
Get:11 http://security.ubuntu.com trusty-security/universe amd64 Packages [108 kB]
Hit http://in.archive.ubuntu.com trusty/main i386 Packages                    
Get:12 http://security.ubuntu.com trusty-security/multiverse amd64 Packages [3,686 B]
Hit http://in.archive.ubuntu.com trusty/restricted i386 Packages              
Get:13 http://security.ubuntu.com trusty-security/main i386 Packages [285 kB] 
Hit http://in.archive.ubuntu.com trusty/universe i386 Packages                
Hit http://in.archive.ubuntu.com trusty/multiverse i386 Packages              
Ign http://repo.mongodb.org trusty/mongodb-org/3.0/multiverse Translation-en_IN
Hit http://in.archive.ubuntu.com trusty/main Translation-en                   
Ign http://repo.mongodb.org trusty/mongodb-org/3.0/multiverse Translation-en  
Get:14 http://security.ubuntu.com trusty-security/restricted i386 Packages [8,846 B]
Hit http://in.archive.ubuntu.com trusty/multiverse Translation-en             
Get:15 http://security.ubuntu.com trusty-security/universe i386 Packages [108 kB]
Hit http://in.archive.ubuntu.com trusty/restricted Translation-en             
Get:16 http://security.ubuntu.com trusty-security/multiverse i386 Packages [3,841 B]
Hit http://security.ubuntu.com trusty-security/main Translation-en            
Hit http://in.archive.ubuntu.com trusty/universe Translation-en               
Hit http://security.ubuntu.com trusty-security/multiverse Translation-en      
Get:17 http://in.archive.ubuntu.com trusty-updates/main Sources [207 kB]      
Hit http://security.ubuntu.com trusty-security/restricted Translation-en      
Hit http://security.ubuntu.com trusty-security/universe Translation-en        
Get:18 http://in.archive.ubuntu.com trusty-updates/restricted Sources [3,433 B]
Get:19 http://in.archive.ubuntu.com trusty-updates/universe Sources [121 kB]  
Get:20 http://in.archive.ubuntu.com trusty-updates/multiverse Sources [5,143 B]
Get:21 http://in.archive.ubuntu.com trusty-updates/main amd64 Packages [541 kB]
Get:22 http://in.archive.ubuntu.com trusty-updates/restricted amd64 Packages [11.8 kB]
Get:23 http://in.archive.ubuntu.com trusty-updates/universe amd64 Packages [287 kB]
Get:24 http://in.archive.ubuntu.com trusty-updates/multiverse amd64 Packages [12.0 kB]
Get:25 http://in.archive.ubuntu.com trusty-updates/main i386 Packages [528 kB]
Ign http://ppa.launchpad.net trusty InRelease                                 
Hit http://ppa.launchpad.net trusty Release.gpg                               
Hit http://ppa.launchpad.net trusty Release                                   
Get:26 http://in.archive.ubuntu.com trusty-updates/restricted i386 Packages [11.8 kB]
Hit http://ppa.launchpad.net trusty/main amd64 Packages                       
Hit http://ppa.launchpad.net trusty/main i386 Packages                        
Hit http://ppa.launchpad.net trusty/main Translation-en                       
Get:27 http://in.archive.ubuntu.com trusty-updates/universe i386 Packages [288 kB]
Get:28 http://in.archive.ubuntu.com trusty-updates/multiverse i386 Packages [12.1 kB]
Hit http://in.archive.ubuntu.com trusty-updates/main Translation-en           
Hit http://in.archive.ubuntu.com trusty-updates/multiverse Translation-en     
Hit http://in.archive.ubuntu.com trusty-updates/restricted Translation-en     
Get:29 http://in.archive.ubuntu.com trusty-updates/universe Translation-en [150 kB]
Hit http://in.archive.ubuntu.com trusty-backports/main Sources                
Hit http://in.archive.ubuntu.com trusty-backports/restricted Sources          
Hit http://in.archive.ubuntu.com trusty-backports/universe Sources            
Hit http://in.archive.ubuntu.com trusty-backports/multiverse Sources          
Hit http://in.archive.ubuntu.com trusty-backports/main amd64 Packages         
Hit http://in.archive.ubuntu.com trusty-backports/restricted amd64 Packages   
Hit http://in.archive.ubuntu.com trusty-backports/universe amd64 Packages     
Hit http://in.archive.ubuntu.com trusty-backports/multiverse amd64 Packages   
Hit http://in.archive.ubuntu.com trusty-backports/main i386 Packages          
Hit http://in.archive.ubuntu.com trusty-backports/restricted i386 Packages    
Hit http://in.archive.ubuntu.com trusty-backports/universe i386 Packages      
Hit http://in.archive.ubuntu.com trusty-backports/multiverse i386 Packages    
Hit http://in.archive.ubuntu.com trusty-backports/main Translation-en         
Hit http://in.archive.ubuntu.com trusty-backports/multiverse Translation-en   
Hit http://in.archive.ubuntu.com trusty-backports/restricted Translation-en   
Hit http://in.archive.ubuntu.com trusty-backports/universe Translation-en     
Ign http://in.archive.ubuntu.com trusty/main Translation-en_IN                
Ign http://in.archive.ubuntu.com trusty/multiverse Translation-en_IN          
Ign http://in.archive.ubuntu.com trusty/restricted Translation-en_IN          
Ign http://in.archive.ubuntu.com trusty/universe Translation-en_IN            
Fetched 3,248 kB in 27s (117 kB/s)                                            
Reading package lists... Done
Reading package lists... Done
Building dependency tree      
Reading state information... Done
E: Unable to locate package See
E: Unable to locate package more
E: Unable to locate package http
E: Couldn't find any package by regex 'http://codiply.com/blog'
ram@ram-pc:~$


ram@ram-pc:~$ wget -O - http://debian.neo4j.org/neotechnology.gpg.key >> key.pgp - See more at: http://codiply.com/blog/standalone-neo4j-server-setup-on-ubuntu-14-04#sthash.hEBz5eJk.dpuf
--2015-06-17 22:31:49--  http://debian.neo4j.org/neotechnology.gpg.key
Resolving debian.neo4j.org (debian.neo4j.org)... 52.0.233.188
Connecting to debian.neo4j.org (debian.neo4j.org)|52.0.233.188|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1679 (1.6K) [application/octet-stream]
Saving to: ‘STDOUT’

100%[======================================================================================================>] 1,679       --.-K/s   in 0s     

2015-06-17 22:31:49 (135 MB/s) - written to stdout [1679/1679]

--2015-06-17 22:31:49--  http://-/
Resolving - (-)... failed: Name or service not known.
wget: unable to resolve host address ‘-’
--2015-06-17 22:31:59--  http://see/
Resolving see (see)... failed: Name or service not known.
wget: unable to resolve host address ‘see’
--2015-06-17 22:32:09--  http://more/
Resolving more (more)... failed: Name or service not known.
wget: unable to resolve host address ‘more’
--2015-06-17 22:32:19--  ftp://at/
           => ‘.listing’
Resolving at (at)... failed: Name or service not known.
wget: unable to resolve host address ‘at’
--2015-06-17 22:32:29--  http://codiply.com/blog/standalone-neo4j-server-setup-on-ubuntu-14-04
Resolving codiply.com (codiply.com)... 80.90.202.26
Connecting to codiply.com (codiply.com)|80.90.202.26|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 17730 (17K) [text/html]
Saving to: ‘STDOUT’

100%[======================================================================================================>] 17,730      55.0KB/s   in 0.3s  

2015-06-17 22:32:45 (55.0 KB/s) - written to stdout [17730/17730]

FINISHED --2015-06-17 22:32:45--
Total wall clock time: 56s
Downloaded: 2 files, 19K in 0.3s (60.2 KB/s)
ram@ram-pc:~$

ram@ram-pc:~$ sudo apt-key add key.pgp
OK

ram@ram-pc:~$ sudo apt-get update && sudo apt-get install neo4j
Ign http://extras.ubuntu.com trusty InRelease
Ign http://in.archive.ubuntu.com trusty InRelease                             
Ign http://repo.mongodb.org trusty/mongodb-org/3.0 InRelease                  
Hit http://extras.ubuntu.com trusty Release.gpg                               
Ign http://in.archive.ubuntu.com trusty/universe Translation-en_IN            
Fetched 2,374 kB in 17s (132 kB/s)                                            
Reading package lists... Done
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following extra packages will be installed:
  daemon

The following NEW packages will be installed:
  daemon neo4j
0 upgraded, 2 newly installed, 0 to remove and 304 not upgraded.
Need to get 53.6 MB of archives.
After this operation, 62.8 MB of additional disk space will be used.Do you want to continue? [Y/n] y
Get:1 http://debian.neo4j.org/repo/ stable/ neo4j 2.2.2 [53.5 MB]
Get:2 http://in.archive.ubuntu.com/ubuntu/ trusty/universe daemon amd64 0.6.4-1 [98.2 kB]
Fetched 53.6 MB in 1min 15s (709 kB/s)                                        
Selecting previously unselected package daemon.
(Reading database ... 169071 files and directories currently installed.)
Preparing to unpack .../daemon_0.6.4-1_amd64.deb ...
Unpacking daemon (0.6.4-1) ...
Selecting previously unselected package neo4j.
Preparing to unpack .../archives/neo4j_2.2.2_all.deb ...
Unpacking neo4j (2.2.2) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up daemon (0.6.4-1) ...
Setting up neo4j (2.2.2) ...
Adding system user `neo4j' (UID 119) ...
Adding new user `neo4j' (UID 119) with group `nogroup' ...
Not creating home directory `/var/lib/neo4j'.
 Adding system startup for /etc/init.d/neo4j-service ...
   /etc/rc0.d/K20neo4j-service -> ../init.d/neo4j-service
   /etc/rc1.d/K20neo4j-service -> ../init.d/neo4j-service
   /etc/rc6.d/K20neo4j-service -> ../init.d/neo4j-service
   /etc/rc2.d/S20neo4j-service -> ../init.d/neo4j-service
   /etc/rc3.d/S20neo4j-service -> ../init.d/neo4j-service
   /etc/rc4.d/S20neo4j-service -> ../init.d/neo4j-service
   /etc/rc5.d/S20neo4j-service -> ../init.d/neo4j-service
WARNING: Max 1024 open files allowed, minimum of 40 000 recommended. See the Neo4j manual.
Starting Neo4j Server...WARNING: not changing user
process [6662]... waiting for server to be ready........... OK.
http://localhost:7474/ is ready.
Processing triggers for ureadahead (0.100.0-16) ...
ram@ram-pc:~$

ram@ram-pc:~$ sudo service neo4j-service restart
^[[A * Restarting Neo4j Graph Database neo4j                                                                                                    WARNING: Max 1024 open files allowed, minimum of 40 000 recommended. See the Neo4j manual.
Starting Neo4j Server...WARNING: not changing user
process [6914]... waiting for server to be ready...... OK.
http://localhost:7474/ is ready.

ram@ram-pc:~$ service neo4j-service status
 * neo4j is running

ram@ram-pc:~$ neo4j-shell
Welcome to the Neo4j Shell! Enter 'help' for a list of commands
NOTE: Remote Neo4j graph database service 'shell' at port 1337

neo4j-sh (?)$ help
Available commands: alias begin cd commit create cypher dbinfo drop dump env explain export gsh help index jsh load ls man match merge mknode mkrel mv optional paths planner profile pwd return rm rmnode rmrel rollback schema set start trav unwind using with
Use man <command> for info about each command.
neo4j-sh (?)$



Reference:
http://codiply.com/blog/standalone-neo4j-server-setup-on-ubuntu-14-04

Installing Redis on Ubuntu 14.04

ram@ram-pc:~$  sudo add-apt-repository ppa:chris-lea/redis-server
[sudo] password for ram:
 Redis is an open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.
 More info: https://launchpad.net/~chris-lea/+archive/ubuntu/redis-server
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmpydr5ohrk/secring.gpg' created
gpg: keyring `/tmp/tmpydr5ohrk/pubring.gpg' created
gpg: requesting key C7917B12 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpydr5ohrk/trustdb.gpg: trustdb created
gpg: key C7917B12: public key "Launchpad chrislea" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK

ram@ram-pc:~$  sudo apt-get update
Ign http://repo.mongodb.org trusty/mongodb-org/3.0 InRelease
Ign http://extras.ubuntu.com trusty InRelease                                 
Hit http://extras.ubuntu.com trusty Release.gpg                               
Ign http://security.ubuntu.com trusty-security InRelease                      
Ign http://in.archive.ubuntu.com trusty InRelease   
...
...
Ign http://in.archive.ubuntu.com trusty/restricted Translation-en_IN          
Ign http://in.archive.ubuntu.com trusty/universe Translation-en_IN            
Fetched 3,115 kB in 26s (116 kB/s)                                            
Reading package lists... Done

ram@ram-pc:~$  sudo apt-get install redis-server
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following extra packages will be installed:
  libjemalloc1 redis-tools
The following NEW packages will be installed:
  libjemalloc1 redis-server redis-tools
0 upgraded, 3 newly installed, 0 to remove and 297 not upgraded.
Need to get 485 kB of archives.
After this operation, 1,426 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu/ trusty/main libjemalloc1 amd64 3.6.0-1chl1~trusty1 [77.2 kB]
Get:2 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu/ trusty/main redis-tools amd64 3:3.0.2-1chl1~trusty1 [79.7 kB]
Get:3 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu/ trusty/main redis-server amd64 3:3.0.2-1chl1~trusty1 [329 kB]
Fetched 485 kB in 16s (28.6 kB/s)    
Selecting previously unselected package libjemalloc1.
(Reading database ... 169044 files and directories currently installed.)
Preparing to unpack .../libjemalloc1_3.6.0-1chl1~trusty1_amd64.deb ...
Unpacking libjemalloc1 (3.6.0-1chl1~trusty1) ...
Selecting previously unselected package redis-tools.
Preparing to unpack .../redis-tools_3%3a3.0.2-1chl1~trusty1_amd64.deb ...
Unpacking redis-tools (3:3.0.2-1chl1~trusty1) ...
Selecting previously unselected package redis-server.
Preparing to unpack .../redis-server_3%3a3.0.2-1chl1~trusty1_amd64.deb ...
Unpacking redis-server (3:3.0.2-1chl1~trusty1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Setting up libjemalloc1 (3.6.0-1chl1~trusty1) ...
Setting up redis-tools (3:3.0.2-1chl1~trusty1) ...
Setting up redis-server (3:3.0.2-1chl1~trusty1) ...
Starting redis-server: redis-server.
Processing triggers for libc-bin (2.19-0ubuntu6.5) ...
Processing triggers for ureadahead (0.100.0-16) ...
ram@ram-pc:~$

ram@ram-pc:~$ redis-cli ping
PONG

ram@ram-pc:~$ redis-cli
127.0.0.1:6379>

127.0.0.1:6379> shutdown
not connected> exit

ram@ram-pc:~$ sudo service redis-server restart
Stopping redis-server: redis-server.
Starting redis-server: redis-server.
ram@ram-pc:~$

ram@ram-pc:~$ redis-cli INFO
# Server
redis_version:3.0.2
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:9a95cedf214a3630
redis_mode:standalone
os:Linux 3.16.0-30-generic x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.8.2
process_id:5171
run_id:37b0cd8c28fc3303789eac3e2b08b62866a25804
tcp_port:6379
uptime_in_seconds:264
uptime_in_days:0
hz:10
lru_clock:8493856
config_file:/etc/redis/redis.conf

# Clients
connected_clients:1
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0


reference:
http://linuxg.net/how-to-install-redis-server-2-8-17-on-ubuntu-14-04-ubuntu-12-04-and-derivative-systems/


Tuesday, June 16, 2015

Steps To Install MongoDb on Ubuntu 14.04

1.Import the public key used by the package management system. this is
to ensure package consistency and authenticity by requiring that distributors sign packages with GPG keys


ram@ram-pc:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

[sudo] password for ram:
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.T0369j2BIX --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
gpg: requesting key 7F0CEB10 from hkp server keyserver.ubuntu.com
gpg: key 7F0CEB10: public key "Richard Kreuter <richard@10gen.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
ram@ram-pc:~$
 

2. Create a list file for MongoDB.

ram@ram-pc:~$ echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse



3. Reload local package database

ram@ram-pc:~$ sudo apt-get update

4. Install the MongoDB packages.


ram@ram-pc:~$ sudo apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following extra packages will be installed:
  mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
The following NEW packages will be installed:
  mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell
  mongodb-org-tools
0 upgraded, 5 newly installed, 0 to remove and 290 not upgraded.
Need to get 50.7 MB of archives.
After this operation, 157 MB of additional disk space will be used.
Get:1 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.0/multiverse mongodb-org-shell amd64 3.0.4 [4,245 kB]
Get:2 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.0/multiverse mongodb-org-server amd64 3.0.4 [8,607 kB]
Get:3 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.0/multiverse mongodb-org-mongos amd64 3.0.4 [4,029 kB]
Get:4 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.0/multiverse mongodb-org-tools amd64 3.0.4 [33.8 MB]
Get:5 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.0/multiverse mongodb-org amd64 3.0.4 [3,616 B]
Fetched 50.7 MB in 37s (1,355 kB/s)                                           
Selecting previously unselected package mongodb-org-shell.
(Reading database ... 168992 files and directories currently installed.)
Preparing to unpack .../mongodb-org-shell_3.0.4_amd64.deb ...
Unpacking mongodb-org-shell (3.0.4) ...
Selecting previously unselected package mongodb-org-server.
Preparing to unpack .../mongodb-org-server_3.0.4_amd64.deb ...
Unpacking mongodb-org-server (3.0.4) ...
Selecting previously unselected package mongodb-org-mongos.
Preparing to unpack .../mongodb-org-mongos_3.0.4_amd64.deb ...
Unpacking mongodb-org-mongos (3.0.4) ...
Selecting previously unselected package mongodb-org-tools.
Preparing to unpack .../mongodb-org-tools_3.0.4_amd64.deb ...
Unpacking mongodb-org-tools (3.0.4) ...
Selecting previously unselected package mongodb-org.
Preparing to unpack .../mongodb-org_3.0.4_amd64.deb ...
Unpacking mongodb-org (3.0.4) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Setting up mongodb-org-shell (3.0.4) ...
Setting up mongodb-org-server (3.0.4) ...
Adding system user `mongodb' (UID 117) ...
Adding new user `mongodb' (UID 117) with group `nogroup' ...
Not creating home directory `/home/mongodb'.
Adding group `mongodb' (GID 125) ...
Done.
Adding user `mongodb' to group `mongodb' ...
Adding user mongodb to group mongodb
Done.
mongod start/running, process 3003
Setting up mongodb-org-mongos (3.0.4) ...
Setting up mongodb-org-tools (3.0.4) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up mongodb-org (3.0.4) ...
5. Install the latest stable version of MongoDB.

ram@ram-pc:~$ sudo apt-get install -y mongodb-org=3.0.4 mongodb-org-server=3.0.4 mongodb-org-shell=3.0.4 mongodb-org-mongos=3.0.4 mongodb-org-tools=3.0.4

Reading package lists... Done
Building dependency tree      
Reading state information... Done
mongodb-org is already the newest version.
mongodb-org-mongos is already the newest version.
mongodb-org-mongos set to manually installed.
mongodb-org-server is already the newest version.
mongodb-org-server set to manually installed.
mongodb-org-shell is already the newest version.
mongodb-org-shell set to manually installed.
mongodb-org-tools is already the newest version.
mongodb-org-tools set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 290 not upgraded.

6. Start mongodb service

ram@ram-pc:~$ sudo service mongod start
start: Job is already running: mongod

6. Connect mongo shell



ram@ram-pc:~$ mongo
MongoDB shell version: 3.0.4
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
    http://docs.mongodb.org/
Questions? Try the support group
    http://groups.google.com/group/mongodb-user
Server has startup warnings:
2015-06-16T22:08:48.583+0530 I CONTROL  [initandlisten]
2015-06-16T22:08:48.583+0530 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2015-06-16T22:08:48.583+0530 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2015-06-16T22:08:48.583+0530 I CONTROL  [initandlisten]
2015-06-16T22:08:48.583+0530 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2015-06-16T22:08:48.583+0530 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2015-06-16T22:08:48.583+0530 I CONTROL  [initandlisten]
>


Source/Reference:
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
http://docs.mongodb.org/getting-started/shell/client/

Monday, June 15, 2015

Steps To Install Cassandra on Ubuntu 14.04

1. make sure  Java is installed

sudo apt-get update
apt-get install openjdk-7-jdk
java -version

2. Download Cassandra binaries and extract them

cd ~/Downloads
wget http://www.us.apache.org/dist/cassandra/2.1.4/apache-cassandra-2.1.4-bin.tar.gz
tar -xvzf apache-cassandra-2.1.4-bin.tar.gz
mkdir ~/cassandra
mv apache-cassandra-1.2.4 ~/cassandra

3. create data directories

sudo mkdir /var/lib/cassandra
sudo mkdir /var/log/cassandra
sudo chown -R ram /var/lib/cassandra
sudo chown -R ram /var/log/cassandra

4. update .bashrc (gedit .bashrc)
export CASSANDRA_HOME=~/cassandra
export PATH=$PATH:$CASSANDRA_HOME/andra/bin

5. run below command to make the latest paths effective
source .bashrc

6. start Cassandra service
sudo sh ~/cassandra/andra/bin/cassandra


7. Connect Cassandra thru cli
ram@ram-pc:~$ cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 2.1.4 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh>


reference:
http://idroot.net/tutorials/how-to-install-apache-cassandra-on-ubuntu-14-04/