├── onecmdb ├── README.md ├── alpine3.3-base ├── build.sh ├── Shanghai ├── repositories ├── Dockerfile └── README.md ├── alpine3.4-base ├── build.sh ├── Shanghai ├── repositories ├── Dockerfile └── README.md ├── alpine3.5-base ├── build.sh ├── Shanghai ├── repositories ├── Dockerfile └── README.md ├── centos7-jdk8 ├── build.sh └── Dockerfile ├── alpine3.3-python ├── build.sh └── Dockerfile ├── nginx └── 1.8.0 │ ├── entrypoint.sh │ ├── build.sh │ ├── nginx.repo │ ├── Dockerfile │ └── nginx.conf ├── alpine3.3-drone-base ├── build.sh └── Dockerfile ├── MariaDBGalera ├── container-files │ ├── etc │ │ ├── my.cnf.d │ │ │ ├── security.cnf │ │ │ ├── engine.cnf │ │ │ ├── charsets.cnf │ │ │ ├── logging.cnf │ │ │ ├── galera.cnf │ │ │ ├── slowlog.cnf │ │ │ ├── networking.cnf │ │ │ └── tuning.cnf │ │ └── yum.repos.d │ │ │ └── mariadb.repo │ ├── run.sh │ └── mariadb-functions.sh ├── Dockerfile └── README.md ├── tsung ├── log.png ├── report.png ├── tsung.png ├── tsung2.png ├── graphical.png ├── Tsung.md ├── tsung-xml-setting.md └── tsung_dataman.md ├── mesos ├── 0.23 │ ├── marathon │ │ ├── build.sh │ │ ├── dataman_marathon.sh │ │ └── Dockerfile │ ├── mesos-base │ │ ├── build.sh │ │ └── Dockerfile │ ├── mesos-master │ │ ├── build.sh │ │ └── Dockerfile │ └── mesos-slave │ │ ├── build.sh │ │ ├── libapparmor.so.1 │ │ ├── libseccomp.so.2 │ │ └── Dockerfile ├── 0.24 │ ├── marathon │ │ ├── build.sh │ │ ├── dataman_marathon.sh │ │ └── Dockerfile │ ├── mesos-base │ │ ├── build.sh │ │ └── Dockerfile │ ├── mesos-master │ │ ├── build.sh │ │ └── Dockerfile │ └── mesos-slave │ │ ├── build.sh │ │ ├── libapparmor.so.1 │ │ ├── libseccomp.so.2 │ │ └── Dockerfile └── 0.25 │ ├── marathon │ ├── build.sh │ ├── dataman_marathon.sh │ └── Dockerfile │ ├── mesos-base │ ├── build.sh │ └── Dockerfile │ ├── mesos-master │ ├── build.sh │ └── Dockerfile │ ├── mesos-slave │ ├── build.sh │ ├── libapparmor.so.1 │ ├── libseccomp.so.2 │ └── Dockerfile │ └── description.md ├── onecmdb2.1 ├── run.sh ├── readme.md └── Dockerfile ├── zookeeper ├── img │ ├── zklist.png │ ├── checkzk.png │ ├── createzk1.png │ ├── createzk2.png │ ├── clusterlist.png │ ├── createslave.png │ ├── createcluster.png │ └── createmaster.png ├── docker │ ├── run.sh │ ├── Dockerfile │ ├── dataman_zookeeper.sh │ ├── zoo.cfg.template │ └── zkServer.sh └── 部署Zookeeper集群.md ├── basefile ├── files │ ├── libltdl.so.7 │ ├── libapparmor.so.1 │ ├── libseccomp.so.2 │ └── libdevmapper.so.1.02.1 └── scripts │ ├── filedownload.sh │ └── DM_DOCKER_URI_2.7.py ├── centos7-base ├── build.sh └── Dockerfile ├── jenkins └── docker │ ├── jenkins-slave │ ├── build.sh │ └── Dockerfile │ ├── gitclone │ ├── run.sh │ ├── dataman_jenkins.sh │ ├── jenkins-base │ └── Dockerfile │ └── jenkins-master │ └── Dockerfile ├── active-mq ├── data │ └── apache-activemq-5.13.1 │ │ ├── bin │ │ └── start_active-mq.sh │ │ └── conf │ │ └── activemq.xml └── Dockerfile ├── imagelist ├── alpine3.3-base.txt ├── alpine3.4-base.txt ├── alpine3.5-base.txt ├── alpine3.3-python.txt ├── centos7-zookeeper-3.4.6.txt ├── jenkins-slave.txt ├── centos7-base.txt ├── centos7-jdk8.txt ├── nginx-1.8.0.txt └── alpine3.3-drone-base.txt ├── mycat ├── mycat │ ├── Dockerfile │ └── data │ │ └── mycat │ │ ├── bin │ │ └── start_mycat.sh │ │ └── conf │ │ ├── schema.xml │ │ └── server.xml └── mycat-base │ ├── data │ └── mycat │ │ └── bin │ │ └── start_mycat.sh │ ├── Dockerfile │ └── etc │ ├── pam.d │ └── login │ └── security │ └── limits.conf ├── kafka └── docker │ ├── docker_kafka.sh │ ├── dataman.properties.template │ ├── kafka_run_task.sh │ ├── Dockerfile │ └── kafka-marathon-bootstrap.sh ├── redis ├── Dockerfile └── etc │ ├── init.d │ └── redis │ └── redis.conf └── performance └── sysctl.conf /onecmdb: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenDockerFile 2 | -------------------------------------------------------------------------------- /alpine3.3-base/build.sh: -------------------------------------------------------------------------------- 1 | docker build -t library/alpine3.3-base . 2 | -------------------------------------------------------------------------------- /alpine3.4-base/build.sh: -------------------------------------------------------------------------------- 1 | docker build -t library/alpine3.4-base . 2 | -------------------------------------------------------------------------------- /alpine3.5-base/build.sh: -------------------------------------------------------------------------------- 1 | docker build -t library/alpine3.5-base . 2 | -------------------------------------------------------------------------------- /centos7-jdk8/build.sh: -------------------------------------------------------------------------------- 1 | docker build $opts -t library/centos7-jdk8 . 2 | -------------------------------------------------------------------------------- /alpine3.3-python/build.sh: -------------------------------------------------------------------------------- 1 | docker build -t shurenyun/alpine3.3-python . 2 | -------------------------------------------------------------------------------- /nginx/1.8.0/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | /filedownload.sh 3 | nginx $@ 4 | -------------------------------------------------------------------------------- /alpine3.3-drone-base/build.sh: -------------------------------------------------------------------------------- 1 | docker build -t library/alpine3.3-drone-base . 2 | -------------------------------------------------------------------------------- /MariaDBGalera/container-files/etc/my.cnf.d/security.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | skip_show_database 3 | -------------------------------------------------------------------------------- /tsung/log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/tsung/log.png -------------------------------------------------------------------------------- /tsung/report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/tsung/report.png -------------------------------------------------------------------------------- /tsung/tsung.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/tsung/tsung.png -------------------------------------------------------------------------------- /tsung/tsung2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/tsung/tsung2.png -------------------------------------------------------------------------------- /mesos/0.23/marathon/build.sh: -------------------------------------------------------------------------------- 1 | opts='--no-cache' 2 | docker build $opts -t centos7/marathon-0.9.1 . 3 | -------------------------------------------------------------------------------- /mesos/0.24/marathon/build.sh: -------------------------------------------------------------------------------- 1 | opts='--no-cache' 2 | docker build $opts -t centos7/marathon-0.11.1 . 3 | -------------------------------------------------------------------------------- /mesos/0.25/marathon/build.sh: -------------------------------------------------------------------------------- 1 | opts='--no-cache' 2 | docker build $opts -t centos7/marathon-0.13.1 . 3 | -------------------------------------------------------------------------------- /nginx/1.8.0/build.sh: -------------------------------------------------------------------------------- 1 | #opts="--no-cache" 2 | docker build $opts -t library/centos7-nginx-1.8.0 . 3 | -------------------------------------------------------------------------------- /tsung/graphical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/tsung/graphical.png -------------------------------------------------------------------------------- /mesos/0.23/mesos-base/build.sh: -------------------------------------------------------------------------------- 1 | opts='--no-cache' 2 | docker build $opts -t centos7/mesos-0.23.0-base . 3 | -------------------------------------------------------------------------------- /mesos/0.23/mesos-master/build.sh: -------------------------------------------------------------------------------- 1 | opts='--no-cache' 2 | docker build $opts -t centos7/mesos-master-0.23 . 3 | -------------------------------------------------------------------------------- /mesos/0.23/mesos-slave/build.sh: -------------------------------------------------------------------------------- 1 | opts='--no-cache' 2 | docker build $opts -t centos7/mesos-slave-0.23 . 3 | -------------------------------------------------------------------------------- /mesos/0.24/mesos-base/build.sh: -------------------------------------------------------------------------------- 1 | opts='--no-cache' 2 | docker build $opts -t centos7/mesos-0.24.0-base . 3 | -------------------------------------------------------------------------------- /mesos/0.24/mesos-master/build.sh: -------------------------------------------------------------------------------- 1 | opts='--no-cache' 2 | docker build $opts -t centos7/mesos-master-0.24 . 3 | -------------------------------------------------------------------------------- /mesos/0.24/mesos-slave/build.sh: -------------------------------------------------------------------------------- 1 | opts='--no-cache' 2 | docker build $opts -t centos7/mesos-slave-0.24 . 3 | -------------------------------------------------------------------------------- /mesos/0.25/mesos-base/build.sh: -------------------------------------------------------------------------------- 1 | opts='--no-cache' 2 | docker build $opts -t centos7/mesos-0.25.0-base . 3 | -------------------------------------------------------------------------------- /mesos/0.25/mesos-master/build.sh: -------------------------------------------------------------------------------- 1 | opts='--no-cache' 2 | docker build $opts -t centos7/mesos-master-0.25 . 3 | -------------------------------------------------------------------------------- /mesos/0.25/mesos-slave/build.sh: -------------------------------------------------------------------------------- 1 | opts='--no-cache' 2 | docker build $opts -t centos7/mesos-slave-0.25 . 3 | -------------------------------------------------------------------------------- /alpine3.3-base/Shanghai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/alpine3.3-base/Shanghai -------------------------------------------------------------------------------- /alpine3.4-base/Shanghai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/alpine3.4-base/Shanghai -------------------------------------------------------------------------------- /alpine3.5-base/Shanghai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/alpine3.5-base/Shanghai -------------------------------------------------------------------------------- /onecmdb2.1/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | bin/onecmdb.sh start 3 | 4 | while true 5 | do 6 | sleep 60 7 | done 8 | -------------------------------------------------------------------------------- /zookeeper/img/zklist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/zookeeper/img/zklist.png -------------------------------------------------------------------------------- /basefile/files/libltdl.so.7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/basefile/files/libltdl.so.7 -------------------------------------------------------------------------------- /zookeeper/img/checkzk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/zookeeper/img/checkzk.png -------------------------------------------------------------------------------- /zookeeper/img/createzk1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/zookeeper/img/createzk1.png -------------------------------------------------------------------------------- /zookeeper/img/createzk2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/zookeeper/img/createzk2.png -------------------------------------------------------------------------------- /centos7-base/build.sh: -------------------------------------------------------------------------------- 1 | #opts="--no-cache" 2 | docker build $opts -t demoregistry.dataman-inc.com/library/centos7-base . 3 | -------------------------------------------------------------------------------- /zookeeper/img/clusterlist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/zookeeper/img/clusterlist.png -------------------------------------------------------------------------------- /zookeeper/img/createslave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/zookeeper/img/createslave.png -------------------------------------------------------------------------------- /basefile/files/libapparmor.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/basefile/files/libapparmor.so.1 -------------------------------------------------------------------------------- /basefile/files/libseccomp.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/basefile/files/libseccomp.so.2 -------------------------------------------------------------------------------- /zookeeper/img/createcluster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/zookeeper/img/createcluster.png -------------------------------------------------------------------------------- /zookeeper/img/createmaster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/zookeeper/img/createmaster.png -------------------------------------------------------------------------------- /basefile/files/libdevmapper.so.1.02.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/basefile/files/libdevmapper.so.1.02.1 -------------------------------------------------------------------------------- /mesos/0.23/mesos-slave/libapparmor.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/mesos/0.23/mesos-slave/libapparmor.so.1 -------------------------------------------------------------------------------- /mesos/0.23/mesos-slave/libseccomp.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/mesos/0.23/mesos-slave/libseccomp.so.2 -------------------------------------------------------------------------------- /mesos/0.24/mesos-slave/libapparmor.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/mesos/0.24/mesos-slave/libapparmor.so.1 -------------------------------------------------------------------------------- /mesos/0.24/mesos-slave/libseccomp.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/mesos/0.24/mesos-slave/libseccomp.so.2 -------------------------------------------------------------------------------- /mesos/0.25/mesos-slave/libapparmor.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/mesos/0.25/mesos-slave/libapparmor.so.1 -------------------------------------------------------------------------------- /mesos/0.25/mesos-slave/libseccomp.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/HEAD/mesos/0.25/mesos-slave/libseccomp.so.2 -------------------------------------------------------------------------------- /MariaDBGalera/container-files/etc/my.cnf.d/engine.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | default-storage-engine = InnoDB 3 | innodb = FORCE 4 | -------------------------------------------------------------------------------- /nginx/1.8.0/nginx.repo: -------------------------------------------------------------------------------- 1 | [nginx] 2 | name=nginx repo 3 | baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ 4 | gpgcheck=0 5 | enabled=1 6 | -------------------------------------------------------------------------------- /jenkins/docker/jenkins-slave/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | #opts='--no-cache' 4 | docker build $opts -t library/centos7-jdk8-jenkins-slave-base . 5 | -------------------------------------------------------------------------------- /active-mq/data/apache-activemq-5.13.1/bin/start_active-mq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #run 4 | CMD="/data/apache-activemq-5.13.1/bin/activemq console" 5 | exec $CMD 6 | -------------------------------------------------------------------------------- /alpine3.3-python/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM demoregistry.dataman-inc.com/library/alpine3.3-base:latest 2 | 3 | RUN apk add --update python && rm -rf /var/cache/apk/* 4 | -------------------------------------------------------------------------------- /imagelist/alpine3.3-base.txt: -------------------------------------------------------------------------------- 1 | demoregistry.dataman-inc.com/library/alpine3.3-base:latest 2 | demoregistry.dataman-inc.com/library/alpine3.3-base:20160614153544 3 | -------------------------------------------------------------------------------- /imagelist/alpine3.4-base.txt: -------------------------------------------------------------------------------- 1 | demoregistry.dataman-inc.com/library/alpine3.4-base:latest 2 | demoregistry.dataman-inc.com/library/alpine3.4-base:20160811142158 3 | -------------------------------------------------------------------------------- /imagelist/alpine3.5-base.txt: -------------------------------------------------------------------------------- 1 | demoregistry.dataman-inc.com/library/alpine3.5-base:latest 2 | demoregistry.dataman-inc.com/library/alpine3.5-base:20170427105036 3 | -------------------------------------------------------------------------------- /imagelist/alpine3.3-python.txt: -------------------------------------------------------------------------------- 1 | demoregistry.dataman-inc.com/library/alpine3.3-python:latest 2 | demoregistry.dataman-inc.com/library/alpine3.3-python:20160614154500 3 | -------------------------------------------------------------------------------- /alpine3.3-base/repositories: -------------------------------------------------------------------------------- 1 | http://mirrors.ustc.edu.cn/alpine/v3.3/main/ 2 | http://dl-cdn.alpinelinux.org/alpine/v3.3/main 3 | http://dl-cdn.alpinelinux.org/alpine/v3.3/community 4 | -------------------------------------------------------------------------------- /alpine3.4-base/repositories: -------------------------------------------------------------------------------- 1 | http://mirrors.ustc.edu.cn/alpine/v3.4/main/ 2 | http://dl-cdn.alpinelinux.org/alpine/v3.4/main 3 | http://dl-cdn.alpinelinux.org/alpine/v3.4/community 4 | -------------------------------------------------------------------------------- /alpine3.5-base/repositories: -------------------------------------------------------------------------------- 1 | http://mirrors.ustc.edu.cn/alpine/v3.5/main/ 2 | http://dl-cdn.alpinelinux.org/alpine/v3.5/main 3 | http://dl-cdn.alpinelinux.org/alpine/v3.5/community 4 | -------------------------------------------------------------------------------- /imagelist/centos7-zookeeper-3.4.6.txt: -------------------------------------------------------------------------------- 1 | demoregistry.dataman-inc.com/library/centos7-zookeeper-3.4.6:latest 2 | demoregistry.dataman-inc.com/library/centos7-zookeeper-3.4.6:20160712192532 3 | -------------------------------------------------------------------------------- /alpine3.3-base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.3 2 | 3 | # copy local repos 4 | COPY repositories /etc/apk/ 5 | 6 | #modify localtime 7 | RUN rm -f /etc/localtime 8 | COPY Shanghai /etc/localtime 9 | -------------------------------------------------------------------------------- /imagelist/jenkins-slave.txt: -------------------------------------------------------------------------------- 1 | demoregistry.dataman-inc.com/library/centos7-jdk8-jenkins-slave-base:latest 2 | demoregistry.dataman-inc.com/library/centos7-jdk8-jenkins-slave-base:20160614105538 3 | -------------------------------------------------------------------------------- /alpine3.3-drone-base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM demoregistry.dataman-inc.com/library/alpine3.3-base:latest 2 | 3 | RUN apk add -U ca-certificates git openssh curl perl subversion && rm -rf /var/cache/apk/* 4 | -------------------------------------------------------------------------------- /onecmdb2.1/readme.md: -------------------------------------------------------------------------------- 1 | 手册文档链接:http://www.docin.com/p-577006628.html 2 | 3 | 镜像地址:index.shurenyun.com/onecmdb:2.1 4 | 5 | docker run -p 8080:8080 index.shurenyun.com/onecmdb:2.1 6 | 7 | admin/123 8 | 9 | -------------------------------------------------------------------------------- /alpine3.4-base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.4 2 | MAINTAINER jyliu 3 | 4 | # copy local repos 5 | COPY repositories /etc/apk/ 6 | 7 | #modify localtime 8 | COPY Shanghai /etc/localtime 9 | -------------------------------------------------------------------------------- /alpine3.5-base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.5 2 | MAINTAINER jyliu 3 | 4 | # copy local repos 5 | COPY repositories /etc/apk/ 6 | 7 | #modify localtime 8 | COPY Shanghai /etc/localtime 9 | -------------------------------------------------------------------------------- /jenkins/docker/gitclone: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect -f 2 | set timeout 60 3 | 4 | spawn git clone git@github.com:Dataman-Cloud/jenkins-data.git 5 | 6 | expect "(yes/no)?" 7 | send "yes\r" 8 | 9 | expect eof 10 | exit 11 | -------------------------------------------------------------------------------- /imagelist/centos7-base.txt: -------------------------------------------------------------------------------- 1 | demoregistry.dataman-inc.com/library/centos7-base:latest 2 | demoregistry.dataman-inc.com/library/centos7-base:20160614110448 3 | demoregistry.dataman-inc.com/library/centos7-base:20170410105358 4 | -------------------------------------------------------------------------------- /imagelist/centos7-jdk8.txt: -------------------------------------------------------------------------------- 1 | demoregistry.dataman-inc.com/library/centos7-jdk8:latest 2 | demoregistry.dataman-inc.com/library/centos7-jdk8:20160712191822 3 | demoregistry.dataman-inc.com/library/centos7-jdk8:20160830201521 4 | -------------------------------------------------------------------------------- /imagelist/nginx-1.8.0.txt: -------------------------------------------------------------------------------- 1 | demoregistry.dataman-inc.com/library/centos7-nginx-1.8.0:latest 2 | demoregistry.dataman-inc.com/library/centos7-nginx-1.8.0:20160614153011 3 | demoregistry.dataman-inc.com/library/centos7-nginx-1.8.0:20160617111630 4 | -------------------------------------------------------------------------------- /MariaDBGalera/container-files/etc/my.cnf.d/charsets.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | character_set_server = utf8 3 | collation_server = utf8_unicode_ci 4 | skip-character-set-client-handshake 5 | 6 | [client] 7 | default_character_set = utf8 8 | -------------------------------------------------------------------------------- /imagelist/alpine3.3-drone-base.txt: -------------------------------------------------------------------------------- 1 | demoregistry.dataman-inc.com/library/alpine3.3-drone-base:latest 2 | demoregistry.dataman-inc.com/library/alpine3.3-drone-base:20160714102116 3 | demoregistry.dataman-inc.com/library/alpine3.3-drone-base:20160714103804 4 | -------------------------------------------------------------------------------- /mycat/mycat/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM offlineregistry.dataman-inc.com:5000/library/mycat-base:latest 2 | MAINTAINER yhchen 3 | 4 | COPY data/ /data/ 5 | EXPOSE 8066 9066 6 | 7 | CMD ["/bin/bash", "-c", "sh -x /data/mycat/bin/start_mycat.sh"] 8 | -------------------------------------------------------------------------------- /mesos/0.25/description.md: -------------------------------------------------------------------------------- 1 | ### 数人云组件镜像地址 2 | * mesos-master: catalog.shurenyun.com/library/mesos-master-0.25:omega.v0.5 3 | * mesos-slave : catalog.shurenyun.com/library/mesos-slave-0.25:omega.v0.5 4 | * marathon : catalog.shurenyun.com/library/marathon-0.13.1:omega.v0.5 5 | -------------------------------------------------------------------------------- /mesos/0.23/mesos-master/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos7/mesos-0.23.0-base 2 | MAINTAINER upccup yyao@dataman-inc.com 3 | 4 | #create mesos documents 5 | RUN mkdir -p /data/logs && \ 6 | mkdir -p /data/mesos 7 | 8 | #CMD ["/usr/sbin/mesos-master"] 9 | ENTRYPOINT ["/usr/sbin/mesos-master"] 10 | -------------------------------------------------------------------------------- /mesos/0.24/mesos-master/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos7/mesos-0.24.0-base 2 | MAINTAINER upccup yyao@dataman-inc.com 3 | 4 | #create mesos documents 5 | RUN mkdir -p /data/logs && \ 6 | mkdir -p /data/mesos 7 | 8 | #CMD ["/usr/sbin/mesos-master"] 9 | ENTRYPOINT ["/usr/sbin/mesos-master"] 10 | -------------------------------------------------------------------------------- /mesos/0.25/mesos-master/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos7/mesos-0.25.0-base 2 | MAINTAINER upccup yyao@dataman-inc.com 3 | 4 | #create mesos documents 5 | RUN mkdir -p /data/logs && \ 6 | mkdir -p /data/mesos 7 | 8 | #CMD ["/usr/sbin/mesos-master"] 9 | ENTRYPOINT ["/usr/sbin/mesos-master"] 10 | -------------------------------------------------------------------------------- /MariaDBGalera/container-files/etc/yum.repos.d/mariadb.repo: -------------------------------------------------------------------------------- 1 | # MariaDB 10.0 CentOS repository list 2 | # http://mariadb.org/mariadb/repositories/ 3 | [mariadb] 4 | name = MariaDB 5 | baseurl = http://yum.mariadb.org/10.1/centos7-amd64 6 | gpgkey = https://yum.mariadb.org/RPM-GPG-KEY-MariaDB 7 | gpgcheck = 1 8 | -------------------------------------------------------------------------------- /mycat/mycat-base/data/mycat/bin/start_mycat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #replace db info 4 | #sed -i 's/172.16.42.14/'"$MYSQL_IP"'/g' /data/mycat/conf/schema.xml 5 | #sed -i 's/3306/'"$MYSQL_PORT"'/g' /data/mycat/conf/schema.xml 6 | 7 | #run 8 | CMD="/data/mycat/bin/mycat console" 9 | exec $CMD 10 | 11 | -------------------------------------------------------------------------------- /jenkins/docker/run.sh: -------------------------------------------------------------------------------- 1 | docker run -d \ 2 | -e JAVA_OPTS="-Xmx512M -Xms512M" \ 3 | -e JENKINS_PORT="8002" \ 4 | --name jenkins --net host --privileged \ 5 | testregistry.dataman.io/centos7/mesos-0.23.0-jdk8-jenkins1.628-master 6 | -------------------------------------------------------------------------------- /centos7-jdk8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM demoregistry.dataman-inc.com/library/centos7-base:latest 2 | MAINTAINER jyliu jyliu@dataman-inc.com 3 | 4 | # install epel 5 | RUN yum install -y epel-release 6 | # install jdk 7 | RUN yum install -y java-1.8.0-openjdk && yum clean all 8 | # set JAVA_HOME 9 | ENV JAVA_HOME /usr/lib/jvm/jre-1.8.0 10 | -------------------------------------------------------------------------------- /MariaDBGalera/container-files/etc/my.cnf.d/logging.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | pid_file = /var/lib/mysql/mysql.pid 3 | log_error = /var/lib/mysql/error.log 4 | log_warnings = 2 5 | 6 | # General logging has huge performance penalty therefore is disabled by default 7 | general_log = off 8 | general_log_file = /var/lib/mysql/error.log 9 | -------------------------------------------------------------------------------- /mesos/0.23/marathon/dataman_marathon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | java -Djava.library.path=/usr/local/lib:/usr/lib:/usr/lib64 -Djava.util.logging.SimpleFormatter.format=%2$s%5$s%6$s%n $JAVA_OPTS -cp /usr/bin/marathon mesosphere.marathon.Main --hostname $MARATHON_HOSTNAME --event_subscriber $SUBSCRIBER --master $MESOS_ZK --zk $MARATHON_ZK --http_port $MARATHON_PORT 3 | -------------------------------------------------------------------------------- /mesos/0.24/marathon/dataman_marathon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | java -Djava.library.path=/usr/local/lib:/usr/lib:/usr/lib64 -Djava.util.logging.SimpleFormatter.format=%2$s%5$s%6$s%n $JAVA_OPTS -cp /usr/bin/marathon mesosphere.marathon.Main --hostname $MARATHON_HOSTNAME --event_subscriber $SUBSCRIBER --master $MESOS_ZK --zk $MARATHON_ZK --http_port $MARATHON_PORT 3 | -------------------------------------------------------------------------------- /mesos/0.25/marathon/dataman_marathon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | java -Djava.library.path=/usr/local/lib:/usr/lib:/usr/lib64 -Djava.util.logging.SimpleFormatter.format=%2$s%5$s%6$s%n $JAVA_OPTS -cp /usr/bin/marathon mesosphere.marathon.Main --hostname $MARATHON_HOSTNAME --event_subscriber $SUBSCRIBER --master $MESOS_ZK --zk $MARATHON_ZK --http_port $MARATHON_PORT 3 | -------------------------------------------------------------------------------- /MariaDBGalera/container-files/etc/my.cnf.d/galera.cnf: -------------------------------------------------------------------------------- 1 | [galera] 2 | # Mandatory settings 3 | wsrep_on=ON 4 | wsrep_provider=/usr/lib64/galera/libgalera_smm.so 5 | wsrep_cluster_address= 6 | binlog_format=row 7 | default_storage_engine=InnoDB 8 | innodb_autoinc_lock_mode=2 9 | bind-address=0.0.0.0 10 | # 11 | # Optional setting 12 | wsrep_slave_threads=1 13 | innodb_flush_log_at_trx_commit=0 14 | -------------------------------------------------------------------------------- /MariaDBGalera/container-files/etc/my.cnf.d/slowlog.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # Pre-configure slow logging. 3 | # Disabled it by default, but it can be switched on during runtime 4 | # and the log entries simply appear in the error.log 5 | # 6 | [mysqld] 7 | slow_query_log = off 8 | slow_query_log_file = /var/lib/mysql/error.log 9 | long_query_time = 3 10 | log_queries_not_using_indexes = on 11 | -------------------------------------------------------------------------------- /mesos/0.23/mesos-base/Dockerfile: -------------------------------------------------------------------------------- 1 | #FROM registry.shurenyun.com/centos7/base:omega.v0.2 2 | FROM centos7/base 3 | MAINTAINER upccup yyao@dataman-inc.com 4 | 5 | #install curl 6 | RUN yum -y install \ 7 | curl && \ 8 | 9 | #add dataman repo 10 | curl -o /etc/yum.repos.d/dataman.repo http://get.dataman-inc.com/repos/centos/7/0/dataman.repo 11 | 12 | 13 | #install mesos-base 14 | RUN yum install -y mesos-0.23.0 && yum clean all 15 | -------------------------------------------------------------------------------- /mycat/mycat/data/mycat/bin/start_mycat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #replace db info 4 | 5 | if [ -z "$MYSQL_IP" -o -z "$MYSQL_PORT" ]; then 6 | echo "please on docker run command add MYSQL_IP and MYSQL_PORT environment" 7 | exit -1 8 | fi 9 | sed -i 's/172.16.42.14/'"$MYSQL_IP"'/g' /data/mycat/conf/schema.xml 10 | sed -i 's/3306/'"$MYSQL_PORT"'/g' /data/mycat/conf/schema.xml 11 | 12 | #run 13 | CMD="/data/mycat/bin/mycat console" 14 | exec $CMD 15 | 16 | -------------------------------------------------------------------------------- /mesos/0.24/mesos-base/Dockerfile: -------------------------------------------------------------------------------- 1 | #FROM demoregistry.dataman-inc.com:5000/shurenyun/centos7-base:20160504103437 2 | FROM centos7/base:20160504 3 | MAINTAINER upccup yyao@dataman-inc.com 4 | 5 | #install curl 6 | RUN yum -y install \ 7 | curl && \ 8 | 9 | #add dataman repo 10 | curl -o /etc/yum.repos.d/dupccup.repo http://10.3.10.42/repos/CentOS/7/0/upccup.repo 11 | 12 | 13 | #install mesos-base 14 | RUN yum install -y mesos-0.24.1 && yum clean all 15 | -------------------------------------------------------------------------------- /mesos/0.25/mesos-base/Dockerfile: -------------------------------------------------------------------------------- 1 | #FROM demoregistry.dataman-inc.com:5000/shurenyun/centos7-base:20160504103437 2 | FROM centos7/base:20160504 3 | MAINTAINER upccup yyao@dataman-inc.com 4 | 5 | #install curl 6 | RUN yum -y install \ 7 | curl && \ 8 | 9 | #add dataman repo 10 | curl -o /etc/yum.repos.d/dupccup.repo http://10.3.10.42/repos/CentOS/7/0/upccup.repo 11 | 12 | 13 | #install mesos-base 14 | RUN yum install -y mesos-0.25.1 && yum clean all 15 | -------------------------------------------------------------------------------- /onecmdb2.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | 3 | MAINTAINER xjin@dataman-inc.com 4 | 5 | COPY onecmdb-2.1.0-linux.i386.tar.gz /root/ 6 | 7 | RUN yum install -y glibc.i686 8 | 9 | RUN cd /root && tar -xvf onecmdb-2.1.0-linux.i386.tar.gz && rm *.tar.gz 10 | 11 | COPY run.sh /root/onecmdb/ 12 | 13 | RUN chmod a+x /root/onecmdb/run.sh 14 | 15 | WORKDIR /root/onecmdb 16 | 17 | EXPOSE 8080 18 | 19 | CMD ./run.sh 20 | -------------------------------------------------------------------------------- /kafka/docker/docker_kafka.sh: -------------------------------------------------------------------------------- 1 | #docker run -d \ 2 | docker run -it --entrypoint=/bin/bash \ 3 | -e NUM_PARTITIONS=1 \ 4 | -e KAFKA_LOG=/data/log/kafka \ 5 | -e KAFKA_ZOOKEEPER_CONNECT=10.3.10.52:2181 \ 6 | -e KAFKA_PORT=9092 \ 7 | -e JMX_PORT=19092 \ 8 | -e KAFKA_HEAP_OPTS="-Xmx2G -Xms2G" \ 9 | --name kafka --net host \ 10 | -v /data/tools/kafka:/data/tools/kafka \ 11 | 10.3.10.33:5000/centos7/jdk7-scala2.11-kafka0.8.22:2015101501 12 | -------------------------------------------------------------------------------- /MariaDBGalera/container-files/etc/my.cnf.d/networking.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | bind_address = 0.0.0.0 3 | 4 | # When a client connects, the server will perform hostname resolution, 5 | # and when DNS is slow, establishing the connection will become slow as well. 6 | # It is therefore recommended to start the server with skip-name-resolve to 7 | # disable all DNS lookups. The only limitation is that the GRANT statements 8 | # must then use IP addresses only. 9 | skip_name_resolve 10 | 11 | [client] 12 | protocol = tcp 13 | -------------------------------------------------------------------------------- /mesos/0.23/mesos-slave/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos7/mesos-0.23.0-base 2 | MAINTAINER upccup yyao@dataman-inc.com 3 | 4 | COPY libapparmor.so.1 /lib64/ 5 | COPY libseccomp.so.2 /lib64/ 6 | 7 | #create mesos dir 8 | RUN mkdir -p /data/logs && \ 9 | mkdir -p /data/mesos && \ 10 | ln -s /lib64/libdevmapper.so.1.02 /lib64/libdevmapper.so.1.02.1 && \ 11 | # support suse 12 | ln -s /lib64/libdevmapper.so.1.02 /lib64/libdevmapper.so.1.03 13 | 14 | #CMD ["/usr/sbin/mesos-slave"] 15 | ENTRYPOINT ["/usr/sbin/mesos-slave"] 16 | -------------------------------------------------------------------------------- /mesos/0.24/mesos-slave/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos7/mesos-0.24.0-base 2 | MAINTAINER upccup yyao@dataman-inc.com 3 | 4 | COPY libapparmor.so.1 /lib64/ 5 | COPY libseccomp.so.2 /lib64/ 6 | 7 | #create mesos dir 8 | RUN mkdir -p /data/logs && \ 9 | mkdir -p /data/mesos && \ 10 | ln -s /lib64/libdevmapper.so.1.02 /lib64/libdevmapper.so.1.02.1 && \ 11 | # support suse 12 | ln -s /lib64/libdevmapper.so.1.02 /lib64/libdevmapper.so.1.03 13 | 14 | #CMD ["/usr/sbin/mesos-slave"] 15 | ENTRYPOINT ["/usr/sbin/mesos-slave"] 16 | -------------------------------------------------------------------------------- /mesos/0.25/mesos-slave/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos7/mesos-0.25.0-base 2 | MAINTAINER upccup yyao@dataman-inc.com 3 | 4 | COPY libapparmor.so.1 /lib64/ 5 | COPY libseccomp.so.2 /lib64/ 6 | 7 | #create mesos dir 8 | RUN mkdir -p /data/logs && \ 9 | mkdir -p /data/mesos && \ 10 | ln -s /lib64/libdevmapper.so.1.02 /lib64/libdevmapper.so.1.02.1 && \ 11 | # support suse 12 | ln -s /lib64/libdevmapper.so.1.02 /lib64/libdevmapper.so.1.03 13 | 14 | #CMD ["/usr/sbin/mesos-slave"] 15 | ENTRYPOINT ["/usr/sbin/mesos-slave"] 16 | -------------------------------------------------------------------------------- /mycat/mycat-base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM offlineregistry.dataman-inc.com:5000/library/centos7-base:latest 2 | MAINTAINER yhchen 3 | 4 | RUN mkdir -p /data 5 | COPY data/ /data/ 6 | COPY etc/ /etc/ 7 | 8 | RUN cd /data/ && rpm -ivh jdk-8u131-linux-x64.rpm && \ 9 | tar -zxf Mycat-server-1.5.1-RELEASE-20161130213509-linux.tar.gz 10 | ENV JAVA_HOME=/usr/java/jdk1.8.0_131 11 | ENV PATH=$JAVA_HOME/bin:/data/mycat/bin:$PATH 12 | 13 | EXPOSE 8066 9066 14 | 15 | CMD ["/bin/bash", "-c","sh -x /data/mycat/bin/start_mycat.sh"] 16 | -------------------------------------------------------------------------------- /alpine3.3-base/README.md: -------------------------------------------------------------------------------- 1 | # Alpine Linux 镜像源使用帮助 2 | 3 | ## 收录架构 4 | 5 | - armhf 6 | - x86 7 | - x86_64 8 | 9 | ## 使用说明 10 | 11 | 编辑/etc/apk/repositories,然后在文件的最顶端添加(注意将3.3换成需要的版本) 12 | 13 | http://mirrors.ustc.edu.cn/alpine/v3.3/main/ 14 | 15 | [参考wiki](http://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management#Packages_and_Repositories) 16 | 17 | ## 相关链接 18 | 19 | - 官方主页: http://alpinelinux.org/ 20 | - 邮件列表: http://www.archlinux.org/mailman/listinfo/ 21 | - 论坛: http://forum.alpinelinux.org/forum 22 | - Wiki: http://wiki.alpinelinux.org/ 23 | -------------------------------------------------------------------------------- /alpine3.4-base/README.md: -------------------------------------------------------------------------------- 1 | # Alpine Linux 镜像源使用帮助 2 | 3 | ## 收录架构 4 | 5 | - armhf 6 | - x86 7 | - x86_64 8 | 9 | ## 使用说明 10 | 11 | 编辑/etc/apk/repositories,然后在文件的最顶端添加(注意将3.4换成需要的版本) 12 | 13 | http://mirrors.ustc.edu.cn/alpine/v3.4/main/ 14 | 15 | [参考wiki](http://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management#Packages_and_Repositories) 16 | 17 | ## 相关链接 18 | 19 | - 官方主页: http://alpinelinux.org/ 20 | - 邮件列表: http://www.archlinux.org/mailman/listinfo/ 21 | - 论坛: http://forum.alpinelinux.org/forum 22 | - Wiki: http://wiki.alpinelinux.org/ 23 | -------------------------------------------------------------------------------- /alpine3.5-base/README.md: -------------------------------------------------------------------------------- 1 | # Alpine Linux 镜像源使用帮助 2 | 3 | ## 收录架构 4 | 5 | - armhf 6 | - x86 7 | - x86_64 8 | 9 | ## 使用说明 10 | 11 | 编辑/etc/apk/repositories,然后在文件的最顶端添加(注意将3.5换成需要的版本) 12 | 13 | http://mirrors.ustc.edu.cn/alpine/v3.5/main/ 14 | 15 | [参考wiki](http://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management#Packages_and_Repositories) 16 | 17 | ## 相关链接 18 | 19 | - 官方主页: http://alpinelinux.org/ 20 | - 邮件列表: http://www.archlinux.org/mailman/listinfo/ 21 | - 论坛: http://forum.alpinelinux.org/forum 22 | - Wiki: http://wiki.alpinelinux.org/ 23 | -------------------------------------------------------------------------------- /nginx/1.8.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM demoregistry.dataman-inc.com/library/centos7-base:latest 2 | MAINTAINER jyliu jyliu@dataman-inc.com 3 | 4 | #install nginx 5 | 6 | COPY nginx.repo /etc/yum.repos.d/ 7 | RUN yum install -y nginx-1.8.0 && yum clean all 8 | 9 | # forward request and error logs to docker log collector 10 | RUN ln -sf /dev/stdout /var/log/nginx/access.log 11 | RUN ln -sf /dev/stderr /var/log/nginx/error.log 12 | 13 | COPY nginx.conf /etc/nginx/nginx.conf 14 | 15 | COPY entrypoint.sh / 16 | RUN chmod +x /entrypoint.sh 17 | 18 | ENTRYPOINT ["/entrypoint.sh"] 19 | -------------------------------------------------------------------------------- /redis/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM offlineregistry.dataman-inc.com:5000/library/centos7-base:latest 2 | MAINTAINER yhchen 3 | 4 | RUN yum -y install wget && \ 5 | yum -y install make gcc && \ 6 | yum clean all && \ 7 | mkdir -p /data && \ 8 | cd /data/ && \ 9 | wget http://download.redis.io/releases/redis-3.0.7.tar.gz && \ 10 | tar -xzf redis-3.0.7.tar.gz && \ 11 | cd redis-3.0.7/ && \ 12 | make && \ 13 | make install && \ 14 | mkdir -p /data/store/redis 15 | COPY etc/ /etc/ 16 | 17 | EXPOSE 6379 18 | CMD ["/bin/bash", "-c", "/etc/init.d/redis start"] 19 | -------------------------------------------------------------------------------- /zookeeper/docker/run.sh: -------------------------------------------------------------------------------- 1 | docker rm -f dataman-zookeeper && \ 2 | service=dataman-zookeeper && \ 3 | MASTER_LIST=10.3.10.33 && \ 4 | ENNAME=eth0 && \ 5 | ZKLIST="$(echo $MASTER_LIST | sed "s/,/ /g" | sed "s/ /:2888:3888,/g"):2888:3888" && \ 6 | docker run -it \ 7 | -e ZKLIST="$ZKLIST" \ 8 | -e ENNAME="$ENNAME" \ 9 | --name $service --net host --restart always \ 10 | --net host \ 11 | library/centos7-zookeeper-3.4.6 12 | #--entrypoint=bash \ 13 | #-e ZOO_LOG_DIR=/data/logs/ \ 14 | #-e ZOO_LOG4J_PROP=INFO,CONSOLE \ 15 | #-e JAVA_OPTS="-Xmx512M -Xms256M" \ 16 | -------------------------------------------------------------------------------- /jenkins/docker/dataman_jenkins.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ ! -z "$DM_READ_URI" ];then 3 | /data/run/DM_DOCKER_URI.py 4 | USER=`whoami` 5 | #Jenkins Config bak 6 | if [ -f /$USER/.ssh/id_rsa ];then 7 | git config --global user.name $USER && \ 8 | git config --global user.email $USER@$HOST && \ 9 | chmod 400 /$USER/.ssh/id_rsa 10 | mkdir -p /data/tmp && \ 11 | cd /data/tmp && \ 12 | /data/run/gitclone && \ 13 | mv jenkins-data/* /var/lib/jenkins/ 14 | fi 15 | fi 16 | java ${JAVA_OPTS:-"-Xmx512M -Xms256M"} -jar /usr/lib/jenkins/jenkins.war --httpPort=${JENKINS_PORT:-8001} 17 | -------------------------------------------------------------------------------- /mesos/0.24/marathon/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos7/mesos-0.24.0-base 2 | MAINTAINER upccup yyao@dataman-inc.com 3 | 4 | ADD dataman_marathon.sh /usr/bin/ 5 | 6 | #add run_script 7 | RUN yum install -y curl && \ 8 | #add dataman repo 9 | curl -o /etc/yum.repos.d/upccup.repo http://10.3.10.42/repos/CentOS/7/0/upccup.repo && \ 10 | #install 11 | yum -y install marathon-0.11.1 && \ 12 | yum clean all && \ 13 | chmod 755 /usr/bin/dataman_marathon.sh && \ 14 | #logs 15 | mkdir -p /var/log/marathon && \ 16 | ln -sf /dev/stdout /var/log/marathon/marathon.log 17 | 18 | #CMD ["/usr/bin/dataman_marathon.sh"] 19 | ENTRYPOINT ["/usr/bin/dataman_marathon.sh"] 20 | -------------------------------------------------------------------------------- /mesos/0.25/marathon/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos7/mesos-0.25.0-base 2 | MAINTAINER upccup yyao@dataman-inc.com 3 | 4 | ADD dataman_marathon.sh /usr/bin/ 5 | 6 | #add run_script 7 | RUN yum install -y curl && \ 8 | #add dataman repo 9 | curl -o /etc/yum.repos.d/upccup.repo http://10.3.10.42/repos/CentOS/7/0/upccup.repo && \ 10 | #install 11 | yum -y install marathon-0.13.1 && \ 12 | yum clean all && \ 13 | chmod 755 /usr/bin/dataman_marathon.sh && \ 14 | #logs 15 | mkdir -p /var/log/marathon && \ 16 | ln -sf /dev/stdout /var/log/marathon/marathon.log 17 | 18 | #CMD ["/usr/bin/dataman_marathon.sh"] 19 | ENTRYPOINT ["/usr/bin/dataman_marathon.sh"] 20 | -------------------------------------------------------------------------------- /mesos/0.23/marathon/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos7/mesos-0.23.0-base 2 | MAINTAINER upccup yyao@dataman-inc.com 3 | 4 | ADD dataman_marathon.sh /usr/bin/ 5 | 6 | #add run_script 7 | RUN yum install -y curl && \ 8 | #add dataman repo 9 | curl -o /etc/yum.repos.d/dataman.repo http://get.dataman-inc.com/repos/centos/7/0/dataman.repo && \ 10 | #install 11 | yum -y install marathon && \ 12 | yum clean all && \ 13 | chmod 755 /usr/bin/dataman_marathon.sh && \ 14 | #logs 15 | mkdir -p /var/log/marathon && \ 16 | ln -sf /dev/stdout /var/log/marathon/marathon.log 17 | 18 | #CMD ["/usr/bin/dataman_marathon.sh"] 19 | ENTRYPOINT ["/usr/bin/dataman_marathon.sh"] 20 | -------------------------------------------------------------------------------- /centos7-base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:centos7 2 | MAINTAINER jyliu jyliu@dataman-inc.com 3 | 4 | # modify localtime 5 | RUN yum install -y iproute && yum clean all 6 | 7 | RUN rm -f /etc/localtime 8 | RUN ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 9 | 10 | # set LANG 11 | RUN localedef -i en_US -f UTF-8 en_US.UTF-8 12 | ENV LANG en_US.UTF-8 13 | 14 | # add filedownload script 15 | ADD https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/master/basefile/scripts/DM_DOCKER_URI_2.7.py /DM_DOCKER_URI.py 16 | ADD https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/master/basefile/scripts/filedownload.sh /filedownload.sh 17 | RUN chmod +x /*.py /*.sh 18 | -------------------------------------------------------------------------------- /basefile/scripts/filedownload.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 根据环境变量组合下载配置文件 3 | # Author : jyliu 4 | # Date : 2016.6.13 5 | 6 | if [ "x$CONFIG_SERVER" != "x" ];then 7 | filelist_url=$CONFIG_SERVER/config 8 | 9 | if [ "$MATCH_HOSTNAME" = "true" ];then 10 | filelist_url=$filelist_url/$(hostname) 11 | fi 12 | 13 | if [ "x$SERVICE" != "x" ];then 14 | filelist_url=$filelist_url/$SERVICE 15 | fi 16 | 17 | if [ "x$SERVICEPORT" != "x" ];then 18 | filelist_url=$filelist_url/$SERVICEPORT 19 | fi 20 | 21 | export DM_READ_URI=`curl $filelist_url/filelist.json` 22 | fi 23 | 24 | if [ "x$DM_READ_URI" != "x" ];then 25 | /DM_DOCKER_URI.py 26 | fi 27 | -------------------------------------------------------------------------------- /active-mq/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM offlineregistry.dataman-inc.com:5000/library/centos7-base:latest 2 | MAINTAINER yhchen 3 | 4 | RUN mkdir -p /data && cd /data && \ 5 | yum -y install wget && \ 6 | yum clean all && \ 7 | wget http://archive.apache.org/dist/activemq/5.13.1/apache-activemq-5.13.1-bin.tar.gz 8 | 9 | COPY data/ /data/ 10 | RUN cd /data/ && rpm -ivh jdk-8u131-linux-x64.rpm && \ 11 | tar -zxf apache-activemq-5.13.1-bin.tar.gz 12 | ENV JAVA_HOME=/usr/java/jdk1.8.0_131 13 | ENV PATH=$JAVA_HOME/bin:/data/apache-activemq-5.13.1/bin:$PATH 14 | 15 | EXPOSE 61616 5672 61613 1883 61614 8161 8162 16 | 17 | CMD ["/bin/bash", "-c", "sh -x /data/apache-activemq-5.13.1/bin/start_active-mq.sh"] 18 | -------------------------------------------------------------------------------- /jenkins/docker/jenkins-slave/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM demoregistry.dataman-inc.com/library/centos7-base 2 | MAINTAINER prometheus zpang@dataman-inc.com 3 | 4 | # install 5 | RUN yum install -y wget git && \ 6 | yum install -y epel-release && \ 7 | # install jdk 8 | yum install -y java-1.8.0-openjdk && \ 9 | yum clean all 10 | 11 | # docker use lib 12 | ADD https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/master/basefile/files/libapparmor.so.1 /lib64/ 13 | ADD https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/master/basefile/files/libltdl.so.7 /lib64/ 14 | ADD https://raw.githubusercontent.com/Dataman-Cloud/OpenDockerFile/master/basefile/files/libseccomp.so.2 /lib64/ 15 | RUN ln -s /lib64/libdevmapper.so.1.02 /lib64/libdevmapper.so.1.02.1 16 | -------------------------------------------------------------------------------- /kafka/docker/dataman.properties.template: -------------------------------------------------------------------------------- 1 | broker.id=--BROKER_ID-- 2 | port=--KAFKA_PORT-- 3 | log.dirs=--KAFKA_LOG-- 4 | host.name=--HOST-- 5 | advertised.host.name=--HOST-- 6 | 7 | zookeeper.connect=--KAFKA_ZOOKEEPER_CONNECT-- 8 | zookeeper.connection.timeout.ms=6000 9 | 10 | num.network.threads=3 11 | num.io.threads=8 12 | 13 | socket.send.buffer.bytes=102400 14 | socket.receive.buffer.bytes=102400 15 | socket.request.max.bytes=104857600 16 | 17 | num.partitions=--NUM_PARTITIONS-- 18 | num.recovery.threads.per.data.dir=1 19 | num.replica.fetchers=3 20 | 21 | log.retention.hours=168 22 | log.segment.bytes=1073741824 23 | log.retention.check.interval.ms=300000 24 | log.cleaner.enable=false 25 | log.roll.hours=6 26 | log.retention.minutes=3 27 | log.flush.interval.messages=100000 28 | 29 | delete.topic.enable=true 30 | -------------------------------------------------------------------------------- /kafka/docker/kafka_run_task.sh: -------------------------------------------------------------------------------- 1 | #create topic 2 | /usr/local/kafka/bin/kafka-topics.sh --zookeeper 10.3.10.52:2181 --create --partitions 3 --replication-factor 3 --topic pztest2 3 | #list topic 4 | /usr/local/kafka/bin/kafka-topics.sh --zookeeper 10.3.10.52:2181 --list 5 | #topic info 6 | /usr/local/kafka/bin/kafka-topics.sh --describe --zookeeper 10.3.10.52:2181 --topic pztest2 7 | #create producer 8 | /usr/local/kafka/bin/kafka-console-producer.sh --broker-list 10.3.10.3:9091,10.3.10.4:9091,10.3.10.5:9091 --topic pztest2 9 | #create consumer 10 | /usr/local/kafka/bin/kafka-console-consumer.sh --zookeeper 10.3.10.52:2181 --from-beginning --topic pztest2 11 | #producer perf test 12 | /usr/local/kafka/bin/kafka-producer-perf-test.sh --messages 500000 --message-size 1000 --batch-size 1000 --topics test1 --threads 4 --broker-list 10.3.10.3:9091,10.3.10.4:9091,10.3.10.5:9091 13 | -------------------------------------------------------------------------------- /zookeeper/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM demoregistry.dataman-inc.com/library/centos7-jdk8:latest 2 | MAINTAINER jyliu 3 | 4 | # install zookeeper 5 | RUN curl -o - http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz|tar -zxf - -C /opt \ 6 | && ln -s /opt/zookeeper-3.4.6 /usr/local/zookeeper 7 | 8 | # create URI dir 9 | RUN mkdir -p /data/run && \ 10 | mkdir -p /data/logs && \ 11 | # create zookeeper dir 12 | mkdir -p /data/zookeeper/zklog && \ 13 | mkdir -p /data/zookeeper/snapshot 14 | 15 | # copy zoo.cfg 16 | COPY zoo.cfg.template /usr/local/zookeeper/conf/zoo.cfg 17 | #env 18 | COPY zkServer.sh /usr/local/zookeeper/bin/ 19 | 20 | # run script 21 | COPY dataman_zookeeper.sh /data/run/ 22 | 23 | RUN chmod 755 /data/run/dataman_zookeeper.sh 24 | 25 | WORKDIR /usr/local/zookeeper 26 | EXPOSE 2181 2888 3888 27 | ENTRYPOINT ["/data/run/dataman_zookeeper.sh"] 28 | -------------------------------------------------------------------------------- /mycat/mycat-base/etc/pam.d/login: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so 3 | auth substack system-auth 4 | auth include postlogin 5 | account required pam_nologin.so 6 | account include system-auth 7 | password include system-auth 8 | # pam_selinux.so close should be the first session rule 9 | session required pam_selinux.so close 10 | session required pam_loginuid.so 11 | session optional pam_console.so 12 | # pam_selinux.so open should only be followed by sessions to be executed in the user context 13 | session required pam_selinux.so open 14 | session required pam_namespace.so 15 | session optional pam_keyinit.so force revoke 16 | session include system-auth 17 | session include postlogin 18 | -session optional pam_ck_connector.so 19 | session required pam_limits.so 20 | -------------------------------------------------------------------------------- /MariaDBGalera/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:centos7 2 | MAINTAINER weitao zhou 3 | 4 | RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 5 | 6 | # Copy only files required for the following RUN commands (leverage Docker caching) 7 | COPY container-files/etc/yum.repos.d/* /etc/yum.repos.d/ 8 | 9 | RUN \ 10 | yum update -y && \ 11 | yum install -y epel-release && \ 12 | yum install -y MariaDB-server MariaDB-client hostname net-tools pwgen && \ 13 | yum clean all && \ 14 | rm -rf /var/lib/mysql/* 15 | 16 | # Add all remaining files to the container 17 | COPY container-files / 18 | ENV WSREP_CLUSTER_ADDRESS "" 19 | 20 | # Add VOLUME to allow backup of data 21 | VOLUME ["/var/lib/mysql"] 22 | 23 | # Set TERM env to avoid mysql client error message "TERM environment variable not set" when running from inside the container 24 | ENV TERM xterm 25 | 26 | EXPOSE 3306 4567 4568 4444 27 | 28 | CMD ["/run.sh"] 29 | -------------------------------------------------------------------------------- /MariaDBGalera/container-files/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -u 5 | source ./mariadb-functions.sh 6 | 7 | # User-provided env variables 8 | MARIADB_USER=${MARIADB_USER:="admin"} 9 | MARIADB_PASS=${MARIADB_PASS:-$(pwgen -s 12 1)} 10 | 11 | # Other variables 12 | VOLUME_HOME="/var/lib/mysql" 13 | ERROR_LOG="$VOLUME_HOME/error.log" 14 | MYSQLD_PID_FILE="$VOLUME_HOME/mysql.pid" 15 | 16 | # Trap INT and TERM signals to do clean DB shutdown 17 | trap terminate_db SIGINT SIGTERM 18 | 19 | install_db 20 | tail -F $ERROR_LOG & # tail all db logs to stdout 21 | 22 | /usr/bin/mysqld_safe --wsrep_cluster_address=gcomm://${WSREP_CLUSTER_ADDRESS} & # Launch DB server in the background 23 | MYSQLD_SAFE_PID=$! 24 | 25 | wait_for_db 26 | secure_and_tidy_db 27 | show_db_status 28 | 29 | if [ x${WSREP_CLUSTER_ADDRESS} = x ]; then 30 | create_admin_user 31 | fi 32 | 33 | # Do not exit this script untill mysqld_safe exits gracefully 34 | wait $MYSQLD_SAFE_PID 35 | -------------------------------------------------------------------------------- /jenkins/docker/jenkins-base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos7/mesos-0.23.0-base 2 | # centos7/mesos-0.23.0-base is our private mesos image 3 | MAINTAINER prometheus zpang@dataman-inc.com 4 | 5 | # jenkins_home 6 | ENV JENKINS_HOME /var/lib/jenkins 7 | 8 | # install 9 | RUN yum install -y wget git && \ 10 | yum install -y epel-release && \ 11 | # install jdk 12 | yum install -y java-1.8.0-openjdk && \ 13 | # install jenkins 14 | wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo && \ 15 | rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key && \ 16 | yum install -y jenkins && \ 17 | yum clean all 18 | 19 | # create mesos logs documents 20 | RUN mkdir -p /mnt/mesos/sanbox && \ 21 | # create mesos documents 22 | mkdir -p /var/lib/jenkins/ 23 | 24 | # docker use lib 25 | COPY libdevmapper.so.1.02.1 /lib64/ 26 | COPY libapparmor.so.1 /lib64/ 27 | RUN ln -s /lib64/libdevmapper.so.1.02.1 /lib64/libdevmapper.so.1.02 28 | -------------------------------------------------------------------------------- /jenkins/docker/jenkins-master/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos7/mesos-0.23.0/jdk8/jenkins1.628/base 2 | MAINTAINER prometheus zpang@dataman-inc.com 3 | 4 | # seng git user 5 | RUN git config --global user.name `whoami` && \ 6 | git config --global user.email "jenkins@dataman-inc.com" 7 | 8 | # install expect 9 | RUN yum install -y expect && \ 10 | yum clean all 11 | 12 | # create dir 13 | RUN mkdir -p /var/lib/jenkins/plugins/ && \ 14 | mkdir -p /root/.ssh/ && \ 15 | chmod 755 /root/.ssh/ && \ 16 | mkdir -p /data/run && \ 17 | mkdir -p /data/logs 18 | 19 | # copy 20 | # plugin 21 | COPY plugins/*.jpi /var/lib/jenkins/plugins/ 22 | # git use 23 | COPY gitclone /data/run/ 24 | # remote script 25 | ADD http://10.3.10.33/config/scripts/DM_DOCKER_URI_2.7.py /data/run/DM_DOCKER_URI.py 26 | #COPY DM_DOCKER_URI_2.7.py /data/run/DM_DOCKER_URI.py 27 | # jenkin run script 28 | COPY dataman_jenkins.sh /data/run/ 29 | RUN chmod 755 /data/run/gitclone && \ 30 | chmod 755 /data/run/DM_DOCKER_URI.py && \ 31 | chmod 755 /data/run/dataman_jenkins.sh 32 | 33 | ENTRYPOINT ["/data/run/dataman_jenkins.sh"] 34 | -------------------------------------------------------------------------------- /kafka/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos7/jdk7 2 | MAINTAINER pro zpang@dataman-inc.com 3 | 4 | #modify localtime 5 | RUN cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 6 | 7 | #install base 8 | RUN yum install -y \ 9 | epel-release \ 10 | wget \ 11 | curl && \ 12 | yum clean all 13 | 14 | #kafuka env 15 | ENV KAFKA_VERSION="0.8.2.2" SCALA_VERSION="2.11" 16 | ENV P_NAME kafka_${SCALA_VERSION}-${KAFKA_VERSION} 17 | ENV KAFKA_INSTALL_HOME /opt/${P_NAME} 18 | ENV KAFKA_HOME /usr/local/kafka 19 | 20 | #install kafka 21 | RUN wget -q http://www.eu.apache.org/dist/kafka/${KAFKA_VERSION}/${P_NAME}.tgz -O "/tmp/${P_NAME}.tgz" && \ 22 | tar xf /tmp/${P_NAME}.tgz -C /opt/ && \ 23 | rm -f /tmp/${P_NAME}.tgz && \ 24 | /bin/chmod -R 775 $KAFKA_INSTALL_HOME && \ 25 | /bin/ln -s $KAFKA_INSTALL_HOME $KAFKA_HOME 26 | 27 | # create dir 28 | RUN mkdir -p /data/run && \ 29 | mkdir -p /data/logs 30 | 31 | # remote script 32 | COPY dataman.properties.template /usr/local/kafka/config/dataman.properties.template 33 | COPY kafka-marathon-bootstrap.sh /data/run/kafka-marathon-bootstrap.sh 34 | RUN chmod 755 /data/run/kafka-marathon-bootstrap.sh 35 | ENTRYPOINT ["/data/run/kafka-marathon-bootstrap.sh"] 36 | -------------------------------------------------------------------------------- /zookeeper/docker/dataman_zookeeper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -z $ZOOCFGDIR ];then 4 | ZOOCFGDIR="/usr/local/zookeeper/conf" 5 | fi 6 | 7 | if [ ! -z "$ZKLIST" ];then 8 | if [ -z "$ENNAME" ];then 9 | ENNAME=eth0 10 | fi 11 | localip=`ip addr show $ENNAME|grep "inet.*scope.*global.*$ENNAME"|awk '{print $2}'|awk -F/ '{print $1}'|head -1` 12 | zks="" 13 | i=1 14 | for server in `echo $ZKLIST|sed 's/\,/ /g'`;do 15 | zks+="server.$i=$server\n" 16 | ip=${server%%:*} 17 | if [ "$ip" == "$localip" ];then 18 | ZKID=$i 19 | fi 20 | let i=$i+1 21 | done 22 | mkdir -p /data/zookeeper/{snapshot,zklog} 23 | 24 | if [ -z "$ZKID" ];then 25 | ZKID=`hostname -s|grep -o '[[:digit:]]*'|tail -1` 26 | fi 27 | 28 | if [ -z "$ZKID" ];then 29 | ZKID=`echo $ip|awk '{print $1}'|awk -F. '{print $4}'` 30 | fi 31 | echo "$ZKID" > /data/zookeeper/snapshot/myid && \ 32 | sed -i 's/--serverlist--/'$zks'/g' $ZOOCFGDIR/zoo.cfg && \ 33 | sed -i 's/--listen_ip--/'$localip'/g' $ZOOCFGDIR/zoo.cfg 34 | else 35 | sed -i 's/--serverlist--//g' $ZOOCFGDIR/zoo.cfg && \ 36 | sed -i 's/--listen_ip--//g' $ZOOCFGDIR/zoo.cfg 37 | fi 38 | 39 | if [ $? -eq 0 ];then 40 | /usr/local/zookeeper/bin/zkServer.sh start-foreground 41 | fi 42 | -------------------------------------------------------------------------------- /MariaDBGalera/README.md: -------------------------------------------------------------------------------- 1 | MariaDB Galera 2 | ============== 3 | 4 | ## How to use it 5 | 6 | 1. build the docker image 7 | 8 | ```bash 9 | docker build -t mariadb-galera:10.0 . 10 | ``` 11 | 12 | 2. start the first node at nodeA 13 | 14 | ```bash 15 | docker run -p 3306:3306 -p 4567:4567 -p 4568:4568 -p 4444:4444 -v /data/mysql:/var/lib/mysql -e MARIADB_USER=root -e MARIADB_PASS=password --restart=always --name=master_db -d mariadb-galera:10.0 16 | ``` 17 | 18 | 3. start the second, third nodes at the related nodes 19 | 20 | ```bash 21 | docker run -p 3306:3306 -p 4567:4567 -p 4568:4568 -p 4444:4444 -v /data/mysql:/var/lib/mysql -e MARIADB_USER=root -e MARIADB_PASS=password -e WSREP_CLUSTER_ADDRESS=IP.nodeA --name=joiner_db --restart=always -d mariadb-galera:10.0 22 | ``` 23 | 24 | 4. check the cluster status 25 | 26 | You can get the cluster status info by the following cmds: 27 | 28 | ```bash 29 | docker exec -it joiner_db bash 30 | mysql -uroot -ppassword -e "SHOW STATUS LIKE 'wsrep_%';" 31 | ``` 32 | 33 | ## Issues 34 | 35 | 1. In my servers, the 2nd, 3rd etc. nodes failed to start&join the cluster always when I run the container joiner. To make it, I have to restart the exited container once more. So here I am setting `--restart=always` . 36 | -------------------------------------------------------------------------------- /kafka/docker/kafka-marathon-bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | # Get the last Host IP octet 4 | HOST=$(ip addr show eth0 | grep inet.*brd.*eth0 | awk '{print $2}'| awk -F '/' '{print $1}') 5 | 6 | # Create unique broker.id as combination of last octet and the given Marathon Docker porBROKER_ID="${ip4}${PORT0}" 7 | BROKER_ID=$(ip addr show eth0 | grep inet.*brd.*eth0 | awk '{print $2}'| awk -F '/' '{print $1}' | awk -F '.' '{print $4}') 8 | 9 | echo $BROKER_ID 10 | # change server.properties config file 11 | cd $KAFKA_HOME/config/ && \ 12 | cp dataman.properties.template dataman.properties && \ 13 | sed -i 's#\-\-BROKER_ID\-\-#'${BROKER_ID}'#g' dataman.properties && \ 14 | sed -i 's#\-\-HOST\-\-#'${HOST}'#g' dataman.properties && \ 15 | sed -i 's#\-\-KAFKA_PORT\-\-#'${KAFKA_PORT:-"9092"}'#g' dataman.properties && \ 16 | sed -i 's#\-\-KAFKA_LOG\-\-#'${KAFKA_LOG:-"/data/log/kafka"}'#g' dataman.properties && \ 17 | sed -i 's#\-\-KAFKA_ZOOKEEPER_CONNECT\-\-#'${KAFKA_ZOOKEEPER_CONNECT:-"localhost:2181"}'#g' dataman.properties && \ 18 | sed -i 's#\-\-NUM_PARTITIONS\-\-#'${NUM_PARTITIONS:-"10"}'#g' dataman.properties && \ 19 | export JMX_PORT="${JMX_PORT}" 20 | 21 | #run kafka broker 22 | if [ $? -eq 0 ];then 23 | $KAFKA_HOME/bin/kafka-server-start.sh $KAFKA_HOME/config/dataman.properties 24 | fi 25 | -------------------------------------------------------------------------------- /redis/etc/init.d/redis: -------------------------------------------------------------------------------- 1 | ########################### 2 | PATH=/usr/local/bin:/sbin:/usr/bin:/bin 3 | REDISPORT=6379 4 | EXEC="exec /usr/local/bin/redis-server " 5 | REDIS_CLI=/usr/local/bin/redis-cli 6 | PIDFILE=/var/run/redis.pid 7 | CONF="/etc/redis.conf" 8 | case "$1" in 9 | start) 10 | if [ -f $PIDFILE ] 11 | then 12 | echo "$PIDFILE exists, process is already running or crashed" 13 | else 14 | echo "Starting Redis server..." 15 | $EXEC $CONF 16 | fi 17 | if [ "$?"="0" ] 18 | then 19 | echo "Redis is running..." 20 | fi 21 | ;; 22 | stop) 23 | if [ ! -f $PIDFILE ] 24 | then 25 | echo "$PIDFILE does not exist, process is not running" 26 | else 27 | PID=$(cat $PIDFILE) 28 | echo "Stopping ..." 29 | $REDIS_CLI -p $REDISPORT SHUTDOWN 30 | while [ -x ${PIDFILE} ] 31 | do 32 | echo "Waiting for Redis to shutdown ..." 33 | sleep 1 34 | done 35 | echo "Redis stopped" 36 | fi 37 | ;; 38 | restart|force-reload) 39 | ${0} stop 40 | ${0} start 41 | ;; 42 | *) 43 | echo "Usage: /etc/init.d/redis {start|stop|restart|force-reload}" >&2 44 | exit 1 45 | esac 46 | ############################## 47 | -------------------------------------------------------------------------------- /performance/sysctl.conf: -------------------------------------------------------------------------------- 1 | net.netfilter.nf_conntrack_max = 1000000 2 | kernel.unknown_nmi_panic = 0 3 | kernel.sysrq = 0 4 | fs.file-max = 655350 5 | vm.swappiness = 10 6 | fs.inotify.max_user_watches = 10000000 7 | net.core.wmem_max = 16777216 8 | net.core.rmem_max = 16777216 9 | net.ipv4.conf.all.send_redirects = 0 10 | net.ipv4.conf.default.send_redirects = 0 11 | net.ipv4.conf.all.secure_redirects = 0 12 | net.ipv4.conf.default.secure_redirects = 0 13 | net.ipv4.conf.all.accept_redirects = 0 14 | net.ipv4.conf.default.accept_redirects = 0 15 | fs.inotify.max_queued_events = 327679 16 | kernel.msgmnb = 65536 17 | kernel.msgmax = 65536 18 | kernel.shmmax = 68719476736 19 | kernel.shmall = 4294967296 20 | net.ipv4.neigh.default.gc_thresh1 = 2048 21 | net.ipv4.neigh.default.gc_thresh2 = 4096 22 | net.ipv4.neigh.default.gc_thresh3 = 8192 23 | net.ipv6.conf.all.disable_ipv6 = 1 24 | net.ipv4.tcp_syncookies = 1 25 | net.ipv4.tcp_tw_reuse = 1 26 | net.core.rmem_default = 16777216 27 | net.core.wmem_default = 16777216 28 | net.core.optmem_max = 40960 29 | net.ipv4.tcp_max_tw_buckets = 2000000 30 | net.ipv4.tcp_max_syn_backlog = 30000 31 | net.ipv4.tcp_max_orphans = 262144 32 | net.core.somaxconn = 4096 33 | net.core.netdev_max_backlog = 50000 34 | net.ipv4.tcp_synack_retries = 2 35 | net.ipv4.tcp_syn_retries = 2 36 | net.ipv4.tcp_fin_timeout = 7 37 | net.ipv4.tcp_slow_start_after_idle = 0 38 | net.ipv4.tcp_keepalive_probes = 5 39 | net.ipv4.tcp_keepalive_intvl = 3 40 | net.ipv4.tcp_timestamps = 0 41 | net.ipv4.tcp_sack = 1 42 | net.ipv4.tcp_window_scaling = 1 43 | net.ipv4.tcp_abort_on_overflow = 1 44 | -------------------------------------------------------------------------------- /nginx/1.8.0/nginx.conf: -------------------------------------------------------------------------------- 1 | user nginx; 2 | worker_rlimit_nofile 65535; 3 | worker_processes auto; 4 | 5 | error_log /var/log/nginx/error.log warn; 6 | pid /var/run/nginx.pid; 7 | 8 | 9 | events { 10 | use epoll; 11 | worker_connections 65535; 12 | multi_accept on; 13 | } 14 | 15 | 16 | http { 17 | include /etc/nginx/mime.types; 18 | default_type application/octet-stream; 19 | autoindex off; 20 | 21 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 22 | '$status $body_bytes_sent "$http_referer" ' 23 | '"$http_user_agent" "$http_x_forwarded_for"'; 24 | 25 | access_log /var/log/nginx/access.log main; 26 | #access_log off; 27 | error_log /var/log/nginx/error.log crit; 28 | 29 | server_tokens off; 30 | sendfile on; 31 | tcp_nopush on; 32 | tcp_nodelay on; 33 | 34 | keepalive_timeout 65; 35 | 36 | server_names_hash_bucket_size 128; 37 | client_header_buffer_size 2k; 38 | large_client_header_buffers 4 4k; 39 | client_max_body_size 8m; 40 | 41 | open_file_cache max=65535 inactive=60s; 42 | open_file_cache_valid 80s; 43 | open_file_cache_min_uses 1; 44 | open_file_cache_errors on; 45 | 46 | gzip on; 47 | gzip_min_length 1k; 48 | gzip_buffers 4 16k; 49 | gzip_http_version 1.0; 50 | gzip_comp_level 2; 51 | gzip_types text/plain application/x-javascript text/css application/xml application/json; 52 | gzip_vary on; 53 | 54 | include /etc/nginx/conf.d/*.conf; 55 | } 56 | daemon off; 57 | -------------------------------------------------------------------------------- /zookeeper/docker/zoo.cfg.template: -------------------------------------------------------------------------------- 1 | # http://hadoop.apache.org/zookeeper/docs/current/zookeeperAdmin.html 2 | 3 | # The number of milliseconds of each tick 4 | tickTime=2000 5 | # The number of ticks that the initial 6 | # synchronization phase can take 7 | initLimit=10 8 | # The number of ticks that can pass between 9 | # sending a request and getting an acknowledgement 10 | syncLimit=5 11 | # the directory where the snapshot is stored. 12 | #dataDir=/var/lib/zookeeper 13 | dataDir=/data/zookeeper/snapshot 14 | # Place the dataLogDir to a separate physical disc for better performance 15 | # dataLogDir=/disk2/zookeeper 16 | dataLogDir=/data/zookeeper/zklog 17 | 18 | # the port at which the clients will connect 19 | clientPort=2181 20 | clientPortAddress=--listen_ip-- 21 | # specify all zookeeper servers 22 | # The fist port is used by followers to connect to the leader 23 | # The second one is used for leader election 24 | --serverlist-- 25 | 26 | # To avoid seeks ZooKeeper allocates space in the transaction log file in 27 | # blocks of preAllocSize kilobytes. The default block size is 64M. One reason 28 | # for changing the size of the blocks is to reduce the block size if snapshots 29 | # are taken more often. (Also, see snapCount). 30 | #preAllocSize=65536 31 | 32 | # Clients can submit requests faster than ZooKeeper can process them, 33 | # especially if there are a lot of clients. To prevent ZooKeeper from running 34 | # out of memory due to queued requests, ZooKeeper will throttle clients so that 35 | # there is no more than globalOutstandingLimit outstanding requests in the 36 | # system. The default limit is 1,000.ZooKeeper logs transactions to a 37 | # transaction log. After snapCount transactions are written to a log file a 38 | # snapshot is started and a new transaction log file is started. The default 39 | # snapCount is 10,000. 40 | #snapCount=1000 41 | 42 | # If this option is defined, requests will be will logged to a trace file named 43 | # traceFile.year.month.day. 44 | #traceFile= 45 | 46 | # Leader accepts client connections. Default value is "yes". The leader machine 47 | # coordinates updates. For higher update throughput at thes slight expense of 48 | # read throughput the leader can be configured to not accept clients and focus 49 | # on coordination. 50 | #leaderServes=yes 51 | autopurge.purgeInterval=3 52 | autopurge.snapRetainCount=3 53 | -------------------------------------------------------------------------------- /zookeeper/部署Zookeeper集群.md: -------------------------------------------------------------------------------- 1 | ## 第一步 建立集群(应用发布环境)​ 2 | 3 | 文档信息 4 | 创建人 刘金烨 5 | 邮件地址 jyliu@dataman-inc.com 6 | 建立时间 2015年12月1号 7 | 更新时间 2015年12月3号 8 | 9 | ### 1.1 准备主机 10 | 11 | 需要准备至少2台主机 12 | 本文中使用了6台主机为大家更好的展现如何搭建集群环境。 13 | 14 | 注:主机既包括可以连接互联网的物理主机,也可以是阿里云、UCloud、 AWS、Azure、首都在线和华为云等公有云上购买的任意一台云主机。 15 | 16 | ### 1.2 建立集群 17 | 18 | 登录数人云 www.shurenyun.com ,在集群管理中,点击"新建集群" 19 | 填写集群名称"es-demo",选择 3 Master 高级版集群,点击完成。(如图所示) 20 | 21 | 注:创建 3 Master 集群是为了防止单点故障,保障集群的高可用。生产环境为了保证服务的高可用,我们建议选择 3 Master 或 5 Master 集群。 22 | ![alt text](./img/createcluster.png) 23 | 24 | ### 1.3 添加主机 25 | 26 | 将6台主机分别添加到集群"es-demo"中 27 | 28 | 不同主机选择不同的主机类型,并根据提示安装docker和Agent。 29 | 30 | 前三台主机为Master节点,主机类型请选择"计算节点" 和 "数据节点"; 31 | 32 | 第四、五、六台主机选择计算节点,用于部署应用; 33 | 34 | 节点类型定义:(一个节点可同时为多个类型) 35 | 36 | 计算节点:作为集群中动态可支配的计算资源,运行各种无状态应用。 37 | 38 | 数据节点:将作为集群中数据持久化的节点使用,请将有状态应用(Mysql,Redis等)部署于此节点。 39 | 40 | 外部网关:将用作集群应用的外部访问入口,此节点需要有固定的公网IP。 41 | 42 | 内部代理:将用作集群内部不同服务之间的访问。 43 | 44 | 提示: 45 | 46 | 实现本案例,所需最小规模集群为2台主机,一台为 Master 节点,另一台包括所有节点类型。本次操作选用6台主机是为了向大家模拟真实集群生产环境。 47 | 向同一集群添加的主机应存在于同一网段内部,暂不支持跨公网的主机组建集群。 48 | 49 | 添加master节点,如图所示 50 | ![alt text](./img/createmaster.png "添加3台master主机中的其中一台") 51 | 添加slave节点,如图所示 52 | ![alt text](./img/createslave.png "添加3台slave主机中的其中一台") 53 | 54 | ### 1.4 确认集群环境正常 55 | 56 | 主机添加完成后,检查主机运行是否正常,查看群集如图所示: 57 | ![alt text](./img/clusterlist.png) 58 | 59 | ## 第二步发布应用 60 | 61 | ### 2.1 新建 Zookeeper 应用 62 | 63 | 点击"新建应用",按照如下提示,新建Zookeeper应用: 64 | 65 | 填写应用名称:zookeeper 66 | 67 | 选择集群:es-demo 68 | 69 | 添加应用镜像地址:testregistry.dataman.io/centos7/zookeeper-3.4.6 (数人云演示镜像) 70 | 71 | 填写镜像版本:2015120202 72 | 73 | 选择应用模式:HOST 模式 74 | 75 | 选择应用类型:无状态应用 76 | 77 | 主机选择:10.3.10.17,10.3.10.47,10.3.10.61 78 | 79 | 选择容器规格: CPU:0.2 内存:512 MB 80 | 81 | 添加环境变量 82 | 83 | ZKLIST: 10.3.10.17:2888:3888,10.3.10.47:2888:3888,10.3.10.61:2888:3888 84 | 85 | ENNAME: eth0 (slave主机的内网IP网卡名称,默认为eth0) 86 | 87 | 新建zookeeper应用,如图所示 88 | ![alt text](./img/createzk1.png) 89 | ![alt text](./img/createzk2.png) 90 | 91 | 检查zookeeper应用正常运行 92 | 93 | 应用列表如图: 94 | ![alt text](./img/zklist.png) 95 | 96 | 命令行确认zookeeper是正常的 97 | ![alt text](./img/checkzk.png) 98 | 99 | 到此,3个节点的zookeeper的集群就部署完成啦! 100 | ## 后续 101 | ### Dockerfile 102 | 所使用的 Dockerfile 和启动脚本全部开源,并上传到了数人的[GITHUB](https://github.com/Dataman-Cloud/OpenDockerFile/tree/master/zookeeper),有兴趣的同学可以帮助一起改进。 -------------------------------------------------------------------------------- /mycat/mycat-base/etc/security/limits.conf: -------------------------------------------------------------------------------- 1 | # /etc/security/limits.conf 2 | # 3 | #This file sets the resource limits for the users logged in via PAM. 4 | #It does not affect resource limits of the system services. 5 | # 6 | #Also note that configuration files in /etc/security/limits.d directory, 7 | #which are read in alphabetical order, override the settings in this 8 | #file in case the domain is the same or more specific. 9 | #That means for example that setting a limit for wildcard domain here 10 | #can be overriden with a wildcard setting in a config file in the 11 | #subdirectory, but a user specific setting here can be overriden only 12 | #with a user specific setting in the subdirectory. 13 | # 14 | #Each line describes a limit for a user in the form: 15 | # 16 | # 17 | # 18 | #Where: 19 | # can be: 20 | # - a user name 21 | # - a group name, with @group syntax 22 | # - the wildcard *, for default entry 23 | # - the wildcard %, can be also used with %group syntax, 24 | # for maxlogin limit 25 | # 26 | # can have the two values: 27 | # - "soft" for enforcing the soft limits 28 | # - "hard" for enforcing hard limits 29 | # 30 | # can be one of the following: 31 | # - core - limits the core file size (KB) 32 | # - data - max data size (KB) 33 | # - fsize - maximum filesize (KB) 34 | # - memlock - max locked-in-memory address space (KB) 35 | # - nofile - max number of open file descriptors 36 | # - rss - max resident set size (KB) 37 | # - stack - max stack size (KB) 38 | # - cpu - max CPU time (MIN) 39 | # - nproc - max number of processes 40 | # - as - address space limit (KB) 41 | # - maxlogins - max number of logins for this user 42 | # - maxsyslogins - max number of logins on the system 43 | # - priority - the priority to run user process with 44 | # - locks - max number of file locks the user can hold 45 | # - sigpending - max number of pending signals 46 | # - msgqueue - max memory used by POSIX message queues (bytes) 47 | # - nice - max nice priority allowed to raise to values: [-20, 19] 48 | # - rtprio - max realtime priority 49 | # 50 | # 51 | # 52 | 53 | #* soft core 0 54 | #* hard rss 10000 55 | #@student hard nproc 20 56 | #@faculty soft nproc 20 57 | #@faculty hard nproc 50 58 | #ftp hard nproc 0 59 | #@student - maxlogins 4 60 | 61 | # End of file 62 | 63 | 64 | mycat soft nproc 16384 65 | mycat hard nproc 16384 66 | mycat soft nofile 65536 67 | mycat hard nofile 65536 68 | mycat soft stack 10240 69 | -------------------------------------------------------------------------------- /MariaDBGalera/container-files/etc/my.cnf.d/tuning.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | max_allowed_packet = 16M 3 | 4 | # Sort buffer is used to perform sorts for some ORDER BY and GROUP BY 5 | # queries. If sorted data does not fit into the sort buffer, a disk 6 | # based merge sort is used instead - See the "Sort_merge_passes" 7 | # status variable. Allocated per thread if sort is needed. 8 | sort_buffer_size = 1M 9 | 10 | # Size of the buffer used for doing full table scans. 11 | # Allocated per thread, if a full scan is needed. 12 | read_buffer_size = 1M 13 | 14 | # When reading rows in sorted order after a sort, the rows are read 15 | # through this buffer to avoid disk seeks. You can improve ORDER BY 16 | # performance a lot, if set this to a high value. 17 | # Allocated per thread, when needed. 18 | read_rnd_buffer_size = 8M 19 | 20 | join_buffer_size = 1M 21 | 22 | # Maximum allowed size for a single HEAP (in memory) table. This option 23 | # is a protection against the accidential creation of a very large HEAP 24 | # table which could otherwise use up all memory resources. 25 | max_heap_table_size = 64M 26 | 27 | ## Generally, it is unwise to set the query cache to be larger than 64-128M 28 | ## as the costs associated with maintaining the cache outweigh the performance 29 | ## gains. 30 | ## The query cache is a well known bottleneck that can be seen even when 31 | ## concurrency is moderate. The best option is to disable it from day 1 32 | ## by setting query_cache_size = 0 (now the default on MySQL 5.6) 33 | ## and to use other ways to speed up read queries: good indexing, adding 34 | ## replicas to spread the read load or using an external cache. 35 | # query_cache_size = 32M 36 | 37 | thread_cache_size = 16 38 | table_open_cache = 2048 39 | table_definition_cache = 1024 40 | 41 | # 42 | # InnoDB 43 | # 44 | # The buffer pool is where data and indexes are cached: having it as large as possible 45 | # will ensure you use memory and not disks for most read operations. 46 | # Typical values are 50..75% of available RAM. 47 | innodb_buffer_pool_size = 768M # 75% of 1GB RAM 48 | innodb_log_file_size = 128M 49 | innodb_flush_method = O_DIRECT 50 | 51 | # The default setting of 1 means that InnoDB is fully ACID compliant. 52 | # It is the best value when your primary concern is data safety, for instance on a master. 53 | # However it can have a significant overhead on systems with slow disks because of the 54 | # extra fsyncs that are needed to flush each change to the redo logs. 55 | # Setting it to 2 is a bit less reliable because committed transactions will be 56 | # flushed to the redo logs only once a second, but that can be acceptable on some situations 57 | # for a master and that is definitely a good value for a replica. 0 is even faster 58 | # but you are more likely to lose some data in case of a crash: it is only a good value for a replica. 59 | innodb_flush_log_at_trx_commit = 2 60 | 61 | 62 | [mysqldump] 63 | max-allowed-packet = 16M 64 | -------------------------------------------------------------------------------- /mycat/mycat/data/mycat/conf/schema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | select user() 18 | 19 | 20 | 21 | 22 | 23 | select user() 24 | 25 | 26 | 27 | 28 | 29 | 30 | select user() 31 | 32 | 33 | 34 | 35 | 36 | 37 | select user() 38 | 39 | 40 | 41 | 42 | 43 | 44 | select user() 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /mycat/mycat/data/mycat/conf/server.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | druidparser 14 | 15 | 16 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 32 | 5120 33 | 30000 34 | 35 | 36 | ccbcusr 37 | ccbc 38 | 39 | 40 | sspusr 41 | ssp 42 | 43 | 44 | cambusr 45 | camb 46 | 47 | 48 | cambbatch 49 | cambbatch 50 | 51 | 52 | ztxusr 53 | ztx 54 | 55 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /basefile/scripts/DM_DOCKER_URI_2.7.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding=utf8 3 | #Filename: DM_DOCKER_URI.py 4 | #**************************************************** 5 | # Author: zpang - zpang@dataman-inc.com 6 | # Last modified: 2015-08-13 17:56 7 | # Description: 8 | #**************************************************** 9 | import sys 10 | import os 11 | import stat 12 | import json 13 | import urllib2 14 | import logging 15 | 16 | #Log Setting 17 | Docker_logfile='/dev/stderr' 18 | #Docker_logfile = '/Users/Prometheus/Downloads/test/test.log' 19 | log_format = '%(asctime)s [%(filename)s] [%(levelname)s] %(message)s' 20 | logging.basicConfig(filename = Docker_logfile,format = log_format,datefmt = '%Y-%m-%d %H:%M:%S') 21 | 22 | #Download File 23 | def Download_Conf(URL_Conf,Local_Conf): 24 | BaseLog = URL_Conf + ' download to ' + Local_Conf 25 | try: 26 | f = urllib2.urlopen(URL_Conf) 27 | with open(Local_Conf, "wb") as code: 28 | code.write(f.read()) 29 | 30 | if os.path.splitext(Local_Conf)[1] == ".sh" or os.path.splitext(Local_Conf)[1] == ".py" : 31 | st = os.stat(Local_Conf) 32 | os.chmod(Local_Conf, 0755) 33 | 34 | print(BaseLog + ' is ok') 35 | logging.info(BaseLog + ' is ok') 36 | 37 | 38 | return 1 39 | 40 | except urllib2.HTTPError,e: 41 | print(BaseLog + ' is fail') 42 | #Read operation only once 43 | #print(e.fp.read()) 44 | logging.error(BaseLog + ' is fail') 45 | logging.error(e.fp.read()) 46 | exit(1) 47 | 48 | #read url conf 49 | def READ_CONF(): 50 | DM_READ_URI = os.getenv('DM_READ_URI') 51 | # DM_READ_URI = "{'http://get.dataman-inc.com/repos/ubuntu/keya':'/data/test/key.py'}" 52 | #DM_READ_URI = {'':''} 53 | 54 | if DM_READ_URI: 55 | all = 0 56 | success = 0 57 | tmp = DM_READ_URI.replace("'", "\"") 58 | DM_URI_DICT = json.loads(tmp) 59 | for (key,value) in DM_URI_DICT.items(): 60 | all += 1 61 | if key: 62 | if value: 63 | dir=os.path.dirname(value) 64 | isExists=os.path.exists(dir) 65 | if not isExists: 66 | os.makedirs(dir) 67 | if Download_Conf(key,value): 68 | success += 1 69 | else: 70 | errlog = 'Local_Conf is empty, please check!' 71 | print(errlog) 72 | logging.error(errlog) 73 | exit(1) 74 | 75 | else: 76 | errlog = 'URL is empty, please check!' 77 | print(errlog) 78 | logging.error(errlog) 79 | exit(1) 80 | if all == success: 81 | return 1 82 | else: 83 | errlog = 'Config File is not Change.' 84 | print(errlog) 85 | logging.info(errlog) 86 | 87 | if "__main__" == __name__: 88 | print(READ_CONF()) 89 | if READ_CONF(): 90 | Service = '' 91 | if sys.argv[1:]: 92 | for i in sys.argv[1:]: 93 | Service += i + ' ' 94 | # if Service: 95 | # os.system(Service) 96 | # else: 97 | # errlog = 'Service is Null and Service Not Run !' 98 | # print(errlog) 99 | # logging.error(errlog) 100 | 101 | else: 102 | errlog = 'Config File Setting is Fail! Service is Not Run !' 103 | #print(errlog) 104 | logging.error(errlog) 105 | exit(1) 106 | -------------------------------------------------------------------------------- /MariaDBGalera/container-files/mariadb-functions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | ######################################################### 5 | # Check in the loop (every 1s) if the database backend 6 | # service is already available for connections. 7 | ######################################################### 8 | function wait_for_db() { 9 | set +e 10 | 11 | echo "Waiting for DB service..." 12 | while true; do 13 | if grep "ready for connections" $ERROR_LOG; then 14 | break; 15 | else 16 | echo "Still waiting for DB service..." && sleep 1 17 | fi 18 | done 19 | 20 | set -e 21 | } 22 | 23 | 24 | ######################################################### 25 | # Check in the loop (every 1s) if the database backend 26 | # service is already available for connections. 27 | ######################################################### 28 | function terminate_db() { 29 | local pid=$(cat $VOLUME_HOME/mysql.pid) 30 | echo "Caught SIGTERM signal, shutting down DB..." 31 | kill -TERM $pid 32 | 33 | while true; do 34 | if tail $ERROR_LOG | grep -s -E "mysqld .+? ended" $ERROR_LOG; then break; else sleep 0.5; fi 35 | done 36 | } 37 | 38 | 39 | ######################################################### 40 | # Cals `mysql_install_db` if empty volume is detected. 41 | # Globals: 42 | # $VOLUME_HOME 43 | # $ERROR_LOG 44 | ######################################################### 45 | function install_db() { 46 | if [ ! -d $VOLUME_HOME/mysql ]; then 47 | echo "=> An empty/uninitialized MariaDB volume is detected in $VOLUME_HOME" 48 | echo "=> Installing MariaDB..." 49 | mysql_install_db --user=mysql > /dev/null 2>&1 50 | echo "=> Installing MariaDB... Done!" 51 | else 52 | echo "=> Using an existing volume of MariaDB." 53 | fi 54 | 55 | # Move previous error log (which might be there from previously running container 56 | # to different location. We do that to have error log from the currently running 57 | # container only. 58 | if [ -f $ERROR_LOG ]; then 59 | echo "----------------- Previous error log -----------------" 60 | tail -n 20 $ERROR_LOG 61 | echo "----------------- Previous error log ends -----------------" && echo 62 | mv -f $ERROR_LOG "${ERROR_LOG}.old"; 63 | fi 64 | 65 | touch $ERROR_LOG && chown mysql $ERROR_LOG 66 | } 67 | 68 | ######################################################### 69 | # Check in the loop (every 1s) if the database backend 70 | # service is already available for connections. 71 | # Globals: 72 | # $MARIADB_USER 73 | # $MARIADB_PASS 74 | ######################################################### 75 | function create_admin_user() { 76 | echo "Creating DB admin user..." && echo 77 | local users=$(mysql -s -e "SELECT count(User) FROM mysql.user WHERE User='$MARIADB_USER'") 78 | if [[ $users == 0 ]]; then 79 | echo "=> Creating MariaDB user '$MARIADB_USER' with '$MARIADB_PASS' password." 80 | mysql -uroot -e "CREATE USER '$MARIADB_USER'@'%' IDENTIFIED BY '$MARIADB_PASS'" 81 | else 82 | echo "=> User '$MARIADB_USER' exists, updating its password to '$MARIADB_PASS'" 83 | mysql -uroot -e "SET PASSWORD FOR '$MARIADB_USER'@'%' = PASSWORD('$MARIADB_PASS')" 84 | fi; 85 | 86 | mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO '$MARIADB_USER'@'%' WITH GRANT OPTION" 87 | 88 | echo "========================================================================" 89 | echo " You can now connect to this MariaDB Server using: " 90 | echo " mysql -u$MARIADB_USER -p$MARIADB_PASS -h " 91 | echo " " 92 | echo " For security reasons, you might want to change the above password. " 93 | echo " The 'root' user has no password but only allows local connections " 94 | echo "========================================================================" 95 | } 96 | 97 | function show_db_status() { 98 | echo "Showing DB status..." && echo 99 | mysql -uroot -e "status" 100 | } 101 | 102 | function secure_and_tidy_db() { 103 | echo "Securing and tidying DB..." 104 | mysql -uroot -e "DROP DATABASE IF EXISTS test" 105 | mysql -uroot -e "DELETE FROM mysql.user where User = ''" 106 | 107 | # Remove warning about users with hostnames (as DB is configured with skip_name_resolve) 108 | mysql -uroot -e "DELETE FROM mysql.user where User = 'root' AND Host NOT IN ('127.0.0.1','::1')" 109 | mysql -uroot -e "DELETE FROM mysql.proxies_priv where User = 'root' AND Host NOT IN ('127.0.0.1','::1')" 110 | echo "Securing and tidying DB... Done!" 111 | } 112 | -------------------------------------------------------------------------------- /active-mq/data/apache-activemq-5.13.1/conf/activemq.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 23 | 24 | 25 | 26 | 27 | file:${activemq.conf}/credentials.properties 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 70 | 71 | 72 | 73 | 74 | 81 | 82 | 83 | 84 | 85 | 86 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /zookeeper/docker/zkServer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | # 19 | # If this scripted is run out of /usr/bin or some other system bin directory 20 | # it should be linked to and not copied. Things like java jar files are found 21 | # relative to the canonical path of this script. 22 | # 23 | 24 | # See the following page for extensive details on setting 25 | # up the JVM to accept JMX remote management: 26 | # http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html 27 | # by default we allow local JMX connections 28 | if [ "x$JMXLOCALONLY" = "x" ] 29 | then 30 | JMXLOCALONLY=false 31 | fi 32 | 33 | if [ "x$JMXDISABLE" = "x" ] 34 | then 35 | echo "ZooKeeper JMX enabled by default" >&2 36 | if [ "x$JMXPORT" = "x" ] 37 | then 38 | # for some reason these two options are necessary on jdk6 on Ubuntu 39 | # accord to the docs they are not necessary, but otw jconsole cannot 40 | # do a local attach 41 | ZOOMAIN="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=$JMXLOCALONLY org.apache.zookeeper.server.quorum.QuorumPeerMain" 42 | else 43 | if [ "x$JMXAUTH" = "x" ] 44 | then 45 | JMXAUTH=false 46 | fi 47 | if [ "x$JMXSSL" = "x" ] 48 | then 49 | JMXSSL=false 50 | fi 51 | if [ "x$JMXLOG4J" = "x" ] 52 | then 53 | JMXLOG4J=true 54 | fi 55 | echo "ZooKeeper remote JMX Port set to $JMXPORT" >&2 56 | echo "ZooKeeper remote JMX authenticate set to $JMXAUTH" >&2 57 | echo "ZooKeeper remote JMX ssl set to $JMXSSL" >&2 58 | echo "ZooKeeper remote JMX log4j set to $JMXLOG4J" >&2 59 | ZOOMAIN="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$JMXPORT -Dcom.sun.management.jmxremote.authenticate=$JMXAUTH -Dcom.sun.management.jmxremote.ssl=$JMXSSL -Dzookeeper.jmx.log4j.disable=$JMXLOG4J org.apache.zookeeper.server.quorum.QuorumPeerMain" 60 | fi 61 | else 62 | echo "JMX disabled by user request" >&2 63 | ZOOMAIN="org.apache.zookeeper.server.quorum.QuorumPeerMain" 64 | fi 65 | 66 | # use POSTIX interface, symlink is followed automatically 67 | ZOOBIN="${BASH_SOURCE-$0}" 68 | ZOOBIN="$(dirname "${ZOOBIN}")" 69 | ZOOBINDIR="$(cd "${ZOOBIN}"; pwd)" 70 | 71 | if [ -e "$ZOOBIN/../libexec/zkEnv.sh" ]; then 72 | . "$ZOOBINDIR"/../libexec/zkEnv.sh 73 | else 74 | . "$ZOOBINDIR"/zkEnv.sh 75 | fi 76 | 77 | if [ "x$SERVER_JVMFLAGS" != "x" ] 78 | then 79 | JVMFLAGS="$SERVER_JVMFLAGS $JVMFLAGS" 80 | fi 81 | 82 | if [ "x$2" != "x" ] 83 | then 84 | ZOOCFG="$ZOOCFGDIR/$2" 85 | fi 86 | 87 | # if we give a more complicated path to the config, don't screw around in $ZOOCFGDIR 88 | if [ "x$(dirname "$ZOOCFG")" != "x$ZOOCFGDIR" ] 89 | then 90 | ZOOCFG="$2" 91 | fi 92 | 93 | if $cygwin 94 | then 95 | ZOOCFG=`cygpath -wp "$ZOOCFG"` 96 | # cygwin has a "kill" in the shell itself, gets confused 97 | KILL=/bin/kill 98 | else 99 | KILL=kill 100 | fi 101 | 102 | echo "Using config: $ZOOCFG" >&2 103 | 104 | ZOO_DATADIR="$(grep "^[[:space:]]*dataDir" "$ZOOCFG" | sed -e 's/.*=//')" 105 | ZOO_DATALOGDIR="$(grep "^[[:space:]]*dataLogDir" "$ZOOCFG" | sed -e 's/.*=//')" 106 | 107 | # iff autocreate is turned off and the datadirs don't exist fail 108 | # immediately as we can't create the PID file, etc..., anyway. 109 | if [ -n "$ZOO_DATADIR_AUTOCREATE_DISABLE" ]; then 110 | if [ ! -d "$ZOO_DATADIR/version-2" ]; then 111 | echo "ZooKeeper data directory is missing at $ZOO_DATADIR fix the path or run initialize" 112 | exit 1 113 | fi 114 | 115 | if [ -n "$ZOO_DATALOGDIR" ] && [ ! -d "$ZOO_DATALOGDIR/version-2" ]; then 116 | echo "ZooKeeper txnlog directory is missing at $ZOO_DATALOGDIR fix the path or run initialize" 117 | exit 1 118 | fi 119 | ZOO_DATADIR_AUTOCREATE="-Dzookeeper.datadir.autocreate=false" 120 | fi 121 | 122 | if [ -z "$ZOOPIDFILE" ]; then 123 | if [ ! -d "$ZOO_DATADIR" ]; then 124 | mkdir -p "$ZOO_DATADIR" 125 | fi 126 | ZOOPIDFILE="$ZOO_DATADIR/zookeeper_server.pid" 127 | else 128 | # ensure it exists, otw stop will fail 129 | mkdir -p "$(dirname "$ZOOPIDFILE")" 130 | fi 131 | 132 | if [ ! -w "$ZOO_LOG_DIR" ] ; then 133 | mkdir -p "$ZOO_LOG_DIR" 134 | fi 135 | 136 | ZOO_LOG_FILE=zookeeper-$USER-server-$HOSTNAME.log 137 | _ZOO_DAEMON_OUT="$ZOO_LOG_DIR/zookeeper-$USER-server-$HOSTNAME.out" 138 | 139 | case $1 in 140 | start) 141 | echo -n "Starting zookeeper ... " 142 | if [ -f "$ZOOPIDFILE" ]; then 143 | if kill -0 `cat "$ZOOPIDFILE"` > /dev/null 2>&1; then 144 | echo $command already running as process `cat "$ZOOPIDFILE"`. 145 | exit 0 146 | fi 147 | fi 148 | nohup "$JAVA" $ZOO_DATADIR_AUTOCREATE "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" \ 149 | "-Dzookeeper.log.file=${ZOO_LOG_FILE}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \ 150 | -XX:+HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError='kill -9 %p' \ 151 | -cp "$CLASSPATH" $JVMFLAGS $ZOOMAIN "$ZOOCFG" > "$_ZOO_DAEMON_OUT" 2>&1 < /dev/null & 152 | if [ $? -eq 0 ] 153 | then 154 | if /bin/echo -n $! > "$ZOOPIDFILE" 155 | then 156 | sleep 1 157 | pid=$(cat "${ZOOPIDFILE}") 158 | if ps -p "${pid}" > /dev/null 2>&1; then 159 | echo STARTED 160 | else 161 | echo FAILED TO START 162 | exit 1 163 | fi 164 | else 165 | echo FAILED TO WRITE PID 166 | exit 1 167 | fi 168 | else 169 | echo SERVER DID NOT START 170 | exit 1 171 | fi 172 | ;; 173 | start-foreground) 174 | ZOO_CMD=(exec "$JAVA") 175 | if [ "${ZOO_NOEXEC}" != "" ]; then 176 | ZOO_CMD=("$JAVA") 177 | fi 178 | "${ZOO_CMD[@]}" $ZOO_DATADIR_AUTOCREATE "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.admin.enableServer=false" \ 179 | "-Dzookeeper.log.file=${ZOO_LOG_FILE}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \ 180 | -XX:+HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError='kill -9 %p' \ 181 | -cp "$CLASSPATH" $JVMFLAGS $ZOOMAIN "$ZOOCFG" 182 | ;; 183 | print-cmd) 184 | echo "\"$JAVA\" $ZOO_DATADIR_AUTOCREATE -Dzookeeper.log.dir=\"${ZOO_LOG_DIR}\" \ 185 | -Dzookeeper.log.file=\"${ZOO_LOG_FILE}\" -Dzookeeper.root.logger=\"${ZOO_LOG4J_PROP}\" \ 186 | -XX:+HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError='kill -9 %p' \ 187 | -cp \"$CLASSPATH\" $JVMFLAGS $ZOOMAIN \"$ZOOCFG\" > \"$_ZOO_DAEMON_OUT\" 2>&1 < /dev/null" 188 | ;; 189 | stop) 190 | echo -n "Stopping zookeeper ... " 191 | if [ ! -f "$ZOOPIDFILE" ] 192 | then 193 | echo "no zookeeper to stop (could not find file $ZOOPIDFILE)" 194 | else 195 | $KILL $(cat "$ZOOPIDFILE") 196 | rm "$ZOOPIDFILE" 197 | echo STOPPED 198 | fi 199 | exit 0 200 | ;; 201 | restart) 202 | shift 203 | "$0" stop ${@} 204 | sleep 3 205 | "$0" start ${@} 206 | ;; 207 | status) 208 | # -q is necessary on some versions of linux where nc returns too quickly, and no stat result is output 209 | clientPortAddress=`grep "^[[:space:]]*clientPortAddress[^[:alpha:]]" "$ZOOCFG" | sed -e 's/.*=//'` 210 | if ! [ $clientPortAddress ] 211 | then 212 | clientPortAddress="localhost" 213 | fi 214 | clientPort=`grep "^[[:space:]]*clientPort[^[:alpha:]]" "$ZOOCFG" | sed -e 's/.*=//'` 215 | if ! [[ "$clientPort" =~ ^[0-9]+$ ]] 216 | then 217 | dataDir=`grep "^[[:space:]]*dataDir" "$ZOOCFG" | sed -e 's/.*=//'` 218 | myid=`cat "$dataDir/myid"` 219 | if ! [[ "$myid" =~ ^[0-9]+$ ]] ; then 220 | echo "clientPort not found and myid could not be determined. Terminating." 221 | exit 1 222 | fi 223 | clientPortAndAddress=`grep "^[[:space:]]*server.$myid=.*;.*" "$ZOOCFG" | sed -e 's/.*=//' | sed -e 's/.*;//'` 224 | if [ ! "$clientPortAndAddress" ] ; then 225 | echo "Client port not found in static config file. Looking in dynamic config file." 226 | dynamicConfigFile=`grep "^[[:space:]]*dynamicConfigFile" "$ZOOCFG" | sed -e 's/.*=//'` 227 | clientPortAndAddress=`grep "^[[:space:]]*server.$myid=.*;.*" "$dynamicConfigFile" | sed -e 's/.*=//' | sed -e 's/.*;//'` 228 | fi 229 | if [ ! "$clientPortAndAddress" ] ; then 230 | echo "Client port not found. Terminating." 231 | exit 1 232 | fi 233 | if [[ "$clientPortAndAddress" =~ ^.*:[0-9]+ ]] ; then 234 | clientPortAddress=`echo "$clientPortAndAddress" | sed -e 's/:.*//'` 235 | fi 236 | clientPort=`echo "$clientPortAndAddress" | sed -e 's/.*://'` 237 | if [ ! "$clientPort" ] ; then 238 | echo "Client port not found. Terminating." 239 | exit 1 240 | fi 241 | fi 242 | echo "Client port found: $clientPort. Client address: $clientPortAddress." 243 | STAT=`"$JAVA" "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" "-Dzookeeper.log.file=${ZOO_LOG_FILE}" \ 244 | -cp "$CLASSPATH" $JVMFLAGS org.apache.zookeeper.client.FourLetterWordMain \ 245 | $clientPortAddress $clientPort srvr 2> /dev/null \ 246 | | grep Mode` 247 | if [ "x$STAT" = "x" ] 248 | then 249 | echo "Error contacting service. It is probably not running." 250 | exit 1 251 | else 252 | echo $STAT 253 | exit 0 254 | fi 255 | ;; 256 | *) 257 | echo "Usage: $0 [--config ] {start|start-foreground|stop|restart|status|print-cmd}" >&2 258 | 259 | esac 260 | -------------------------------------------------------------------------------- /tsung/Tsung.md: -------------------------------------------------------------------------------- 1 | # Tsung-1.6.0 官方手册 2 | ## 1 什么是 [Tsung](http://tsung.erlang-projects.org/) 3 | Tsung是基于 Erlang 的一个开源分布式多协议的负载测试工具,可以支持 HTTP, WebDAV, SOAP, PostgreSQL, MySQL, LDAP and Jabber/XMPP,只要硬件足够可以支撑几十万到上百万的压力。 4 | ## 2 特点 5 | ### 2.1 tsung 主要特点 6 | - 高性能 7 | 8 | 可以在一个单CPU模拟成千上万的用户(模拟用户不总是活动的,它可以在一个thinktime 期间空闲)传统的工具也很难再超过几十万(提示:如果你想要做的就是要求循环请求一个简单的URL可以使用AB,但如果你想建立一个复杂的环境,并且得到测试报告,可以选择Tsing) 9 | - 分布式 10 | 11 | 利用集群提供负载 12 | - 使用插件系统实现多协议 13 | 14 | HTTP(包括标准的网络流量和SOAP),WebDAV,Jabber / XMPP协议和PostgreSQL目前都支持。实验版LDAP和MySQL的插件包括在1.3.0版本。 15 | - SSL支持 16 | 17 | 使用操作系统的别名机制 18 | 19 | - 使用erlang代理或snmp 监控操作系统(CPU、内存、流量) 20 | - XML格式的配置文件 21 | 22 | 使用xml来完成复杂用户的配置。使用tsung recorder(录制)完成复杂环境的配置。(HTTP and PostgreSQL only). 23 | - 动态场景 24 | 25 | 可以不用写任何代码来是到服务器在压力下的动太数据,并可以后边的请求重新注入。也可以循环,当分(正则)匹配到服务器返回的字符串时重新启动或停止会话。 26 | - 混合行为 27 | 28 | 在同一个测试基准中,可以使用多个sessions来模拟不同类型的用户。并可以定义各种行为的比例。 29 | - 随机过程 30 | 31 | 产生一个接近真实的流量,用户thinktimes和到达率可使用随机概率分布(目前使用指数) 32 | 33 | ### 2.2 HTTP 34 | - HTTP/1.0   HTTP/1.1 支持 35 | - GET, POST, PUT, DELETE and HEAD 请求 36 | - Cookies:自动cookies 管理。也可以手动增加多个cookies 37 | - GET If-modified since 类型的请求 38 | - WWW基本认证 39 | - 用户代理支持 40 | - 可以增加一些HTTP  Headers 41 | - 使用代理模式用web浏览器记录会话 42 | - SOAP支持使用HTTP模式(HTTP头SOAPAction的处理) 43 | - HTTP服务器或代理服务器的负载测试 44 | 45 | ### 2.3 WEBDAV 46 | WEBDAV(HTTP 1.1的扩展,WebDAV(RFC4918)插件是对HTTP超插件,增加了以下功能 47 | 48 | - Methods implemented: DELETE, CONNECT, PROPFIND, PROPPATCH, COPY, MOVE, LOCK, UNLOCK, MKCOL, REPORT, OPTIONS, MKACTIVITY, CHECKOUT, MERGE 49 | - Recording of DEPTH, IF, TIMEOUT OVERWRITE, DESTINATION, URL and LOCK-TOKEN Headers. 50 | 51 | ### 2.4 Jabber/XMPP 52 | - 验证(plain-text, digest and sip-digest) 53 | - presence and register messages 54 | - 聊天信息发送给在线或离线用户 55 | - MUC的:加入房间,房间里发送消息,更改昵称 56 | - Roster set and get requests 57 | - Global users' synchronization can be set on specific actions 58 | - 原始XML消息 59 | - PubSub 60 | - 支持多个虚拟主机的实例 61 | 62 | ### 2.5 PostgreSQL 63 | - 基本验证和MD5验证 64 | - 基本查询(扩展查询暂不支持) 65 | - 代理模式录制session 66 | 67 | ### 2.6 mysql 相关功能 68 | 这个插件是实验性的,它只能使用在mysql4.1及以上版本 69 | 70 | - 安全身份验证方法 71 | - 基本查询 72 | 73 | ### 2.7 Websocket 74 | 这个插件是实验性的,只支持 RFC 6455.作用于服务器类型,工作原理类似tcp和udp传输,任何应用特殊协议数据可以通过它发送。例子在examples/websocket.xml. 75 | 76 | - 服务器类型和会话类型 77 | 78 | ### 2.8 AMQP 79 | 这个插件是实验性的,只支持 AMQP-0.9.1,例子在 examples/amqp.xml. 80 | 81 | - 基本的发布和消费 82 | - 发布确认和消费ack 83 | - Qos 84 | 85 | ### 2.9 MQTT 86 | 这个插件是实验性的,支持 MQTT V3.1,例子 examples/mqtt.xml. 87 | 88 | - 链接 MQTT broker 与选项 89 | - 发布信息到 broker 90 | - 话题订阅和退订 91 | - 支持qos0和1 92 | 93 | ### 2.10 LDAP相关功能 94 | 这个插件是实验性的 95 | 96 | - Bind 97 | - Add, modify and search queries 98 | - starttls (only with R12B-0 Erlang and up) 99 | 100 | ### 2.11 原生插件 101 | - 兼容 tcp/udp/ssl 102 | - 愿信息 103 | - no_ack,local,global ack 信息 104 | 105 | ### 2.12 完成的报告 106 | Tsung所产生的行为和报告是非常完整的,它们全为图形显示。Tsung的统计方面如下: 107 | 108 | - 性能 109 | 110 | 响应时间(response time),连接时间(connection time),根据用户的要求建立分组方案(called transactions),,第秒请求 111 | - 错误 112 | 113 | 通过统计页返回代码来跟踪错误。 114 | - 目标服务器行为 115 | 116 | 一个Erlang代理,可以收集到来自目标服务器(S)的信息,Tsung生成内存消耗,CPU和网络流量图。 117 | - 还支持SNMP和munin 监控远程服务器。 118 | 119 | 注意:TSUNG注意到了同步过程本身,所收集的统计到synchronized.它可以是实时收集统计中的基准线。 120 | 121 | ### 2.13 亮点 122 | Tsung 与其它注入工具相比的几个优点 123 | 124 | - 高性能和分布式:你可以用TSUNG模拟成千上万的虚拟用户。 125 | - 易于使用:于对协议的支持已经完成。无需编写复杂的脚本。如果在动态的情况下,只需一些小段的代码。 126 | - 多协议支持:例如,对于SOAP应用程序,tsung是唯一的工具。 127 | - 目标服务器的监测,分析,并发现瓶颈。例如:它已经被用来分析集群对称(负载平衡测试)。并确定集群层(Web engine, EJB engine and database)上机器的最佳组合。 128 | 129 | ## 3 安装 130 | ### 3.1 依赖 131 | - Erlang/OTP R14B 及以上版本。[download](http://www.erlang.org/download.html). Erlang是现在Fedora和Debian / Ubuntu的仓库的一部分。 132 | - Pgsql模块由Christian Sunesson开发 (for the PostgreSQL plugin) 源可用。http://jungerl.sourceforge.net/,这个模块以源代码和二进制发布,它以EPL协议发布。 133 | - Mysql模块由Magnus Ahltorp & Fredrik Thulin开发。(for the mysql plugin):源可用。http://www.stacken.kth.se/projekt/yxa/ 修改后的模块被包含在tsung源代码和二进制中。It is released under the three-clause BSD License. 134 | - Eldap 模块(for the LDAP plugin):源可用http://jungerl.sourceforge.net/ . 135 | 这个模块被包含在源和二进制发布中,以GPL协议发布。 136 | - Mochiweb 库 (Xpath 解析 可以在HTTP插件中使用动态变量)源可用,http://code.google.com/p/mochiweb/ 以 MIT 发布。 137 | - gnuplot 和 perl5(图形输出脚本)模板工具包用于生成HTML报告。[see](http://template-toolkit.org/) 138 | - python and mathplotlib tsung绘图 139 | - 分布式测试,需要SSH无密码方式连接到远程机器 (使用 RSA/DSA 无密码或ssh-agent) (rsh 也支持) 140 | - Bash 141 | 142 | ### 3.2 编译 143 | 源码编译使用最新版本的到[下载地址](http://tsung.erlang-projects.org/dist/)或者使用[git](https://github.com/processone/tsung)下载编译。当然也可以使用deb或者rpm安装。 144 | ### 3.3 配置 145 | 默认配置文件在`~/.tsung/tsung.xml` (样例文件在`/usr/share/doc/tsung/examples`). 146 | 147 | 日志文件被保存在`~/.tsung/log/`使用当前的日期为名称的新子目录中,例如`~/.tsung/log/20040217-0940.` 148 | ### 3.4 运行 149 | 运行命令在`$PREFIX/bin`目录中,分别是`tsung`和`tsung-recorder` 150 | 151 | $ tsung -h 152 | Usage: tsung start|stop|debug|status 153 | Options: 154 | -f set configuration file (default is ~/.tsung/tsung.xml) 155 | (use - for standard input) 156 | -l set log directory where YYYYMMDD-HHMM dirs are created (default is ~/.tsung/log/) 157 | -i set controller id (default is empty) 158 | -r set remote connector (default is ssh) 159 | -s enable erlang smp on client nodes 160 | -p set maximum erlang processes per vm (default is 250000) 161 | -X add additional erlang load paths (multiple -X arguments allowed) 162 | -m write monitoring output on this file (default is tsung.log) 163 | (use - for standard output) 164 | -F use long names (FQDN) for erlang nodes 165 | -L SSL session lifetime (600sec by default) 166 | -w warmup delay (default is 1 sec) 167 | -n disable web GUI (started by default on port 8091) 168 | -k keep web GUI (and controller) alive after the test has finished 169 | -v print version information and exit 170 | -6 use IPv6 for Tsung internal communications 171 | -x list of requests tag to be excluded from the run (separated by comma) 172 | -h display this help and exit 173 | 174 | 典型的使用方法为:`tsung -f myconfigfile.xml start`,测试完毕后,将生成日志到测试主机目录,默认情况运行中将打开监听页面在主控机,监听端口`8091`,可以使用`-n`关闭 175 | ## 4 基准方法 176 | ### 4.1 HTTP/ WebDAV 177 | #### 4.1.1 基准测试Web服务器 178 | - 录制一个或多个会话:启动记录器`tsung-recorder start`,并且配置浏览器使用tsung代理记录器(监听端口是8090).将创建一个会话文件.对于HTTPS录音,使用`http://-`而不是`https://` 179 | - 编辑/整理在配置文件中添加记录的会话 180 | - 如果在场景中需要动态标记的话,写动态部分的代码。 181 | - 测试并调整方案以得到更好的结果。这些高度依赖应用程序和目标服务器的规模。在正常情况下,使用户和各阶段的间隔时间来估计每个特定阶段的并发用户数。 182 | - 启动第一个应用程序的参数设置基准`tsung start` 183 | - 等待测试结束或手动停止.(报告也可在测试过程中产生的 (see § 7))每10秒更新统计数据。对于当前活动的简要介绍,使用`tsung status` 184 | - 分析结果,改变参数并重新启动另一个基准 185 | 186 | #### 4.1.2 WEBDAV 187 | 它和HTTP相同的方法:首先启动录制机,录制一个或多个会话,`tsung-recorder -p webdav start` 188 | #### 4.1.3 基准代理服务器 189 | 默认情况下,HTTP插件被用来基准测试HTTP服务器。但也可以测试HTTP代理服务器。但需要添加选项部分: 190 | 191 | 192 | ### 4.2 LDAP基准测试 193 | 对于录制机的LDAP插件还没有实现,因此你必须自己写会话,更多信息请参见6.6.6小节。 194 | ### 4.3 PostgreSQL的基准测试方法 195 | 和HTTP有相同的方法:首先开始录制机记录一个或多个会话,`tsung-recorder -p pgsql start` 196 | 197 | 将启动一个代理监听端口8090,将代理请求转到本机的`5432`端口。如果要选择另外的端口和地址`tsung-recorder -L 5432 -I 10.6.1.1 -P 5433 -p pgsql start`这将启动代理监听端口`5432`,将代理请求转到`10.6.1.1:5433`。 198 | ### 4.4MYSQL 基准测试 199 | 对于mysql的录制机插件还没有完成。因此你必须自己写SESSION。see section 6.6.5 for more information. 200 | ### 4.5 Jabber/XMPP 基准测试 201 | #### 4.5.1 概述 202 | 本段介绍如何编写的Jabber / XMPP session 203 | 在HTTP 和 Jabber 测试中有两个差异: 204 | 205 | - 对于jabber没有录制机,因此你必须自己写SESSION,(an example is provided in 6.6.3) 206 | - Jabber的插件不解析XML,相反,它使用数据包确认。 207 | 208 | #### 4.5.2 后续暂无翻译 209 | [翻译地址](http://tsung.erlang-projects.org/user_manual/benchmark.html) 210 | ### 5.使用代理记录 211 | 录制机有三个插件:HTTP, WebDAV 和 for PostgreSQL. 212 | 213 | 启动方式`tsung-recorder -p start`插件选项支持HTTP\WebDAV\pgSQL,默认是HTTP。这个代理的监听端口是`8090`,可以使用 `-L portnumber` 来改变端口。 214 | 215 | 停止命令`tsung-recorder stop` 216 | 217 | 这个session的记录被创建在`~/.tsung/tsung_recorderYYYMMDD-HH:MM.xml`;如果启动出错,查看日志`~/.tsung/log/tsung.log-tsung_recorder@hostname` 218 | 219 | 在录制过程中,你可以参加自定义的tag在XML配置文件中。可以设置注释和插入标签`tsung-recorder record_tag "’` 220 | 221 | 一但创建一个会话,你可以插入你的主配置文件。可以手工编辑文件。或通过一个实体声明如: 222 | 223 | 225 | ]> 226 | ... 227 | 228 | &mysession1; 229 | 230 | #### 5.1 PostgreSQL 231 | 代理将链接`127.0.0.1:5432`,使用 `-l server IP` 修改ip地址,使用`-P`修改端口。 232 | #### 5.2 HTTP and WEBDAV 233 | 对于https录制,在你的游览器里,请使用http://- 而不是使用https://,在新的1.2.2版本中,对于HTTP,可以配置录制的父代理(但不能工作在https)。添加方法 `-u` 来打开父代理,使用 `-l server IP` 修改ip地址,使用`-P`修改端口。 234 | ## 6 XML 配置文件 235 | ## 7 统计报表和报告 236 | ### 7.1 文件格式 237 | 默认情况下,tsung 使用自己的格式,从1.4.2版本后,可以使用json格式,然而json格式不支持自带报表自动生成工具: tsung_stats.pl和tsung_plotter 238 | 239 | 启动json方法 240 | 241 | 242 | 格式 243 | 244 | { 245 | "stats": [ 246 | {"timestamp": 1317413841, "samples": []}, 247 | {"timestamp": 1317413851, "samples": [ 248 | {"name": "users", "value": 0, "max": 0}, 249 | {"name": "users_count", "value": 0, "total": 0}, 250 | {"name": "finish_users_count", "value": 0, "total": 0}]}, 251 | {"timestamp": 1317413861, "samples": [ 252 | {"name": "users", "value": 0, "max": 1}, 253 | {"name": "load", "hostname": "requi 254 | .... 255 | ### 7.2. 可用信息 256 | 平均响应时间(对于页面和请求)每十秒计算和重置。1.3.0版本对于整个测试平均值还有计算 257 | 258 | 参数| 解释 | 中文解释 259 | :----------- | :-----------: | -----------: 260 | request | Response time for each request| 每个请求响应时间 261 | page | Response time for each set of requests (a page is a group of request not separated by a thinktime).| 每组请求响应时间 262 | connect | Duration of the connection establishment. | 每个连接建立时间 263 | reconnect | Number of reconnection | 重新连接数量 264 | size_rcv | Size of responses in bytes| 接受请求大小 265 | size_sent | Size of responses in bytes| 发送请求大小 266 | session | Duration of a user’s session | 用户会话保持时间 267 | users | Number of simultaneous users | 同步用户数,会话启动算 268 | connected | number of users with an opened TCP/UDP connection | tcp/udp 打开连接数(http 思考时间+tcp连接可以由服务器关闭,不会倍重新打开,直到思考时间国旗) 269 | custom transactions|custom transactions|定制事务 270 | #### 7.2.1. HTTP specific stats 271 | 每个响应状态(200,304等)的计数器 272 | #### 7.2.2. Jabber specific stats 273 | #### 7.2.3. 系统监控信息 274 | - {load,} 最后一分钟的平均负载 275 | - {cpu,} 内存 277 | 278 | ### 7.3. Design 279 | ### 7.4. 生成报告 280 | 在日志目录例如`~/.tsung/log/20040325-16:33/`使用`tsung_stats.pl` 281 | 282 | /usr/lib/tsung/bin/tsung_stats.pl 283 | 注意运行时也可以生成,使用 -help 参数查看 284 | ### 7.5. 总结 285 | ![](./report.png) 286 | ### 7.6 图形预览 287 | 输出图形数据 288 | ![](./graphical.png) 289 | ### 7.7 绘图 290 | tsplot 是合并绘图绘图工具,可以从几个文件中汇聚一个图标进行分析比对,可以通过配置文件轻松定制想要的曲线. 291 | 292 | tsplot "First test" firsttest/tsung.log "Second test" secondtest/tsung.log -d outputdir 293 | 生成图表的例子 294 | ![](http://tsung.erlang-projects.org/user_manual/_images/connected.png) 295 | -------------------------------------------------------------------------------- /tsung/tsung-xml-setting.md: -------------------------------------------------------------------------------- 1 | ## 6 tsung.xml 配置文件 2 | ### 6.1 文件结构 3 | 默认编码是utf8,可以设定一个编码格式,例子: 4 | 5 | 6 | 标记 tsung tag: 7 | 8 | 9 | 10 | 11 | ... 12 | 13 | 如果添加属性 `dumptraffic=”true”`时,所有的数据将被记录到日志中。 14 | 15 | 警告:这将大大减缓tsung的效率,谨慎使用,它只适合于debug模式,可以使用`dumptraffic=”light”`只 dump 前 44 字节。 16 | 从1.4.0版本后,可以按照协议定义记录,使用`dumptraffic=”protocol”`。目前只针对HTTP实现,这将所有的请求记录到一个 csv 文件中,类似: 17 | 18 | #date;pid;id;http method;host;URL;HTTP status;size;duration;transaction;match;error;tag 19 | 20 | 字段 | 描述 | 中文描述 21 | ----------- | ----------- | ----------- 22 | date | timestamp at the end of the request (seconds since 1970-01-01 00:00:00 UTC) | 请求结束时间 23 | pid | erlang process id| erlang进程id 24 | id | tsung user id| tsung 用户 id 25 | host | server hostname| 主机名 26 | url | url| url 相对地址 27 | HTTP | status HTTP reponse status (200, 304, etc.) | http状态码(200,304) 28 | size | reponse size (in bytes)| 请求字节 29 | duration | request duration (msec)|请求时间(毫秒) 30 | transaction | name of the transaction (if any) this request was made in|事务名称 31 | match | if a match is defined in the request: match|nomatch (last if several are defined) | 请求中定义匹配 32 | error | name of http error (or empty)| http 错误名称 33 | tag | tag name if the request was tagged; empty otherwise | 定义请求标签,否则是空 34 | 35 | 警告:一般情况下,多客户端的生成文件不会呗排序,所以必须在分析之前进行排序 36 | 对于高负载情况(每秒几十万上百万的请求),协议日志记录可能会导致控制器超载,所以这种情况下,需要使用本地协议日志来代替,协议日志文件将写入每个客户端本地,这样需要在测试完毕后手动合并日志。 37 | 38 | 日志级别对于性能影响很大,对于高负载建议使用 warning 级别。 39 | 40 | 日志级别: 41 | 42 | - emergency 43 | - critical 44 | - error 45 | - warning 46 | - notice (default) 47 | - info 48 | - debug 49 | 50 | 如果需要详细记录,需要重新编译tsung ,在make 的时候增加 debug 参数和日志参数到 debug. 51 | ### 6.2 客户端和服务端 52 | tsung 集群中客户端和服务器定义 53 | #### 6.2.1 基础设置 54 | 对于单机模式,可以使用基本设置: 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 在同一主机上,启动工作节点和控制节点。 64 | 65 | 服务器设置可以是集群,可以添加多个服务器,默认情况下,每个服务器权重是1,每次都会按照权重选择服务器加压,权重可以设置(可以使用整数或者浮点设置): 66 | 67 | 68 | 69 | 70 | 71 | (1.5.0之前的版本没有实现权重设置,通过轮询算法来选择服务器),协议类型可以是 tcp\ssl\udp(对于ipv6,ssl6或者udp6;只支持1.4.2以上版本)或websocket(仅支持1.5.0以上版本)还有一个特殊类型: BOSH,用于未加密的 BOSH 和 bosh_ssl 的加密链接。 72 | #### 6.2.2 高级设置 73 | 这个例子比较复杂,使用了分布式配置: 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 使用更多的机器来模拟虚拟客户端ip,当一个负载均衡使用一个客户端ip来分发集群流量时,非常有用。 87 | 88 | 1.1.1 新特性: IP 不再强制,如果未指定,将使用默认ip。 89 | 90 | 1.4.0 新特性: 可以使用` ` 扫描一个指定网卡接口的ip,例子中使用(eth0) 91 | 92 | 在例子的集群中,第二台机器拥有高权重和2cpus,两个erlang虚拟机加压机将拥有cpu数量优势。 93 | 94 | 注意:尽管erlang的虚拟加压机可以处理多个cpu(erlang smp),但是测试表明,一个cpu对应一个虚拟机(禁用smp),效能更高。只有控制器节点使用 smp erlang.因此,cpu设置应该等于你的节点cpu数量,如果喜欢使用 smp ,启动使用 -s 参数添加,不要在config 文件设置。 95 | 默认情况下,负载将均匀的分布在每个cpu上(每个客户端1个cpu的情况下),权重参数可以考虑到客户端机器的速度。例如,如果一个真实的客户端机器具有1的权重,其他的机器2的权重,那从第二个客户端机器开始启动的用户将是第一个客户端机器上的2倍。前面例子,第二个客户机器有2个cpu和3权重,重量等于每个cpu 1.5倍权重。 96 | ##### 6.2.2.1 最大用户 97 | maxusers 参数用于限制单一进程的最大数,通打开socket最大数(默认操作系统 1024),如果设置异常,需要扩展系统调用。当用户数量大于限制时,一个新的erlang虚拟机将倍启动,以处理新的用户。默认值800。当内核打开polling时,这个值可以设置的非常高(3w为例),也没有什么性能损失,(但不要忘记打开文件打开数, ulimit -n. see also Why do i have error_connect_emfile errors?) 98 | 99 | 注意:如果使用一个 tsung master slave 模式,master将分发回话到 slave 上。如果一个回话链接中有多个请求,将在一个slave 中按顺序执行。 100 | #### 6.2.3 在tsung运行一个作业调度 101 | tsung 可以获得客户端节点列表并且批量执行作业调度程序。目前它可以处理 PBS/torque, LSF and OAR.如果要做到这一点,属性类型(type)设置为批量(batch),如: 102 | 103 | 104 | 如果需要扫描节点的ip地址别名给调度器,使用 scan_intf 105 | 106 | 107 | ## 6.3 监控 108 | tsung 从远程代理使用多个后端监控远程服务器。这里在 里配置。可以统计信息包括:cpu\load average 和内存使用。 109 | 110 | 可以从一个调度程序来得到节点的监控,如: 111 | 112 | 113 | 远程代理支持集中类型,(erlang时默认的) 114 | 115 | ### 6.3.1 Erlang 116 | 远程代理时由tsung 提供。它使用erlang 通讯检查服务器上的活动数据统计,例如:一个基于erlang的代理集群监控定义,如: 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 注意保证一下几点: 127 | 128 | - 保证网络可访问,打开erlang通许端口(最好没有防火墙设置) 129 | - ssh 无密码链接 130 | - 每个节点的 otp 版本必须一致 131 | 132 | 如果不能在远程服务器上安装erlang,可以使用一个活着的代理。在新的1.5.1版本,erlang监控包涵一个mysqladmin 的 mysql db的监控,使用如: 133 | 134 | 135 | 136 | 137 | 可统计数据包含:mysql线程数和查询数量 138 | 139 | ### 6.3.2 SNMP 140 | 如果想使用 snmp 监控,需要将type值替换成 snmp,从1.2.2 版本后,他们也可以混合使用。使用net-snmp提供管理信息库(MIB). 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 默认版本v1,默认 community 设置 public 和默认端口 161. 从 1.4.2 版本后,你可以兹定于 snmp 服务器检索对象标识符(OID),使用一个或者多个OID元素例子: 150 | 151 | 152 | 153 | 155 | 156 | 157 | 类型可以sample, counter or sum,可以使用 erlang 语法定义一条函数被应用到值(eval属性)的功能 158 | ### 6.3.3 Munin 159 | 1.3.1版本中,tsung 可以从 munin-nod 代理获取数据。type 必须修改成 munin,例子: 160 | 161 | 162 | 163 | 164 | 165 | ## 6.4 定义负载 166 | ### 6.4.1 随机产生用户 167 | 负载进程建立通过一下几个点段定义: 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 这个测试的设置中,第一个10分钟里,每2秒创建一个新用户,在第二个10分钟里,每一秒创建一个新用户。最后一个10分钟里,每秒钟将产生10个用户,这个测试结束。 183 | 184 | 还可以使用 arrivalrate 代替 interarrival。样例,每秒都生成10个用户: 185 | 186 | 187 | 188 | 189 | 可以限制模拟用户最大数量,通过 maxnumber 属性,类似: 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 这种情况,第一个阶段最多创建100个用户,第二个阶段200.在负载的标签属性中可以使用 loop 参数来进行循环执行相同的模型。(loop='2'只将循环2次,因此整个流程将执行3次,本功能在 1.2.2加入) 199 | 200 | 产生的负载将术语时 http requests/秒,也将取决于一个会话中的请求平均数(如果每个会话每秒100个请求和10个新用户的平均值,理论吞吐量将势1000 rps)。 201 | 202 | 新的1.5.1 版本中,你可以在回话中使用覆盖率(probability)新特性,使用 session_setup 203 | 204 | 205 | 206 | 207 | 208 | 209 | ### 6.4.2 静态生成用户 210 | 如果想在测试期间一个指定的时间内,开始就一个指定的回话数,1.3.1版本开始支持: 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 在例子中,有2个会话概率(probability)是0(因此第一阶段不会使用),和一个概率100%。定义了3个用户:第一个用户185秒后启动,第二个用户10秒后启动,第三个用户11秒启动。 237 | 238 | 在新的1.5.1 版本中,想一次触发几个会话和想这些会话有相同的前缀,可以使用通配符。例子将启动2个用户在测试开始10秒后: 239 | 240 | 241 | ### 6.4.3 负载测试持续时间 242 | 默认情况下,当所用户开始完成了他们的会话即会结束。因此它可以比arrivalphases持续时间长很多。如果想在固定时间(即使任务没有完成)停止 tsung,添加duration(持续时间)属性可以做到。(1.3.2 功能) 243 | 244 | 245 | 246 | 247 | 248 | 249 | 样例中持续时间1小时,单位可以设置成:second, minute or hour 250 | ## 6.5 设置选项 251 | ### 6.5.1 Thinktimes, SSL, Buffers 252 | 默认的值可以创建全局变量:在方案中,thinktime (思考时间)与请求之间、ssl加密算法,tcp/udp缓冲区大小(默认32KB),都可以使用参数进行设置来覆盖真实的。 253 | 254 | 258 | 259 | 260 | 261 | 在1.6.0版本中,可以禁用ssl会话缓存,默认是打开的. 262 | 263 |