私有化部署-百度数据接口

部署完成的结果

  • 127.0.0.1:7020 -- 羽扇数据存储任务接口(存储日报)
  • 127.0.0.1:7000 -- 智能调价接口和小时报数据接口
    http://101.200.139.66:7020/

编译安装Python3.5.1

yum install git gcc libcurl libcurl-devel openssl-devel sqlite3-devel nginx postgresql-devel libcurl libcurl-devel libevent libevent-devel vim readline-devel -y
tar xvf Python-3.5.1.tgz
cd Python-3.5.1
./configure
make
make install

部署羽扇数据后台

pyvenv ~/env
source ~/env/bin/activate
pip uninstall pycurl
export PYCURL_SSL_LIBRARY=nss
easy_install pycurl
git clone [email protected]:solaris-meng/yushan2.git
cd yushan2
pip install -r requirements.txt

部署羽扇调价接口

git clone [email protected]:solaris-meng/yushanapi.git

Nginx占用的端口

  server {
        listen       7020;
        server_name  localhost;

        #access_log  logs/host.access.log  main;

        location /static {
            alias   /root/yushan2/static/;
            autoindex   on;
        }
        location /media {
            alias   /root/yushan2/media/;
            autoindex   on;
        }

        
        location / {
            #proxy_pass http://app_server;
            proxy_pass http://127.0.0.1:7021;
            proxy_set_header Referer $http_referer;
            proxy_set_header Host $http_host;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header X-Forwarded-Host $server_name;
            proxy_read_timeout 1200;
            include uwsgi_params;
        }

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

    }
    upstream slarkapi {
        server 127.0.0.1:7001;
        server 127.0.0.1:7002;
        server 127.0.0.1:7003;
        server 127.0.0.1:7004;
    }
    server {
        listen       7000;
        server_name  localhost;

        #access_log  logs/host.access.log  main;

        location / {
            proxy_pass http://slarkapi;
            proxy_set_header Referer $http_referer;
            proxy_set_header Host $http_host;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header X-Forwarded-Host $server_name;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Scheme $scheme;
        }
    }

数据库配置

sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb
systemctl enable postgresql-9.6
systemctl start postgresql-9.6

/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data > /tmp/logfile 2>&1 &

CREATE USER yushan WITH PASSWORD 'moushi123';
CREATE DATABASE msdb;
GRANT ALL PRIVILEGES ON DATABASE msdb to yushan;

cd /etc/ld.so.conf.d
echo "/usr/local/pgsql/lib" >>pgsql.conf
ldconfig

数据目录创建

mkdir /root/data /root/cache

你可能感兴趣的:(私有化部署-百度数据接口)