Ariba

来自ling
跳转至: 导航搜索

aribaintegrationtoolkit

e:
cd E:\群晖备份\SynologyDrive\kpmg\水井坊
java -jar aribaintegrationtoolkit.jar d:\shuijingfang\AribaIntegrationToolkit
d:

cd d:\shuijingfang\AribaIntegrationToolkit\bin
encryptcustomerkey.bat ../transcationdata.bat

随便填

写入-->password.txt

encryptstring.bat ../transcationdata.bat

填入:Aribaswellfun-T

写入-->encryptedSharedSecret.txt

d:
d:\shuijingfang\AribaIntegrationToolkit\bin\aribafiletransfer.bat d:\shuijingfang\AribaIntegrationToolkit\transcationdata.bat




复制transcationdata.bat-->transcationdata_source.bat

cd d:\shuijingfang\AribaIntegrationToolkit\bin
encryptcustomerkey.bat ../transcationdata_source.bat

随便填

写入-->password_source.txt

encryptstring.bat ../transcationdata_source.bat

填入:Aribaswellfun-1-T

写入-->encryptedSharedSecret_source.txt

修改transcationdata_source.bat相关配置

d:
d:\shuijingfang\AribaIntegrationToolkit\bin\aribafiletransfer.bat d:\shuijingfang\AribaIntegrationToolkit\transcationdata_source.bat


生产

cd d:\shuijingfang\AribaIntegrationToolkit\bin
encryptcustomerkey.sh ../transcationdata.sh

随便填

写入-->password.txt

encryptstring.sh ../transcationdata.sh

填入:Aribaswellfun-T

写入-->encryptedSharedSecret.txt

d: d:\shuijingfang\AribaIntegrationToolkit\bin\aribafiletransfer.sh d:\shuijingfang\AribaIntegrationToolkit\transcationdata.sh

水井坊

水井坊 prd

docker

docker run --name mysql_kpmg --restart=always -p 6306:3306 -v /alidata/dockerdata/mysqldata/mysql-shuijingfang:/var/lib/mysql -v /alidata/dockerdata/mysqldata/mysql-shuijingfang/my.cnf:/etc/mysql/conf.d/my.cnf -e MYSQL_ROOT_PASSWORD=Ariba_kpmg -d mysql:5.7.18
docker run --name redis_kpmg --restart=always -p 6380:6379 -d redis redis-server --appendonly yes --requirepass Ariba_kpmg
docker run --name phpmyadmin -d -p 6081:80 -e PMA_ABSOLUTE_URI=http://172.16.97.26:6080/phpmyadmin/ phpmyadmin/phpmyadmin

配置

/alidata/dockerdata/mysqldata/mysql-shuijingfang/my.cnf

[mysqld] 
skip-name-resolve
#character_set_client=utf8mb4
#character_set_connection=utf8mb4
#character_set_database=utf8
#character_set_results=utf8mb4
character_set_server=utf8
lower_case_table_names=1
#datadir=/var/lib/mysq
#server-id=1000
[mysql] 
default-character-set = utf8
[mysql.server]
default-character-set = utf8
[mysqld_safe]
default-character-set = utf8
[client]
default-character-set = utf8
mkdir -p /alidata/dockerdata/nginx
docker run --name tmp-nginx-container -d nginx
docker cp tmp-nginx-container:/etc/nginx/nginx.conf /alidata/dockerdata/nginx/nginx.conf
docker rm -f tmp-nginx-container
docker run --name nginx_kpmg --restart=always -p 6080:80  -v /alidata/dockerdata/nginx/html:/usr/share/nginx/html:ro -v /alidata/dockerdata/nginx/nginx.conf:/etc/nginx/nginx.conf:ro -d nginx


mysql 数据导入导出

一、主机与docker容器之间数据导入、导出

从主机复制到容器

docker cp host_path containerID:container_path

从容器复制到主机

docker cp containerID:container_path host_path

二、mysql source导入tables.sql文件

cp文件

docker cp  /kpmg/bladex_init.sql mysql_kpmg:/tmp/
docker cp  /kpmg/tables_xxl_job.sql mysql_kpmg:/tmp/
docker cp  /kpmg/jimu.sql mysql_kpmg:/tmp/

进入数据库容器

docker exec -it mysql_kpmg bash

数据库导入

mysql -h localhost -u root -p(进入mysql下面)

show variables like '%char%';
set character_set_client=utf8mb4;
set character_set_connection=utf8mb4;
set character_set_database=utf8;
set character_set_results=utf8mb4;
set character_set_server=utf8;

show variables like '%char%';

apt-get update
apt-get install vim
vi /etc/mysql/my.cnf
[client]
default-character-set=utf8
[mysqld]
default-character-set=utf8


create database shuijingfang DEFAULT CHARSET utf8 COLLATE utf8_general_ci;(若没有数据需要创建数据库)
show databases;(就可看到所有已经存在的数据库,以及刚刚创建的数据库abc)
use shuijingfang;(若已经存在则直接进入dev数据库下面)
source /tmp/bladex_init.sql(导入数据库表)show tables;(产看dev数据库下面的所有表,空的)
source /tmp/jimu.sql(导入数据库表)
show tables;(查看dev数据库下面的所有表,就可以看到表了)
exit(或者ctrl + c)退出mysql


create database xxl_job DEFAULT CHARSET utf8 COLLATE utf8_general_ci;;(若没有数据需要创建数据库)
show databases;(就可看到所有已经存在的数据库,以及刚刚创建的数据库abc)
use xxl_job;(若已经存在则直接进入dev数据库下面)
show tables;(产看dev数据库下面的所有表,空的)
source /tmp/tables_xxl_job.sql(导入数据库表)
show tables;(查看dev数据库下面的所有表,就可以看到表了)


drop database shuijingfang;

java

ID=`netstat -tnlp |grep 6061|awk '{print $7}' |cut -d '/' -f 1`
echo $ID
kill -9 $ID
mkdir -p /kpmg/shuijingfang/logs/bi
cd  /kpmg/shuijingfang/logs/bi
nohup java -jar  /kpmg/shuijingfang/jar/bi.jar -Dfile.encoding=UTF-8 --spring.profiles.active=shuijingfang --server.port=6061 --spring.datasource.url=jdbc:mysql://127.0.0.1:6306/shuijingfang?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=UTC&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true &
tail -f /kpmg/shuijingfang/logs/bi/nohup.out


ID=`netstat -tnlp |grep 6006|awk '{print $7}' |cut -d '/' -f 1`
echo $ID
kill -9 $ID
mkdir -p /kpmg/shuijingfang/logs/bs
cd  /kpmg/shuijingfang/logs/bs
nohup java -jar  /kpmg/shuijingfang/jar/bs.jar -Dfile.encoding=UTF-8 --spring.profiles.active=shuijingfang --server.port=6006 --spring.datasource.druid.url=jdbc:mysql://127.0.0.1:6306/shuijingfang?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=UTC&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true &
tail -f /kpmg/shuijingfang/logs/bs/nohup.out

nginx

tee /alidata/dockerdata/nginx/nginx.conf <<-'EOF'
user  root;
worker_processes  5;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  172.16.97.26;
 
        charset utf-8;
          location ^~/api/ver2.0/api/ {         
           proxy_set_header   Host             $host;
           proxy_set_header   X-Real-IP        $remote_addr;
           proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;   
           rewrite ^/api/ver2.0/api/(.*)$ /$1 break;
           proxy_pass http://172.16.97.26:6006;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "upgrade";
           client_max_body_size    1000m;
         }
         location /jmreport {         
           proxy_set_header   Host             $host;
           proxy_set_header   X-Real-IP        $remote_addr;
           proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;   
           proxy_pass http://172.16.97.26:6061;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "upgrade";
           client_max_body_size    1000m;
         }
         location /xxl-job-admin{         
           proxy_set_header   Host             $host;
           proxy_set_header   X-Real-IP        $remote_addr;
           proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;   
           proxy_pass http://172.16.97.26:3080;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "upgrade";
           client_max_body_size    1000m;
         }
          location ^~/phpmyadmin/ {         
           proxy_set_header   Host             $host;
           proxy_set_header   X-Real-IP        $remote_addr;
           proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;   
           rewrite ^/phpmyadmin/(.*)$ /$1 break;
           proxy_pass http://172.16.97.26:6081;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "upgrade";
           client_max_body_size    1000m;
         }
         location / {         
           proxy_set_header   Host             $host;
           proxy_set_header   X-Real-IP        $remote_addr;
           proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;   
           alias /usr/share/nginx/html/;
           index  index.html index.htm;
           expires     -1;
         }
    }
}
EOF

xxl-job

mkdir -p /alidata/dockerdata/xxljob/applogs 
docker run -e PARAMS="--spring.datasource.url=jdbc:mysql://mysql:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai --spring.datasource.username=root --spring.datasource.password=Ariba_kpmg --xxl.job.accessToken=ling" -p 3080:8080 -v /alidata/dockerdata/xxljob/applogs:/data/applogs --name xxl-job-admin  --link mysql_kpmg:mysql -d xuxueli/xxl-job-admin:2.3.0


用户admin 密码123456

docker logs -f xxl-job-admin

http://172.16.97.26:6080/xxl-job-admin/

jdk

cd /kpmg/soft

rz 上传

mkdir -p  /etc/java
cd /etc/java
tar -xvzf /kpmg/soft/jdk-8u271-linux-x64.tar.gz
vi ~/.bashrc

配置 .bashrc后面

export JAVA_HOME=/etc/java/jdk1.8.0_271
export JAVA_BIN=$JAVA_HOME/bin
export JAVA_LIB=$JAVA_HOME/lib
export CLASSPATH=.:$JAVA_LIB/tools.jar:$JAVA_LIB/dt.jar
export PATH=$JAVA_BIN:$PATH

使生效

source ~/.bashrc

itk

cd /kpmg/aribatool
java -jar aribaintegrationtoolkit.jar /kpmg/aribatool/AribaIntegrationToolkit
rz transcationdata.sh transcationdata_source.sh
cd /kpmg/aribatool/AribaIntegrationToolkit/bin
sh encryptcustomerkey.sh ../transcationdata.sh

随便填 ariba

写入-->password.txt

touch ../password.txt
vi ../password.txt
sh encryptstring.sh ../transcationdata.sh

填入:ProdCustomerKey123456789

写入-->encryptedSharedSecret.txt

touch ../encryptedSharedSecret.txt
vi ../encryptedSharedSecret.txt


sh /kpmg/aribatool/AribaIntegrationToolkit/bin/aribafiletransfer.sh /kpmg/aribatool/AribaIntegrationToolkit/transcationdata.sh
cd /kpmg/aribatool/AribaIntegrationToolkit/aribaDownstreamDownload/batch/swellfun
ls
sh /kpmg/aribatool/AribaIntegrationToolkit/bin/aribafiletransfer.sh /kpmg/aribatool/AribaIntegrationToolkit/transcationdata_source.sh
cd /kpmg/aribatool/AribaIntegrationToolkit/aribaDownstreamDownload/batch/swellfun-1
ls


重置

rm -rf transcationdata.sh
rm -rf transcationdata_source.sh

接口

http://172.16.97.26:6080/api/ver2.0/api/shuijingfang/importCategory

http://172.16.97.26:6080/api/ver2.0/api/shuijingfang/processContractTask

http://172.16.97.26:6080/api/ver2.0/api/shuijingfang/processOrderTask

http://172.16.97.26:6080/api/ver2.0/api/shuijingfang/saveVendorTask

http://172.16.97.26:6080/api/ver2.0/api/shuijingfang/cycleTime

http://172.16.97.26:6080/api/ver2.0/api/shuijingfang/PRPOCycleTime

http://172.16.97.26:6080/api/ver2.0/api/shuijingfang/all

http://172.16.97.26:6080

http://172.16.97.26:6080/jmreport/list


tail -f /kpmg/shuijingfang/logs/bs/nohup.out
tail -f /kpmg/shuijingfang/logs/bi/nohup.out

问题处理

数据库操作

docker exec -it mysql_kpmg bash

mysql -h localhost -u root -p

Ariba_kpmg

use shuijingfang;

delete from sjf_ariba_order_item;


http://172.16.97.26:6080/api/ver2.0/api/shuijingfang/processOrderTask


http://172.16.97.26:6080/api/ver2.0/api/shuijingfang/cycleTime

交接

源代码地址

前端,后端,BI

主要系统地址

堡垒机 https://itaudit.swellfun.com/

系统地址 http://172.16.97.26:6080/#/wel/index 管理员账号

xxl-job http://172.16.97.26:6080/xxl-job-admin/

BI http://172.16.97.26:6080/jmreport/list

数据库

docker exec -it mysql_kpmg bash

mysql -h localhost -u root -p

Ariba_kpmg

use shuijingfang;

java 发布

发布 sh /republish_kpmg.sh

查看日志 tail -f /kpmg/shuijingfang/logs/bs/nohup.out

=修改源代码地址

vi /kpmg/shuijingfang/source/ling-boot/.git/config