How to Create an NFS Mount Point on CentOS 6.4

Published on:
Tags:

This is the instruction to create a mount point on CentOS 6.4

Reference
NFSv4Howto

On a server

  1. Check if nfs is installed

     $ rpm -qa | grep nfs  
     $ service nfs status`
    
  2. Add a mount point

     $ vi /etc/exports
    

In the above line, is replaced by the directory to be exported, is the name or IP address of the system to which access is being granted and represents the restrictions that are to be imposed on that access (read only, read write etc).

format: <export> <host1>(<options>) <host2>(<options>)…

example:
/datafiles 192.168.2.38(ro)
/home/demo (rw)
/tmp
(rw,sync)
/vol1 192.168.2.21(ro,sync)

  1. The directories must be exported.

     $ exportfs -a
    

    To view exported file system

     $ exportfs
    
  2. Turn on nfs at start up

     $ chkconfig nfs on
     $ chkconfig --list nfs
     $ service nfs start
    

Note: for each options available, read this link

On a client

  1. Make a local folder

     $ mkdir /myfolder
    
  2. Issue this command

     $ sudo mount -t nfs -v [ip or hostname]:/myfolder /myfolder
    

Troubleshooting

  • Most of the time, keep an eye on /var/log/message. This is a typical error when nfs rejects a client connect

      rpc.mountd[30666]: refused mount request from x.x.x.x for /ster_storage (/ster_storage): illegal port 64877
    

    it’s because it can’t resolve name of the client connected to it. NFS typically wants name resolution for clients connecting to it, and if it can’t get that, then it will deny access.

    An entry in the hosts file is usually sufficient for me.

  • Check with firewall and SELinux

      $ iptables -L  
      $ getenforce  
    
  • On Mac client, it connects to NFS using insecure port. Using the insecure option allows clients such as Mac OS X to connect on insecure ports. link

      rpc.mountd[31257]: authenticated mount request from x.x.x.x:1017 for /foster_storage (/foster_storage)
    
    
      $ vi /etc/exports
      /datafiles 192.168.0.0/16(ro,insecure)
    

Working With MySQL User Privileges

Published on:
Tags:

Allow non localhost db user to connect

  1. allow binding from other hosts other than localhost

     vi /etc/mysql/my.cnf
       remove bind-address = 127.0.0.1
    
  2. check and see the current privileges on hosts

     mysql> use mysql;
     mysql> select * from user;
       see if there is host = localhost and user = root which will not allow non localhost to access
    
  3. grant the user with % (all hosts)

     mysql> GRANT ALL ON *.* TO root@'%' IDENTIFIED BY '[password same as root@local e.g. 5678
     # e.g. GRANT ALL ON *.* TO root@'%' IDENTIFIED BY '5678';
    
     mysql> (optional) delete from user where host = 'localhost' and user = 'root';
     mysql> flush privileges;
    

Create a new user

  1. create a user

     mysql> CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypass';
     mysql> CREATE USER 'myuser'@'%' IDENTIFIED BY 'mypass';
    
  2. grant all privileges

     mysql> GRANT ALL ON *.* TO 'myuser'@'localhost';
     mysql> GRANT ALL ON *.* TO 'myuser'@'%';
    

or grant just enough

    mysql> GRANT DELETE,INSERT,SELECT,UPDATE on mydatabase.* TO 'myuser'@'localhost';       
    mysql> flush privileges;
  1. to see the privileges

     mysql> SHOW GRANTS FOR mysql;
    

The Problem With Pingdom

Published on:
Tags: uptime
Time to be Awesome - awesome.rb
1
puts "Awesome!" unless lame

The problem with pingdom.

My money’s in that office, right? If she start giving me some bullshit about it ain’t there, and we got to go someplace else and get it, I’m gonna shoot you in the head then and there. Then I’m gonna shoot that bitch in the kneecaps, find out where my goddamn money is. She gonna tell me too. Hey, look at me when I’m talking to you, motherfucker. You listen: we go in there, and that nigga Winston or anybody else is in there, you the first motherfucker to get shot. You understand?

Blockquote is what goes inside this block here would you believe that bullshit?

Well, the way they make shows is, they make one show. That show’s called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they’re going to make more shows. Some pilots get picked and become television programs. Some don’t, become nothing. She starred in one of the ones that became nothing.

The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother’s keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee.

Your bones don’t break, mine do. That’s clear. Your cells react to bacteria and viruses differently than mine. You don’t get sick, I do. That’s also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We’re on the same curve, just on opposite ends.

Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that’s what you see at a toy store. And you must think you’re in a toy store, because you’re here shopping for an infant named Jeb.

Intro

Published on:
Tags: self

Testing!

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis sollicitudin, massa eu vestibulum laoreet, nibh ante vulputate lorem, ac lobortis ante tellus eu mi. Duis sem nisi, luctus at feugiat eget, fringilla ut tellus. Nam a molestie justo. Sed pulvinar est vitae tellus semper tincidunt. Fusce euismod luctus lacus nec placerat. Mauris rutrum scelerisque nulla ut tempor. Nunc porttitor posuere mi, aliquet vehicula lorem feugiat in. Ut ut fermentum risus. Aliquam tincidunt ultricies ante sit amet bibendum. Cras nec sapien odio. Duis posuere congue sem, at congue massa faucibus at.

Integer ut sapien eget nisl auctor faucibus ut fermentum arcu. Nunc rutrum urna non risus congue et tristique felis eleifend. Maecenas blandit est eu mauris aliquam aliquet. Quisque porttitor enim eget risus blandit in mollis orci eleifend. Nam malesuada nulla sed lacus elementum placerat accumsan arcu rhoncus. Phasellus feugiat cursus turpis nec facilisis. Duis eget metus arcu, eget commodo velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Integer cursus vulputate enim, vel gravida velit faucibus et. Ut a urna vitae tellus cursus rhoncus. Maecenas at odio eget quam cursus elementum. Aliquam vitae eros quis tellus laoreet accumsan sed id lorem. Suspendisse et rutrum leo. Integer scelerisque vestibulum adipiscing. In posuere, libero ac accumsan suscipit, nulla ligula gravida erat, ut tempor odio erat nec sem. Quisque justo ipsum, adipiscing volutpat varius vitae, blandit eget nisi.

Nullam adipiscing neque ac lacus commodo vitae imperdiet dui sollicitudin. Ut ac nunc augue. Nam at sem ut quam commodo aliquet vitae vitae dui. Vivamus scelerisque felis eget dolor cursus feugiat. Phasellus at dui sed lectus scelerisque pretium. Etiam nec massa ut justo vestibulum fringilla ac vitae urna. Morbi tortor erat, tempus sed consectetur at, elementum nec eros. Vivamus mattis arcu a sapien semper non lacinia eros pretium.

Proin ut hendrerit arcu. Maecenas ullamcorper tristique magna vel mattis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam tincidunt euismod viverra. In sit amet neque turpis. Suspendisse ac sapien mi, id blandit purus. Ut tortor turpis, rutrum ac tempor at, accumsan sit amet erat. Etiam ultricies eleifend dolor, eget tempus justo tristique vitae. In hac habitasse platea dictumst. Aliquam eu enim neque.

Morbi massa lorem, viverra non dictum at, malesuada vel nibh. Nam fermentum lobortis varius. Sed a nulla lacus, quis posuere risus. Nunc id urna libero, quis rutrum mi. In gravida felis urna. Praesent nec dolor ac urna tempor fermentum. Curabitur rutrum arcu et lorem volutpat viverra.