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,

存档

‘Mesos & DC/OS’ 分类的存档

DC/OS 服务发现和命名服务

2018年8月27日 没有评论

Mesos-DNS

Mesos-DNS

192.168.0.241 机器上运行的PostgreSQL,端点:192.168.0.241:7300

容器配置

        "image": "postgres:9.6",
        "network": "BRIDGE",
        "port_mappings": [
            {
                "host_port": 7300,
                "container_port": 5432,
                "protocol": "tcp"
            }
        ],

phpPgAdmin视图看到的信息:

服务器 Host Port 用名 功能
postgresql.marathon.l4lb.thisdcos.directory postgresql.marathon.l4lb.thisdcos.directory 5432 kong 注销

分析 postgresql.marathon.l4lb.thisdcos.directory 这样的名字是如何定义、存储和查询的。

dig – DNS lookup utility

# yum install bind-utils
# dig search.marathon.mesos
# dig postgresql.marathon.l4lb.thisdcos.directory
# dcos auth login

http://192.168.0.250/mesos_dns/v1/enumerate

DC/OS部署的服务的DNS都在这里定义了。

mesos-dns


分类: Mesos & DC/OS 标签:

Docker镜像仓库Harbor

2018年8月13日 没有评论

Habor是由VMWare公司开源的容器镜像仓库。Habor是在Docker Registry上进行了相应的企业级扩展,这些企业级特性包括:管理用户界面,基于角色的访问控制 ,AD/LDAP集成以及审计日志等。

Harbor-01

Harbor-02

jdos

jdos

Harbor-03

下载 https://storage.googleapis.com/harbor-releases/release-1.4.0/harbor-online-installer-v1.4.0.tgz

设置 harbor.cfg 中 MySQL、PostgreSQL数据库信息。

创建File Sharing -> data

drwxr-xr-x    9 huihoo staff   288  4  3 16:56  data

Harbor-04

$ docker info | grep 'Logging Driver'
Logging Driver: json-file

harbor设置的是syslog

vim /etc/syslog.conf
*.* @127.0.0.1:514

$ ps -e | grep syslogd
重启
$ sudo launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist
$ sudo launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist

$ ./prepare
$ docker-compose up

Harbor-05

$ docker info
Logging Driver: json-file

Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog

将日志方式改为:json-file,修改docker-compose.yml

替换所有services部分的logging

version: '2.1'
x-logging:
  &default-logging
  options:
    max-size: '12m'
    max-file: '5'
  driver: json-file

services:
  registry:
    logging: *default-logging
  mysql:
    logging: *default-logging

日志问题解决,现在的问题是:

Harbor-06

harbor.cfg: hostname = localhost:8060

修改端口映射 docker-compose.yml

    ports:
      - 8060:80   <--- 修改端口映射
      - 443:443
      - 4443:4443
$ docker-compose down -v
$ sudo ./prepare
$ sudo docker-compose up
$ docker-compose ps

在249上安装,harbor.cfg mysql不改,hostname = localhost:8086

# netstat -pna | grep 443

tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      4472/haproxy

443被占,nginx无法启动。

把443:443改为4433:4433

继续有WARNING: no logs are available with the ‘syslog’ log driver问题,改为json-file

docker-compose up -d 后台运行

http://192.168.0.249:8086/  admin/Harbor12345

Harbor-07

Harbor-08


接入另一个IP的Docker私有仓库

Harbor-09


分类: Docker & K8S, Mesos & DC/OS 标签:

Cassandra on DC/OS

2018年8月9日 没有评论

Apache Cassandra 是一个强大的开源分布式NoSQL数据库,高度的可伸展性。

cassandra

基于DC/OS构建其分布式集群是个非常值得采纳的方法,其基本思路是:

把Cassandra放到Docker里,然后由DC/OS调度Cassandra容器集群运行、管理。

Mesos 的 persistence primitives 是一个新的强大的工具,它使得更多的有状态应用可以运行在 Mesos 上。利用它,可以把 cassandra 集群改造成了一个极易扩展到数百节点的分布式持久化框架。

# dcos package install cassandra
# dcos cassandra help
# dcos cassandra
# dcos cassandra pod list
# dcos cassandra pod info node-0
on master node
# docker run -ti cassandra:3.0.16 cqlsh --cqlversion="3.4.0" 192.168.0.240

cqlsh> CREATE KEYSPACE demo WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };

cqlsh> USE demo;CREATE TABLE map (key varchar, value varchar, PRIMARY KEY(key));

cqlsh:demo> INSERT INTO demo.map(key, value) VALUES('Cassandra', 'Rocks!');
cqlsh:demo> INSERT INTO demo.map(key, value) VALUES('StaticInfrastructure', 'BeGone!');
cqlsh:demo> INSERT INTO demo.map(key, value) VALUES('Buzz', 'DC/OS is the new black!');

cqlsh:demo> SELECT * FROM demo.map;

# docker image ls
# docker run cassandra:3.0.16 &
# docker ps
# docker exec -ti 1d001728d86d cqlsh --cqlversion="3.4.0"

你也可关注与评估Cassandra商业发行版DataStax Enterprise:datastax-dse 和 datastax-ops

In production, the DSE nodes should be operated with 32 GB of memory and 16 GB of heap.

此外,ScyllaDB兼容Cassandra,速度更快,每节点每秒可处理 100 万 TPS。

如何评价 ScyllaDB

ScyllaDB性能是Cassandra的10多倍(3台ScyllaDB可以提供30台Cassandra集群的吞吐量,而且响应延时更低),ScyllaDB的CTO兼创始人Avi Kivity是大名鼎鼎的KVM作者。


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 标签:

持续交付的三条主线

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 标签:

DC/OS自动伸缩Autoscaling

2018年7月31日 没有评论

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


分类: Mesos & DC/OS 标签: