我使用CentOS,我安装了pip /usr/local/python-dir/bin/pip.我建了一个链接/usr/local/bin/pip.然后我执行了sudo pip install xxx,它报告了这样的错误:
sudo: pip: command not found
Run Code Online (Sandbox Code Playgroud)
我觉得$PATH没事:
/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin
Run Code Online (Sandbox Code Playgroud)
但是,我只能这样执行pip:
sudo /usr/local/bin/pip install xxx
Run Code Online (Sandbox Code Playgroud)
如何配置PATH或其他?非常感谢.
我想将nginx配置为服务器HTML文件以供查看而不是下载.
server {
listen 5000;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
#location / {
# root html;
# index index.html index.htm;
#}
location = / {
root /home/vagrant/own/base/assets;
index index.html;
}
location = /login {
# root /home/vagrant/own/base/assets;
alias /home/vagrant/own/base/assets/login.html;
}
location /index.html {
root /home/vagrant/own/base/assets;
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的conf文件,当我浏览时/login,我的浏览器尝试提供下载文件而不是查看它.谢谢你的帮助.
当使用supervisor启动redis时,redis进程正在运行,但是在supervisor中它显示退避.
vagrant@jinming:~$ sudo supervisorctl -c /etc/conf/supervisor/supervisord.conf
redis BACKOFF Exited too quickly (process log may have details)
Run Code Online (Sandbox Code Playgroud)
在主管日志中,它显示如下:
2015-06-09 07:09:28,407 CRIT Supervisor running as root (no user in config file)
2015-06-09 07:09:28,407 WARN Included extra file "/etc/conf/supervisor/conf.d/redis_local.conf" during parsing
2015-06-09 07:09:28,407 INFO RPC interface 'supervisor' initialized
2015-06-09 07:09:28,407 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2015-06-09 07:09:28,407 INFO supervisord started with pid 23191
2015-06-09 07:09:29,410 INFO spawned: 'redis' with pid 23332
2015-06-09 07:09:29,416 INFO exited: redis (exit status 0; …Run Code Online (Sandbox Code Playgroud) Prometheus Pushgateway 计数器 inc 不正确\xef\xbc\x8c也许 Pushgateway 仅支持设置值?
\n\n\n\n该值始终为 1,而不是如预期的那样。
\n\n代码如下所示:
\n\nclass PrometheusClient(object):\n\n def __init__(self):\n self.push_url = "prometheus-pushgateway:9091"\n\n def push(self):\n registry = CollectorRegistry()\n c = Counter(\'news_crawler\', \'crawl count\', labelnames=[\'source\', \'source_name\'], registry=registry)\n c.labels(source=2, source_name=\'jin_flash\').inc()\n push_to_gateway(self.push_url, job=\'news_crawler_collector\', registry=registry)\nRun Code Online (Sandbox Code Playgroud)\n 当我在ops机器上运行命令时:
ansible web -b -l 192.168.31.101 -m yum -a "name=gcc state=latest"
Run Code Online (Sandbox Code Playgroud)
它返回错误显示如下:
192.168.31.101 | FAILED! => {
"changed": false,
"failed": true,
"msg": "python2 bindings for rpm are needed for this module. python2 yum module is needed for this module"
}
Run Code Online (Sandbox Code Playgroud)
但是当我sudo yum install gcc直接在上执行命令时192.168.31.101,执行正确。
似乎ansible不能使用正确的yum和python
在瓶子里,如何在一个页面中将一个url跳转到另一个url?
import webbrowser
webbrowser.open('http://localhost:8080/login.html')
Run Code Online (Sandbox Code Playgroud)
我尝试过如上所述,但它没有在一个页面中打开!我希望它是重定向,但不会引发303或302错误!
python ×2
ansible ×1
bottle ×1
centos ×1
centos7 ×1
nginx ×1
pip ×1
prometheus ×1
python-3.x ×1
redis ×1
supervisord ×1
yum ×1