部署完成的結果
- 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 git@github.com:solaris-meng/yushan2.git
cd yushan2
pip install -r requirements.txt
部署羽扇調價接口
git clone git@github.com: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
數據目錄創(chuàng)建
mkdir /root/data /root/cache