cheap medications premarin 1.25mg tablets estrogen contents, cheap medications buy wellbutrin no rx needed, cheap online buy baclofen online, cheap online order flagyl er pay pal online without prescription, pharmacy cheapest where to buy buy doxycycline online, online cheap medications buy overnight delivery lasix fedex, buy cheap purchase diflucan, cheap online buy neurontin online overnight cod, cheap pharmacy fedex acyclovir overnight without a rx, order cheap what is norvasc, buying cheap buy arimidex free consultation,

Zerotodocker

2018年8月4日 没有评论

此项目加速评估NetflixOSS,帮助熟悉Spring Cloud Netflix。

启动5个docker容器,分配5个vip地址。

第一次运行
$ docker run -d --name asgard -v `pwd`/Config.groovy.mine:/root/.asgard/Config.groovy netflixoss/asgard:1.5.1
$ docker run -d --name exhibitor netflixoss/exhibitor:1.5.2
$ docker run -d --name eureka -d netflixoss/eureka:1.3.1
$ docker run -d --name hello-netflix-oss --link eureka:eureka netflixoss/hello-netflix-oss:1.0.28
$ docker run -e "origin.zuul.client.DeploymentContextBasedVipAddresses=HELLO-NETFLIX-OSS" -d --name zuul --link eureka:eureka netflixoss/zuul:1.0.28

镜像在本地后的再次运行
$ docker run -it netflixoss/asgard:1.5.1
$ docker run -it netflixoss/exhibitor:1.5.2
$ docker run -it netflixoss/eureka:1.3.1
$ docker run -it netflixoss/hello-netflix-oss:1.0.28
$ docker run -it netflixoss/zuul:1.0.28

Zerotodocker

获得image的信息,如:

$ docker inspect 952ff95f7b15

"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.6",
"NetworkID": "11e33740b6f19160ee203a2654dd20a051a93f28879a7b6ef270d9f08bdba564",

如何从本地机直接访问容器地址。

$ docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
11e33740b6f1        bridge              bridge              local
10388d67aaf7        docker_gwbridge     bridge              local
f04c155e245d        host                host                local
27wc5q8vyzi5        ingress             overlay             swarm
c884f99c18fa        none                null                local

使用Bridge的方式,Four ways to connect a docker container to a local network

Docker subnet: 192.168.65.0/24


分类: Cloud Computing, Docker & K8S 标签:

Open Blue Ocean

2018年8月3日 2 条评论

Jenkins 提供了 Open Blue Ocean 持续交付的流水线能力,是传统构建样式的升级版。

Open-Blue-Ocean-01

https://jenkins.io/doc/book/blueocean/pipeline-run-details/

一个真实的Pipeline


pipeline

学习其它厂商的最佳实践,并逐步实现自己的Pipeline最佳实践。

Jenkins Pipeline Best Practices
CloudBees Top 10 Best Practices

图为cloudbees流水线

Open-Blue-Ocean-03

有不少插件可供选择

Open-Blue-Ocean-04

Jenkins pipeline 创建管理我们由Open Blue Ocean来完成,此外还有classic UI 和在 SCM手动创建Jenkinsfile。

这里可以对Pipeline Syntax(Pipeline domain-specific language (DSL) syntax)做一定了解。

得益于Jenkins内嵌的Groovy支持,加上丰富的Step库,通过编写自定义Pipeline脚本你几乎可以实现任何复杂的构建、发布流程。

https://jenkins.io/doc/pipeline/steps/

一些配置信息(仅供参考):

http://192.168.0.249:26451/service/dev/jenkins-prod/job/dev-huihoo-edu/configure

git仓库:git@dev.huihoo.com:server/huihoo-edu.git
构建环境:Mesos Single-Use Slave
Gradle版本:Gradle 3.3
仓库名和标签:huihoo/huihoo-edu 1.0.0
Docker registry URL:http://master.mesos:5000
Marathon URL:http://leader.mesos/service/marathon-user

Docker image for Pipeline demo

docker volume create --name=m2repo
sudo chmod a+rw $(docker volume inspect -f '{{.Mountpoint}}' m2repo)
docker run --rm -p 127.0.0.1:2222:2222 -p 127.0.0.1:8080:8080 -p 127.0.0.1:8081:8081 -p 127.0.0.1:9418:9418 -ti -v m2repo:/m2repo jenkinsci/workflow-demo

Open-Blue-Ocean-05

Open-Blue-Ocean-06

Open-Blue-Ocean-07

Open-Blue-Ocean-08

一个简单的Pipeline,仅供参考

pipeline {
    agent none
    stages {
        stage('Example Build') {
            agent { docker 'maven:3-alpine' }
            steps {
                echo 'Hello, Maven'
                sh 'mvn --version'
            }
        }
        stage('Example Test') {
            agent { docker 'openjdk:8-jre' }
            steps {
                echo 'Hello, Java'
                sh 'java -version'
            }
        }
    }
}

得益于Jenkins内嵌的Groovy支持,加上丰富的step库,通过编写自定义Pipeline脚本你几乎可以实现任何复杂的构建、发布流程。也可将共享的Groovy脚本封装到一个自定义Jenkins Plugin中,然后安装到需要的Jenkins实例中,以后也可以进行统一升级,有效降低了维护成本。

通过Groovy编写Pipeline。

node {
stage 'Stage 1'
echo 'Hello World 1'
stage 'Stage 2'
echo 'Hello World 2'
stage 'Stage 3'
echo 'Hello World 3'
stage 'Stage 4'
echo 'Hello World 4'
}

Open-Blue-Ocean-09

大家可试着对某个Git仓库拉代码、编译、打包、部署

流水线语法:http://192.168.0.249:10082/service/dev/jenkins-prod/job/huihoo-edu-pipeline/pipeline-syntax

可由Snippet Generator和Declarative Directive Generator生成流水线脚本。

需要 Docker Pipeline 插件

流水线需要的环境

Requirements To Use Durability Settings

  • Jenkins LTS 2.73+ or higher (or a weekly 2.62+)
  • For all the Pipeline plugins below, at least the specified minimum version must be installed
    • Pipeline: API (workflow-api) v2.25
    • Pipeline: Groovy (workflow-cps) v2.43
    • Pipeline: Job (workflow-job) v2.17
    • Pipeline: Supporting APIs (workflow-support) v2.17
    • Pipeline: Multibranch (workflow-multibranch) v2.17 – optional, only needed to enable this setting for multibranch pipelines.
  • Restart the master to use the updated plugins – note: you need all of them to take advantage

Open-Blue-Ocean-10

有很多 Jenkins Pipeline step 类型可供选择。

Shell Script
Print Message
Enforce time limit
Retry the body up to N times
Sleep
Windows Batch Script
Archive the artifacts
Allocate node
Accept GitLab Merge Request
Add comment on GitLab Merge Request
Allocate a docker node
Allocate workspace
Archive JUnit-formatted test results
Artifact Resolver
Bind credentials to variables
Build a job
Catch error and set build result
Change current directory
Checks if running on a Unix-like node
Cloud template provisioning
Color ANSI Console Output
Copy artifacts from another project
Determine current directory
Docker Node (⚠️ Experimental)
Error signal
Evaluate a Groovy source file into the Pipeline script
Expand a string containing macros
General Build Step
General Build Wrapper
General SCM
Git
Invoke Nexus Policy Evaluation
JIRA: Add a comment to issue(s)
JIRA: Issue selector
JIRA: Search issues
Load a resource file from a shared library
Load a shared library on the fly
Mail
Marathon Deployment
Nexus Artifact Uploader
Nexus Repository Manager Publisher
Notify gitlab about pending builds
PowerShell Script
Process Job DSLs
Provide Maven environment
Publish artifacts to S3 Bucket
Publish Cobertura Coverage Report
Publish HTML reports
Read file from workspace
Read trusted file from SCM
Record fingerprints of files to track usage
Recursively delete the current directory from the workspace
Resolves an SCM from an SCM Source and a list of candidate target branch names
Restore files previously stashed
Run arbitrary Pipeline script
S3 Copy Artifact
Set environment variables
SSH Agent
Stash some files to be used later in the build
Subversion
The milestone step forces all builds to go through in order
Timestamps
Update the commit status in GitLab
Update the commit status in GitLab depending on the build status
Use a tool from a predefined Tool Installation
Validate a file containing a Declarative Pipeline
Verify if file exists in workspace
Wait for condition
Wait for interactive input
Write file to workspace


分类: DevOps & CI/CD, Mesos & DC/OS 标签:

DC/OS Marathon实践

2018年8月3日 没有评论

Marathon是在Mesos上运行长期服务的框架,它好比数据中心或集群的 init.d,可以确保在其上运行的服务一直运行着。它是高可用、弹性伸缩的关键。

Marathon拥有非常完备的REST API来管理服务的生命周期以及Java、Scala、Python、Ruby等各种客户端,我们可以基于做些API做些管理扩展。

http://192.168.0.250:8080/api-console/index.html

启动Marathon需要Mesos Master和ZooKeeper地址,如:

$./bin/start –master zk://master:2181/mesos –zk master:2181

DC/OS上的ZK配置:

zk://zk-1.zk:2181,zk-2.zk:2181,zk-3.zk:2181,zk-4.zk:2181,zk-5.zk:2181/marathon

Marathon Examples 可作为入门实践,并维护一套我们需要的JSON脚本。

Marathon-LB是DC/OS环境下服务发现和负载均衡工具,基于HAProxy构建,可完成应用的自动伸缩

marathon-lb

一些参考资源:

Marathon Configuration Reference


分类: DevOps & CI/CD 标签:

持续交付的三条主线

2018年8月2日 没有评论

持续交付可分解成三条主线:

  • 从Code到Artifacts仓库;
  • 从Artifacts到Running Service;
  • 从开发、测试环境到准生产、生产环境。

Image

目前仓库主要有:

目前,已在DC/OS上搭建了Nexus仓库并正使用中。
nexus-01

nexus-02

也可使用阿里云Maven仓库

nexus-03

要达成未来每天部署上线N次,这三条主线需要不断优化、自动化和高效运维。

Nexus Jenkins Steps


分类: DevOps & CI/CD, Mesos & DC/OS 标签:

Vitess MySQL/MariaDB Cluster

2018年8月1日 没有评论

Vitess MySQL Cluster是基于Kubernetes的MySQL集群解决方案,支持 MariaDB,Youtube、京东在使用。

Image

https://vitess.io/

本地Docker安装测试

$ sudo docker run -ti vitess/base bash
vitess@80ea443db330:/vt/src/vitess.io/vitess$ make build

vitess@80ea443db330:/$ export VTROOT=/vt
vitess@80ea443db330:/$ export VTDATAROOT=/vt/vtdataroot
vitess@80ea443db330:/$ cd $VTROOT/src/vitess.io/vitess/examples/local
vitess@80ea443db330:/vt/src/vitess.io/vitess/examples/local$ ./zk-up.sh

$ ./vtctld-up.sh
$ ./lvtctl.sh help
$ ./vttablet-up.sh

Starting MySQL for tablet test-0000000100...
Starting MySQL for tablet test-0000000101...
Starting MySQL for tablet test-0000000102...
Starting MySQL for tablet test-0000000103...
Starting MySQL for tablet test-0000000104...

Starting vttablet for test-0000000100...
Access tablet test-0000000100 at http://f6357772e357:15100/debug/status
Starting vttablet for test-0000000101...
Access tablet test-0000000101 at http://f6357772e357:15101/debug/status
Starting vttablet for test-0000000102...
Access tablet test-0000000102 at http://f6357772e357:15102/debug/status
Starting vttablet for test-0000000103...
Access tablet test-0000000103 at http://f6357772e357:15103/debug/status
Starting vttablet for test-0000000104...
Access tablet test-0000000104 at http://f6357772e357:15104/debug/status

初始化数据库
$ ./lvtctl.sh InitShardMaster -force test_keyspace/0 test-100

测试数据库
$ ./lvtctl.sh ListAllTablets test

test-0000000100 test_keyspace 0 master f6357772e357:15100 f6357772e357:17100 []
test-0000000101 test_keyspace 0 replica f6357772e357:15101 f6357772e357:17101 []
test-0000000102 test_keyspace 0 replica f6357772e357:15102 f6357772e357:17102 []
test-0000000103 test_keyspace 0 rdonly f6357772e357:15103 f6357772e357:17103 []
test-0000000104 test_keyspace 0 rdonly f6357772e357:15104 f6357772e357:17104 []

运行了5个MySQL实例:一个Master、两个复制、两个只读

创建一个表
$ ./lvtctl.sh ApplySchema -sql "$(cat create_test_table.sql)" test_keyspace

Vitess-MySQL-Cluster


分类: Database & Storage, Docker & K8S 标签:

DC/OS自动伸缩Autoscaling

2018年7月31日 没有评论

DC/OS的自动伸缩主要通过Marathon负载均衡的方式实现。


分类: Mesos & DC/OS 标签: