Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Tutorial: Unable to start ambari service and sandbox,Learning from tutorial: Unable to check/start ambari-server, permission issue

Highlighted

Tutorial: Unable to start ambari service and sandbox,Learning from tutorial: Unable to check/start ambari-server, permission issue

New Contributor

I am following the tutorial: https://hortonworks.com/tutorial/realtime-event-processing-in-hadoop-with-nifi-kafka-and-storm/secti...

Based on initial requirements, I have download the sandbox: HDF_3.0.2.0_vmware_28_11_2017.ova

When I started the VM, I got the host and IP for Welcome screen and SSH terminal (Untitled.png).

I registered the host in my windows hosts file.

I am able to open the SSH terminal (on Gitbash and chrome both) and change the root password successfully.

I am also able to go to the Welcome screen. When I click on Dashboard, it opens 2 tabs. 1 tab is for tutorial which is working fine.

Another tab is for Ambari dashboard, which cannot be opened. It is giving me "refuse to connect" error.

When I go to SSH terminal and try to check status or start ambari service I receive following error.

[root@sandbox-hdf ~]# ambari-server status
Using python  /usr/bin/python
Ambari-server status
Traceback (most recent call last):
  File "/usr/sbin/ambari-server.py", line 36, in <module>
    from ambari_server.dbConfiguration import DATABASE_NAMES, LINUX_DBMS_KEYS_LIST
  File "/usr/lib/python2.6/site-packages/ambari_server/dbConfiguration.py", line 28, in <module>
    from ambari_server.serverConfiguration import decrypt_password_for_alias, get_ambari_properties, get_is_secure, \
  File "/usr/lib/python2.6/site-packages/ambari_server/serverConfiguration.py", line 593, in <module>
    configDefaults = ServerConfigDefaults()
  File "/usr/lib/python2.6/site-packages/ambari_server/serverConfiguration.py", line 503, in __init__
    super(ServerConfigDefaultsLinux, self).__init__()
  File "/usr/lib/python2.6/site-packages/ambari_server/serverConfiguration.py", line 387, in __init__
    self.check_if_directories_writable([self.OUT_DIR, self.PID_DIR])
  File "/usr/lib/python2.6/site-packages/ambari_server/serverConfiguration.py", line 439, in check_if_directories_writable
    raise FatalException(-1, "Unable to access {0} directory. Confirm the directory is created and is writable by Ambari Server user account '{1}'".format(directory, getpass.getuser()))
ambari_commons.exceptions.FatalException: "Fatal exception: Unable to access  directory. Confirm the directory is created and is writable by Ambari Server user account 'root', exit code -1" 

[root@sandbox-hdf ~]# ambari-server start
Using python  /usr/bin/python
Starting ambari-server
Traceback (most recent call last):
  File "/usr/sbin/ambari-server.py", line 36, in <module>
    from ambari_server.dbConfiguration import DATABASE_NAMES, LINUX_DBMS_KEYS_LIST
  File "/usr/lib/python2.6/site-packages/ambari_server/dbConfiguration.py", line 28, in <module>
    from ambari_server.serverConfiguration import decrypt_password_for_alias, get_ambari_properties, get_is_secure, \
  File "/usr/lib/python2.6/site-packages/ambari_server/serverConfiguration.py", line 593, in <module>
    configDefaults = ServerConfigDefaults()
  File "/usr/lib/python2.6/site-packages/ambari_server/serverConfiguration.py", line 503, in __init__
    super(ServerConfigDefaultsLinux, self).__init__()
  File "/usr/lib/python2.6/site-packages/ambari_server/serverConfiguration.py", line 387, in __init__
    self.check_if_directories_writable([self.OUT_DIR, self.PID_DIR])
  File "/usr/lib/python2.6/site-packages/ambari_server/serverConfiguration.py", line 439, in check_if_directories_writable
    raise FatalException(-1, "Unable to access {0} directory. Confirm the directory is created and is writable by Ambari Server user account '{1}'".format(directory, getpass.getuser()))
ambari_commons.exceptions.FatalException: "Fatal exception: Unable to access  directory. Confirm the directory is created and is writable by Ambari Server user account 'root', exit code -1"
[root@sandbox-hdf ~]#

- Why root user is having permission issues on machine?

- What is required to start and run ambari service and its dashboard?

Anything I am missing?


untitled.png
4 REPLIES 4
Highlighted

Re: Tutorial: Unable to start ambari service and sandbox,Learning from tutorial: Unable to check/start ambari-server, permission issue

Super Mentor

@Mihir Kothari

Please let us know if you are trying to start ambari server with Non-Root user account?

If yes, then while starting ambari server using non-root user account you must give the proper WRITE permission for that user to withe to "/var/run/ambari-server".

So please check the permission on the "/var/run/ambari-server" directory and make sure that the user who is starting the ambari server process has WRITE access to that directory. Suppose if your username is "xyz" then

Change the ownership of directory "/var/run/ambari-server" as following:

# chown xyz:hadoop /var/run/ambari-server 


Then try to restart the ambari server.

If it does not work then can you please share the ambari.properties file OR the output of the following command:

# grep 'ambari-server.user'  /etc/ambari-server/conf/ambari.properties
ambari-server.user=root

.

NOTE: Which port are you using to connect to your HDF Sandbox using SSH ? Please refer to the following HCC thread to know which port is supposed to be used else few services might not start properly if you try to use the default SSH port to connect to HDF Sandbox.

# ssh root@127.0.0.1 -p 12222

https://community.hortonworks.com/questions/103790/hdf-sandbox-strange-issue.html

Re: Tutorial: Unable to start ambari service and sandbox,Learning from tutorial: Unable to check/start ambari-server, permission issue

@Mihir Kothari I'm a bit late to this thread, but let me try and reproduce this and I'll report back!

Highlighted

Re: Tutorial: Unable to start ambari service and sandbox,Learning from tutorial: Unable to check/start ambari-server, permission issue

New Contributor

Hi,

Sorry for late response, held up in other work and will start the tutorial again later.

However,

"Please let us know if you are trying to start ambari server with Non-Root user account?" - No, I am using root to start and also to check the status. The error mentioned above is on issue of status or start command.

[root@sandbox-hdf ~]# ambari-server status

In fact I am unable to find the directory "/var/run/ambari-server".

I am using the port mentioned while I start the VM. I believe the start up page is displayed correctly so no issue there. But I will try to check further later.

Thanks.

Highlighted

Re: Tutorial: Unable to start ambari service and sandbox,Learning from tutorial: Unable to check/start ambari-server, permission issue

Super Mentor

@Mihir Kothari

Please try creating the following directory on your own to see if it helps?

# ls -ld /var/run/ambari-server
drwxr-xr-x. 4 root root 100 Jan  2 06:00 /var/run/ambari-server

.

Don't have an account?
Coming from Hortonworks? Activate your account here