datax install

java install

1
2
3
4
5
6
7
8
[root@localhost app]# tar xzf jdk-8u111-linux-x64.tar.gz
[root@localhost app]# mv jdk1.8.0_111 /mnt/app/java
[root@localhost app]# echo 'JAVA_HOME=/mnt/app/java' | tee /etc/profile.d/java.sh
[root@localhost app]# echo 'JRE_HOME=${JAVA_HOME}/jre' | tee -a /etc/profile.d/java.sh
[root@localhost app]# echo 'CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib' | tee -a /etc/profile.d/java.sh
[root@localhost app]# echo 'export PATH=${JAVA_HOME}/bin:$PATH' | tee -a /etc/profile.d/java.sh
[root@localhost app]# source /etc/profile
[root@localhost app]# java -version

maven install

1
2
3
4
5
[root@localhost app]# tar xzf apache-maven-3.3.9-bin.tar.gz
[root@localhost app]# mv apache-maven-3.3.9 /mnt/app/maven
[root@localhost app]# echo 'MAVEN_HOME=/mnt/app/maven' | tee -a /etc/profile.d/maven.sh
[root@localhost app]# echo 'export PATH=${PATH}:${MAVEN_HOME}/bin' | tee -a /etc/profile.d/maven.sh
[root@localhost app]# source /etc/profile

python install

1
2
3
4
5
6
7
8
9
10
11
12
13
[root@localhost ~]# git clone https://github.com/yyuu/pyenv.git ~/.pyenv
[root@localhost ~]# echo 'export PYENV_ROOT="$HOME/.pyenv"' | tee /etc/profile.d/pyenv.sh
[root@localhost ~]# echo 'export PATH="$PYENV_ROOT/bin:$PATH"' | tee -a /etc/profile.d/pyenv.sh
[root@localhost ~]# echo 'eval "$(pyenv init -)"' | tee -a /etc/profile.d/pyenv.sh
[root@localhost ~]# echo 'eval "$(pyenv virtualenv-init -)"' | tee -a /etc/profile.d/pyenv.sh
[root@localhost ~]# source /etc/profile
[root@localhost ~]# exec $SHELL

[root@localhost ~]# pyenv install 2.7.13
[root@localhost ~]# pyenv rehash

[root@localhost ~]# pyenv global 2.7.13
[root@localhost ~]# pyenv versions

datax install

1
2
3
4
5
6
[root@localhost app]# tar xzf datax.tar.gz
[root@localhost app]# mv datax /mnt/app/datax
[root@localhost app]# echo 'export DATAX_HOME=/mnt/app/datax' | tee /etc/profile.d/datax.sh
[root@localhost app]# echo 'export DATAX_BIN=${DATAX_HOME}/bin' | tee -a /etc/profile.d/datax.sh
[root@localhost app]# echo 'export PATH=${DATAX_BIN}:$PATH' | tee -a /etc/profile.d/datax.sh
[root@localhost app]# source /etc/profile

datax use[https://github.com/alibaba/DataX]

1
2
3
4
5
6
[root@localhost app]# touch /mnt/app/datax/job/test.json
[root@localhost app]# cd /mnt/app/datax && python ./bin/datax.py ./job/test.json -p "-Dtime=${DAY} -Ddays=${num}"

说明:
-p 表示传参
-D 表示定义的变量,在job中引用变量