小编Man*_*dav的帖子

如何在ubuntu 16.04上将Postgresql 9.5升级到Postgresql 10

我有一台运行postgresql 9.5的ubuntu机器,大约有12 GB的数据.现在我想将我的postgresql版本从9.5升级到10.我google了一些articals但无法升级,还有一件事我不想完全卸载postgres 9.5并安装postgres 10.我的postgresql 9.5设置是:

1-Postgresql配置文件位于:

/opt/PostgreSQL/9.5/
Run Code Online (Sandbox Code Playgroud)

2- Postgresql 10安装位置

/etc/postgresql/10
Run Code Online (Sandbox Code Playgroud)

postgresql ubuntu-16.04

8
推荐指数
2
解决办法
1万
查看次数

使用python而不使用django在celery中执行周期性任务

大家好,我是 celery 和 python 的新手。我正在使用rabbitmq-server 创建一个简单的任务。但我不知道如何在 python 中使用 celerybeat 实现周期性任务。我搜索但每个地方我都会用 django 定期执行任务。

我使用此代码作为tasks.py: from celery import Celery from time import strftime

app = Celery('tasks',broker='pyamqp://guest@localhost//')

@app.task
def show_time():
    return strftime('%Y-%m-%d %H:%M:%S')
Run Code Online (Sandbox Code Playgroud)

运行任务.py:

from tasks import show_time
show_time.delay()
Run Code Online (Sandbox Code Playgroud)

谢谢你的时间。

python-2.7 celery-task celerybeat

5
推荐指数
1
解决办法
1372
查看次数

错误无法访问文件“ $ libdir / repmgr_funcs”没有此类文件或目录

我按照此链接在Ubuntu postgresql服务器上创建主从复制。

我对repmgr和的配置postgresql是:

PostgreSQL 9.5-: /opt/PostgreSQL/9.5/

repmgr-: /usr/lib/postgresql/9.5/bin/repmgr

repmgr.conf-: /etc/rep.conf

pg_config --pkglibdir => /usr/lib/postgresql/9.5/lib


ls /usr/lib/postgresql/9.5/lib | grep repmgr_funcs => repmgr_funcs.so
Run Code Online (Sandbox Code Playgroud)

我收到错误-:无法创建函数

repmgr_update_last_updated: ERROR:  could not access file "$libdir/repmgr_funcs": No such file or directory

ERROR: Unable to create repmgr schema - see preceding error message(s); aborting
Run Code Online (Sandbox Code Playgroud)

postgresql ubuntu repmgr

5
推荐指数
1
解决办法
3142
查看次数

Flower Http Api 获取 Celery 任务详情

我有一个正在工作的芹菜花项目。
现在我想要一些 celery 失败的任务详细信息flower http api,但是我的 celery--basic-auth用于身份验证,并且当我flower http apihttp://localhost:5555/api/tasks它超时时发出请求并且不显示任何结果。

我不明白这是身份验证问题还是其他问题。我看花文档,但我没有任何想法。谢谢你的时间。下面是对我不起作用的代码。

import requests

params = (('state', 'FAILURE'),('limit', '5'),)

requests.get('http://localhost:5555/api/tasks', params=params)
Run Code Online (Sandbox Code Playgroud)

python celery flower

3
推荐指数
1
解决办法
1195
查看次数

nginx.service:无法从文件 /run/nginx.pid 读取 PID:参数 ubuntu 16.04 xenial 无效

我知道这是一个已知的错误,但我不知道如何解决这个问题,因为我做了很多谷歌搜索,之后终于回到堆栈以获得一些真正的解决方案:

下面是配置:

首先我通过以下方式安装nginx:

sudo apt-get install nginx

lsb_release -rd
Description:    Ubuntu 16.04.2 LTS
Release:        16.04

apt-cache policy nginx-core
nginx-core:
  Installed: 1.10.3-0ubuntu0.16.04.2
  Candidate: 1.10.3-0ubuntu0.16.04.2
  Version table:
 *** 1.10.3-0ubuntu0.16.04.2 500
        500 http://sg.mirrors.cloud.aliyuncs.com/ubuntu xenial-updates/main amd64 Packages
        500 http://sg.mirrors.cloud.aliyuncs.com/ubuntu xenial-security/main amd64 Packages
        100 /var/lib/dpkg

/status
     1.9.15-0ubuntu1 500
        500 http://sg.mirrors.cloud.aliyuncs.com/ubuntu xenial/main amd64 Packages
Run Code Online (Sandbox Code Playgroud)

我的 nginx 服务配置是这样的:

nano /lib/systemd/system/nginx.service

# Stop dance for nginx
# =======================
#
# ExecStop sends SIGSTOP (graceful stop) to the nginx process.
# If, after 5s (--retry QUIT/5) nginx is still …
Run Code Online (Sandbox Code Playgroud)

python django nginx ubuntu-16.04

1
推荐指数
1
解决办法
1495
查看次数