我用下面的脚本安装了厨师服务器。 我是新来的Linux和我试图学习如何设置厨师服务器。 我运行chef.io提供的命令,脚本成功。 我真的不知道如何检查,或者我该怎么做来检查过程是否正在运行。 有关如何查看进程是否正在运行的Linux的最佳做法是什么? 我能做些什么来找出我需要知道的东西?
#!/bin/bash echo "Do your provisioning here" sudo wget https://packages.chef.io/files/stable/chef-server/12.14.0/el/7/chef-server-core-12.14.0-1.el7.x86_64.rpm sudo chmod a+x chef-server-core-12.14.0-1.el7.x86_64.rpm sudo rpm -Uvh ./chef-server-core-12.14.0-1.el7.x86_64.rpm sudo chef-server-ctl reconfigure sudo openssl rsa -in private.pem -outform PEM -pubout -out ~/.ssh/chef-server.pem sudo chef-server-ctl user-create admin 'admin' 'email' 'password' --filename ~/.ssh/chef-server.pem sudo openssl rsa -in private.pem -outform PEM -pubout -out ~/.ssh/chef-server-validator.pem sudo chef-server-ctl org-create short_name 'idevops' --association_user admin --filename ~/.ssh/chef-server-validator.pem sudo openssl rsa -in private.pem -outform PEM -pubout -out ~/.ssh/chef-coffee-server-validator.pem sudo chef-server-ctl org-create 4thcoffee 'iDevops 4th Coffee' --association_user admin --filename ~/.ssh/chef-coffee-server-validator.pem sudo chef-server-ctl install chef-manage sudo chef-server-ctl reconfigure sudo chef-manage-ctl reconfigure sudo chef-server-ctl install opscode-push-jobs-server sudo chef-server-ctl reconfigure sudo opscode-push-jobs-server-ctl reconfigure sudo chef-server-ctl install opscode-reporting sudo chef-server-ctl reconfigure sudo opscode-reporting-ctl reconfigure sudo chef-server-ctl install PACKAGE_NAME --path /path/to/package/directory sudo chef-server-ctl install chef-manage --path /root/packages sudo mkdir /etc/opscode && sudo touch /etc/opscode/chef-server.rb sudo echo "license['nodes'] = 0" >> /etc/opscode/chef-server.rb sudo chef-server-ctl reconfigure
与Serverspec(rspec)匹配确切的string
如何像某个用户一样运行厨师资源
chef-recipe ArgumentError未知指令:“ n”
使用厨师时,主pipe打开文件限制不会改变
如何通过厨师更新Nginx
您发布的输出中有一个相对较大的提示(例如chef-server-ctl status ),
The status subcommand is used to show the status of all services available to the Chef server. The results will vary based on the configuration of a given server.
或者, chef-server-ctl status SERVICE_NAME
where SERVICE_NAME represents the name of any service that is listed after running the service-list subcommand.
另请参阅chef-server-ctl(可执行文件)处的start子命令(朝向页面底部)
好的,有几个地方你可以在网上找到他们,你要做的第一件事就是检查过程是否正在运行。
ps aux | grep process_name
那么如果它正在运行,你仍然无法访问它。 您将要使用netstat命令和grep的端口。
net stat -anp | grep portnumber
你看看服务是否在其应该的端口上运行。 它会说它的倾听。 聆听意味着该端口正在该端口上寻找通信。 这将意味着应用程序已经启动,正在寻找端口上的通信,或者端口被另一个应用程序使用,这就是为什么它没有启动。
一般你会看看lgos tail -f -n 100 / path / to / log / file
-n是行数-f是连续的,因此它如何看你的文件。 如果你不指定它,只会在屏幕上占用100行。
如果您只是想手动检查,请登录到服务器并运行:
ps auxw | grep YOUR_PROCESS_NAME
首先,我不会运行脚本中的命令,直到我知道它们的工作。 您可能不会运行该服务:
sudo service chef-server status #would be a good place to start
要检查一个进程是否在Linux上运行,我会建议从以下开始:
ps aux | grep <part of the process name> ps aux | grep chef
如果你不喜欢aux的输出,你也可以使用-ef就像:
ps -ef | grep <part of the process name> ps -ef | grep chef
如果你知道进程应该打开的端口,你可以使用netstat:
netstat -anp | grep <port number>
例如:寻找要运行的Nginx或apache服务器:
netstat -anp | grep 80
看日志我喜欢使用tail命令:
tail -f /var/log/<name of application folder/<name of log>
例如:观看Nginx日志:
tail -f /var/log/Nginx/Nginx.log
有时候也要看系统日志是有帮助的:
tail -f -n 100 /var/log/syslog
如果查找来自其他机器的传入连接:
sudo tcpdump -vvv -i any port <port number>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。