专用 CoreNLP 服务器控制问题 [英] Dedicated CoreNLP Server Control Issues

查看:55
本文介绍了专用 CoreNLP 服务器控制问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:如何确认我的专用服务器"是否正常运行?

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

背景:我正在努力让专用 CoreNLP 服务器"在独立 Linux 系统上运行.这个系统是一台运行 CentOS 7 的笔记本电脑.选择这个操作系统是因为 Dedicated CoreNLP服务器特别声明它们适用于 CentOS.

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.

我已按照专用 CoreNLP 服务器的说明逐步操作(概述如下):

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

  1. 从斯坦福 CoreNLP 网站(而非 GitHub)下载 CoreNLP 3.7.0 并将其放置/提取到 /opt/corenlp 文件夹.
  2. 安装 authbind 并创建一个名为 'nlp' 的具有超级用户权限的用户并将其绑定到端口 80

  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

将启动脚本从路径 edu/stanford/nlp/pipeline/demo/corenlp 的源 jar 复制到 /etc/init.d/corenlp

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

赋予启动脚本可执行权限:sudo chmod a+x/etc/init.d/corenlp

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

将脚本链接到/etc/rc.d/:ln -s/etc/init.d/corenlp/etc/rc.d/rc2.d/S75corenlp

完成这些步骤应该允许我运行命令 sudo service corenlp start 以运行专用服务器.当我在终端中运行此命令时,我得到输出CoreNLP 服务器已启动",它IS 与启动脚本corenlp"一致.然后我再次运行启动命令并得到相同的响应,这与启动脚本不一致.据我所知,如果服务器实际上正在运行并且我尝试再次启动它,我应该收到消息CoreNLP 服务器已经在运行!"这让我相信我的服务器实际上并没有按预期运行.

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.

这个命令是否正确启动了服务器?我怎么知道?

由于正确"命令没有像我想象的那样运行,我使用了命令 sudo systemctl *start* corenlp.service 并使用 sudo systemctl *status 检查了服务的状态* corenlp.service.我不确定这是否是启动和停止专用 CoreNLP 服务器"的合适方式,但我可以控制该服务.我只是不知道我是否真的在启动和停止我的专用服务器.

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.

我可以使用systemctl命令来操作我的Dedicated CoreNLP Server吗?

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

推荐答案

请阅读最初发布的问题下方的评论.这是@GaborAngeli 和我之间的来回,导致我的问题/问题得到解决.

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.

在遵循斯坦福 CoreNLP 网页上概述的有关如何设置专用服务器的所有说明后,为了在我的机器上本地运行 CoreNLP 服务器的实例化,我采取的两个关键步骤如下:

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. 对corenlp"启动脚本做了两处修改.(1) 将 sudo 添加到开头,因为用户nlp"需要系统上某些文件的权限 (2) 将第一个文件夹路径从/usr/local/bin/authbind 更改为/usr/bin/authbind.authbind 安装必须在编写启动脚本后发生变化.

  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"

如果您尝试使用上述更改启动服务器,您将无法成功运行服务器,因为使用 sudo 需要输入密码.为了在不需要密码输入的情况下允许 sudo 权限,您需要编辑 sudoers 文件(我在 root 用户 b/c 下进行了此操作,您需要更改甚至查看此文档的权限).我的 sudoers 文件位于/etc 中.有一个部分说 ## 允许人们在组轮中运行所有命令,下面是一个部分,上面写着 ##Same thing without password.您只需要删除下一行前面的注释标记 (#) 形式,该行表示 %wheel ALL+(ALL) NOPASSWD: ALL.保存此文件.请谨慎编辑此文件,因为它可能会导致严重问题.仅进行上述必要的更改

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

这两个步骤使我能够成功运行我的专用服务器.我的系统在 CentOS 7 上运行.

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

有用的提示:从我与@GaborAngeli 的讨论中,我了解到在corenlp"文件夹中(如果您正确地按照说明操作,则为/opt/corenlp)您可以打开 stderr.log 文件以帮助您解决服务器问题.如果您要在命令窗口中运行服务器,这将输出您将看到的内容.如果有错误也会在这里输出,非常有帮助.

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.

这篇关于专用 CoreNLP 服务器控制问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆