mount.nfs: access denied by server while mounting in Ubuntu Machine?

937

change your /etc/exports from

/opt/exhibitor/conf/     10.108.24.*(rw)

to

/opt/exhibitor/conf/     10.108.24.0/24(rw)
Share:
937

Related videos on Youtube

Koustav
Author by

Koustav

Updated on September 18, 2022

Comments

  • Koustav
    Koustav over 1 year

    Find the total number of visits of the bird Cranes?

    Program:

    import pandas as pd
    import numpy as np
    
    df = pd.DataFrame({'birds': ['Cranes', 'Cranes', 'plovers', 'spoonbills', 'spoonbills', 'Cranes', 'plovers', 'Cranes', 'spoonbills', 'spoonbills'], 'age': [3.5, 4, 1.5, np.nan, 6, 3, 5.5, np.nan, 8, 4], 'visits': [2, 4, 3, 4, 3, 4, 2, 2, 3, 2], 'priority': ['yes', 'yes', 'no', 'yes', 'no', 'no', 'no', 'yes', 'no', 'no']})
    
    g=df.groupby(['birds','visits']).sum()
    g
    

    OUTPUT:

            age
    birds   visits  
    Cranes     2    3.5
               4    7.0
    plovers    2    5.5
               3    1.5
    spoonbills 2    4.0
               3    14.0
               4    0.0
    

    Desired Output:

    birds   visits
    Cranes    2
    Cranes    4
    Cranes    4
    Cranes    2
    Total    12
    

    Also let me know how to remove the age column which is coming?

    If i try using groupby also other columns are coming and the result is not clear

    • Michael Hampton
      Michael Hampton over 10 years
      Check the logs on the NFS server for clues.
    • AKIWEB
      AKIWEB over 10 years
      @MichaelHampton: Thanks for suggestion. Can you tell me where I can find the logs for NFS? And also did my exports file looks good?
    • AKIWEB
      AKIWEB over 10 years
      And also, do we need to start something related with NFS? I just installed the NFS server like this sudo apt-get install nfs-common nfs-kernel-server and after that I didn't do anything..
    • Koustav
      Koustav almost 5 years
      import pandas as pd import numpy as np df = pd.DataFrame({'birds': ['Cranes', 'Cranes', 'plovers', 'spoonbills', 'spoonbills', 'Cranes', 'plovers', 'Cranes', 'spoonbills', 'spoonbills'], 'age': [3.5, 4, 1.5, np.nan, 6, 3, 5.5, np.nan, 8, 4], 'visits': [2, 4, 3, 4, 3, 4, 2, 2, 3, 2], 'priority': ['yes', 'yes', 'no', 'yes', 'no', 'no', 'no', 'yes', 'no', 'no']}) g=df.groupby(['birds']).sum() g['visits']
    • cs95
      cs95 almost 5 years
      You've actually asked two questions so I've posted two links for you to read. Also, groupby is quite far from what you need to do.
    • cs95
      cs95 almost 5 years
      @jezrael It smelled like homework and they seem to have no idea what they are doing. Rather than answer it I would close it and direct them to links to read. Looks like we share different opinions on the matter, unfortunately...
  • AKIWEB
    AKIWEB over 10 years
    Thanks for suggestion. I have also tried from machineB as well and I got same error. Is there any way I can see the logs? If yes, then what's the path?
  • AKIWEB
    AKIWEB over 10 years
    And also did my exports file looks good? I have the same content in all the three machines.
  • AKIWEB
    AKIWEB over 10 years
    And also, do we need to start something related with NFS? I just installed the NFS server like this sudo apt-get install nfs-common nfs-kernel-server and after that I didn't do anything..
  • AKIWEB
    AKIWEB over 10 years
    Can you explain me what does second line mean here? And should I use this line /opt/exhibitor/conf/ 10.108.24.0/24(rw) in all the three machines /etc/exports?
  • Danielle
    Danielle over 10 years
    It means you advertise your nfs share to 10.108.24.0/24 network and allowing client from the same network to access the folder. You only use this line on your nfs server. So, if all the three machine are the nfs server, then you have to put in all the machine.
  • AKIWEB
    AKIWEB over 10 years
    Ok.. Now when I did this after making the change in export file root@machineB:/# sudo mount -t nfs 10.108.24.132:/opt/exhibitor/conf /opt/exhibitor/conf/ from machineB, it worked fine and I didn't got any error. But now how to check whether the mount got created properly or not?
  • Danielle
    Danielle over 10 years
    type 'mount' in terminal machineB, or you can create a file some file in machineA, if it is properly created you should be able to see the same in machineB
  • AKIWEB
    AKIWEB over 10 years
    Yup. It works fine. I created a file in machineA and I can see those files in machineB and machineC as well. Thanks for the help.. One last thing, as you can see in my question, I am not using fstab file here so whenever my machine gets restarted up, all the mount will be gone.. So I am not sure, in my case what I am supposed to add in fstab file. Any idea how that will work out?
  • Lawrence
    Lawrence over 10 years
    samba is totally different to NFS. NFS doesn't require username / password as it works off the linux uid/gid
  • Danielle
    Danielle over 10 years
    you can put this line in your fstab "10.108.24.132:/opt/exhibitor/conf /opt/exhibitor/conf nfs auto 0 0"
  • AKIWEB
    AKIWEB over 10 years
    Ok.. I added the same exact line as you have mentioned. Now I am having very strange issue. I deleted that file from machineA and after deleting that file, I went back to machineB and machineC and I did ls, the whole system got hanged and even ctrl+c was not taking me out. So I close those machineB and machineC and opened again. And after that, I tried doing cd /opt/exhibitor/conf but it is getting hanged at cd /opt/exhibitor/c. Any idea what is causing the problem?
  • AKIWEB
    AKIWEB over 10 years
  • Koustav
    Koustav almost 5 years
    OUTPUT: birds Cranes 12 plovers 5 spoonbills 12 Name: visits, dtype: int64
  • jezrael
    jezrael almost 5 years
    If need birds visits Cranes 2 Cranes 4 Cranes 4 Cranes 2 Total 12 like mentioned in question, it is not correct.
  • Koustav
    Koustav almost 5 years
    It is to find the total no of Cranes,however i found the total no of all kinds of birds but not Cranes in particular. Please let me know how to find the sum of only Cranes row and also show if we want to create a new row Total and store the sum there.