Skip to content
Advertisement

Dedicated CoreNLP Server Control Issues

Question: How can I confirm whether or not my “Dedicated Server” is running properly?

Background: I am working to get a ‘Dedicated CoreNLP Server’ running on a stand-alone Linux system. This system is a laptop running CentOS 7. This OS was chosen because the directions for a Dedicated CoreNLP Server specifically state that they apply to CentOS.

I have followed the directions for the Dedicated CoreNLP Server step-by-step (outlined below):

  1. Downloaded CoreNLP 3.7.0 from the Stanford CoreNLP website (not GitHub) and placed/extracted it into the /opt/corenlp folder.
  2. Installed authbind and created a user called ‘nlp’ with super user privileges and bind it to port 80

    sudo mkdir -p /etc/authbind/byport/

    sudo touch /etc/authbind/byport/80

    sudo chown nlp:nlp /etc/authbind/byport/80

    sudo chmod 600 /etc/authbind/byport/80

  3. Copy the startup script from the source jar at path edu/stanford/nlp/pipeline/demo/corenlp to /etc/init.d/corenlp

  4. Give executable permissions to the startup script: sudo chmod a+x /etc/init.d/corenlp

  5. Link the script to /etc/rc.d/: ln -s /etc/init.d/corenlp /etc/rc.d/rc2.d/S75corenlp

Completing these steps is supposed to allow me to run the command sudo service corenlp start in order to run the dedicated server. When I run this command in the terminal I get the output “CoreNLP server started” which IS consistent with the the start up script “corenlp”. I then run the start command again and get this same response, which is NOT consistent with the start up script. From what I can tell, if the server is actually running and I try to start it again I should get the message “CoreNLP server is already running!” This leads me to believe that my server is not actually functioning as it is intended to.

Is this command properly starting the server? How can I tell?

Since the “proper” command was not functioning as I thought it should, I used the command sudo systemctl *start* corenlp.service and checked the service’s status with sudo systemctl *status* corenlp.service. I am not sure if this is an appropriate way in which to start and stop a ‘Dedicated CoreNLP Server’ but I can control the service. I just do not know if I am actually starting and stopping my dedicated server.

Can I use systemctl command to operate my Dedicated CoreNLP Server?

Advertisement

Answer

Please read the comments below the originally posted question. This was the back and forth between @GaborAngeli and myself which lead my question/problem being solved.

The two critical steps I took in order to get my instantiation of the CoreNLP server running locally on my machine after following all the directions on how to setup a dedicated server, which are outlined on Stanford CoreNLP’s webpage, are as follows:

  1. Made two modifications to the “corenlp” start-up script. (1) added sudo to the beginning because the user “nlp” needs permissions to certain files on the system (2) changed the first folder path from /usr/local/bin/authbind to /usr/bin/authbind. authbind installation must’ve changed since the start up script was written.

    nohup su "$SERVER_USER" -c "sudo /usr/bin/authbind --deep java -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir_"$CORENLP_DIR" -cp "$CLASSPATH" -mx15g edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 80"

  2. If you were to attempt to start the server with the change above you would not successfully run server because sudo usage requires a password input. In order to allow sudo privileges without a required password entry you need to edit the sudoers file (I did this under the root user b/c you need permissions to change or even view this document). my sudoers file was located in /etc. There is a part that says ## Allows people in group wheel to run all commands and below that is a section that says ##Same thing without a password. You just need to remove the comment mark (#) form in front of the next line which says %wheel ALL+(ALL) NOPASSWD: ALL. Save this file. BE CAREFUL IN EDITING THIS FILE AS IT MAY CAUSE SERIOUS ISSUES. MAKE ONLY THE NECESSARY CHANGE OUTLINED ABOVE

Those two steps allowed me to successfully run my dedicated server. My system runs on CentOS 7.

HELPFUL TIP: From my discussion with @GaborAngeli I learned that within the ‘corenlp’ folder (/opt/corenlp if you followed the directions correctly) you can open the stderr.log file to help you in trouble shooting your server. This outputs what you would see if you were to run the server in the command window. If there is an error it is output here too, which is extremely helpful.

Advertisement