小编gun*_*sai的帖子

Gunicorn和Nginx之间的沟通

我一直在尝试使用Gunicorn作为我的应用程序服务器和Nginx作为反向代理来运行我的django生产服务器.

下面是我的nginx conf文件:

server {
    listen 80;
    server_name myproject.com;

    location /static/ {
        alias /var/www/myproject/static/;
    }

    location /media/ {
        alias /var/www/myproject/media/;
    }

    location / {
        include proxy_params;
        proxy_pass http://unix:/home/user/myproject/myproject.sock;
    }            
}
Run Code Online (Sandbox Code Playgroud)

下面是我的gunicorn.conf文件:

description "Gunicorn application server handling my project file"

start on runlevel [2345]
stop on runlevel [!2345]

respawn
setuid user
setgid www-data
chdir /home/user/myproject/

exec gunicorn --workers 3 --bind unix:/home/user/myproject/myproject.sock myproject.wsgi:application
Run Code Online (Sandbox Code Playgroud)

下面是myproject.sock文件的代码:

[Unit]
Description=gunicorn socket

[Socket]
ListenStream=/run/gunicorn/socket
ListenStream=0.0.0.0:9000
ListenStream=[::]:8000

[Install]
WantedBy=sockets.target
Run Code Online (Sandbox Code Playgroud)

当我尝试使用这些设置运行时.我收到以下错误:

connect() to unix:/home/user/myproject/myproject.sock failed (111: Connection refused) while …
Run Code Online (Sandbox Code Playgroud)

django nginx gunicorn

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

Kafka Connect JDBC源连接器不适用于Microsoft SQL Server

我已经设置了Kafka Connect的dockerized集群,该集群以分布式模式运行。我正在尝试设置一个Kafka JDBC源连接器,以在Microsoft SQL Server和Kafka之间移动数据。

以下是我的connector-pluginsapi 响应的输出

[
    {
    class: "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
    type: "sink",
    version: "4.0.0"
    },
    {
    class: "io.confluent.connect.hdfs.HdfsSinkConnector",
    type: "sink",
    version: "4.0.0"
    },
    {
    class: "io.confluent.connect.hdfs.tools.SchemaSourceConnector",
    type: "source",
    version: "1.0.0-cp1"
    },
    {
    class: "io.confluent.connect.jdbc.JdbcSinkConnector",
    type: "sink",
    version: "4.0.0"
    },
    {
    class: "io.confluent.connect.jdbc.JdbcSourceConnector",
    type: "source",
    version: "4.0.0"
    },
    {
    class: "io.debezium.connector.mongodb.MongoDbConnector",
    type: "source",
    version: "0.7.4"
    },
    {
    class: "io.debezium.connector.mysql.MySqlConnector",
    type: "source",
    version: "0.7.4"
    },
    {
    class: "org.apache.kafka.connect.file.FileStreamSinkConnector",
    type: "sink",
    version: "1.0.0-cp1"
    },
    {
    class: "org.apache.kafka.connect.file.FileStreamSourceConnector",
    type: "source",
    version: …
Run Code Online (Sandbox Code Playgroud)

sql-server jdbc apache-kafka apache-kafka-connect

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