Friday, June 5, 2015

Remove Non breaking space in data - Pentaho ETL

We often face a problem called "Non breaking Space" which is a common special character like space and other examples.

We can remove spaces by using TRIM function and in Pentaho ETL we have option to TRIM on both sides as well.

But this non breaking space is different kind of problem where TRIM function will never removes it.

For that we have to use a regular expression to remove "Non breaking space" in the data.

Using "Replace in String" step that is available in Pentaho use    \xA0 as a regular expression and then replace with non. it should be some thing like below image.  And all non breaking spaces in your data will be removed.




MongoDB server Failed to start : Detected unclean shutdown - /var/lib/mongo/mongod.lock is not empty

If you are unable to start the MongoDB server and getting below kind of error then the solution will here.


Simply delete the file mongod.lock that is available in the specified path and try to restart the server by executing the below command:

                                               #sudo service mongod start


Error Code:

2015-06-05T01:54:42.164-0700 I JOURNAL  [journal writer] Journal writer thread started
2015-06-05T01:54:42.552-0700 I NETWORK  [initandlisten] waiting for connections on port 27017
2015-06-05T02:04:07.193-0700 I CONTROL  ***** SERVER RESTARTED *****
2015-06-05T02:04:07.279-0700 E NETWORK  [initandlisten] listen(): bind() failed errno:98 Address already in use for socket:127.0.0.1:27017
2015-06-05T02:04:07.279-0700 E NETWORK  [initandlisten]   addr already in use
2015-06-05T02:04:07.281-0700 W -        [initandlisten] Detected unclean shutdown - /var/lib/mongo/mongod.lock is not empty.
2015-06-05T02:04:09.673-0700 I STORAGE  [initandlisten] exception in initAndListen: 98 Unable to lock file: /var/lib/mongo/mongod.lock errno:11 Resource temporarily unavailable. Is a mongod instance already running?, terminating

Wednesday, June 3, 2015

Data warehouse - Concepts - Part I


Here in this section, I am going to give a very brief explanation about few regular terms. Later I will cover Star schema and snow flake schema and slowly changing dimensions as well.

Dimension:
         Dimensions provide the "Who When What Why How " context in the surroundings of a business process event.

Fact:
        Facts are the measurements that result from a business process event and facts are almost always numeric.

Dimension table:
        Dimension table stores attributes or dimensions that describe the objects in the fact table.

Fact Table:
        Fact table contains the numeric measures produced by an operational measurement event in the real world.
             

Tuesday, June 2, 2015

How to Install MongoDB on CentoOS 6 (Redhat)

                                         STEPS TO INSTALL MONGODB

MongoDB is an open-source document database, and leading NoSQL database. MongoDB is written in C++.

MongoDB is a cross-platform, document oriented database that provides, high performance, high availability, and easy scalability. MongoDB works on concept of collection and document.


STEP1:  Add MongoDB Yum Repositiry, to do this enter the below command at your shell terminal.



STEP2: Now add the following content in the file that you just created. If it is 64 bit only.


STEP3:  Now we execute a simple command to install MongoDB on our machine.

                             #  yum install mongodb-org

After installation your window will look like below image.




STEP4: Now to start the server, enter the below command. And do not forget about the owner, file, group permissions. Once you start the server it  should looks like below image.


If your server is not starting means, mostly it would be with file permissions only. Do remember that log files will be located at /var/log/mongod/ folder.

configuration file will be at /etc/mongod.conf

In this file you will also get where dbpath located.