阿里云ECS通过docker配置MySQL--MGR

MySQL Group Replication(简称MGR)是mysql官方于2016年12月推出的一个全新的高可用与高扩展的解决方案。MySQL组复制提供了高可用、高扩展、高可靠的MySQL集群服务。

  • 高一致性,基于原生复制及paxos协议的组复制技术,并以插件的方式提供,提供一致数据安全保证;
  • 高容错性,只要不是大多数节点坏掉就可以继续工作,有自动检测机制,当不同节点产生资源争用冲突时,不会出现错误,按照先到者优先原则进行处理,并且内置了自动化脑裂防护机制;
  • 高扩展性,节点的新增和移除都是自动的,新节点加入后,会自动从其他节点上同步状态,直到新节点和其他节点保持一致,如果某节点被移除了,其他节点自动更新组信息,自动维护新的组信息;
  • 高灵活性,有单主模式和多主模式,单主模式下,会自动选主,所有更新操作都在主上进行;多主模式下,所有server都可以同时处理更新操作。

Docker 是一个开源的引擎,可以轻松的为任何应用创建一个轻量级的、可移植的、自给自足的容器。开发者在笔记本上编译测试通过的容器可以批量地在生产环境中部署,包括VMs(虚拟机)、bare metal、OpenStack 集群和其他的基础应用平台。

1.安装Docker及配置MGR

从官方的docker store中拉取MySQL镜像,大约只需要几分钟时间,完毕以后,可以通过docker images命令来查看。

[root@iz2zec57gfl6i9vbtdksl1z ~]# yum install -y docker

[root@iz2zec57gfl6i9vbtdksl1z ~]# docker pull mysql:5.7.17

[root@iz2zec57gfl6i9vbtdksl1z ~]# docker images;

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

docker.io/mysql     5.7.17              9546ca122d3a        4 months ago        406.9 MB

现在我们已经有了docker镜像,然后我们设计如下的目录结构,将三个数据库的数据文件映射到宿主机。

# mkdir /Users/Kamus/mysql_data

# mkdir /Users/Kamus/mysql_data/s1-docker

# mkdir /Users/Kamus/mysql_data/s2-docker

# mkdir /Users/Kamus/mysql_data/s3-docker

由于目标是能运行MGR集群,那么是有一部分数据库初始化参数要额外设置的,而docker容器中的my.cnf内容无法改动,所以我们再设计一个专门的目录用来存储所有数据库的my.cnf文件。

# mkdir /Users/Kamus/mysql_data/conf.d

# mkdir /Users/Kamus/mysql_data/conf.d/s1-docker

# mkdir /Users/Kamus/mysql_data/conf.d/s2-docker

# mkdir /Users/Kamus/mysql_data/conf.d/s3-docker

 

网络网段的设置,只能使用用户指定的IP网段

[root@iz2zec57gfl6i9vbtdksl1z mysql_data]# docker network ls

NETWORK ID          NAME                DRIVER              SCOPE

02cf0f7c8806        bridge              bridge              local

74ea9186efd3        host                host                local

d25ca440e9f6        none                null                local

[root@iz2zec57gfl6i9vbtdksl1z mysql_data]# docker run --detach  --memory=500m --memory-swap=1g --hostname=mysql-mgr-server1 --net=bridge --ip=172.18.0.2 --add-host mysql-mgr-server1:172.18.0.3 --add-host  mysql-mgr-server3:172.18.0.4 --publish 3307:3306 --volume=/mnt/mysql_data/conf.d/s1-docker/:/etc/mysql/conf.d --volume=/mnt/mysql_data/s1-docker:/var/lib/mysql --name=s1-docker -d docker.io/mysql:5.7.17

33b5e2660b080a74f056ad50a061b56d53aeede8b3cbb3673712cc018046e705

/usr/bin/docker-current: Error response from daemon: User specified IP address is supported on user defined networks only.

[root@iz2zec57gfl6i9vbtdksl1z mysql_data]# docker network create --subnet=172.19.0.0/16 b1

[root@iz2zec57gfl6i9vbtdksl1z ~]# docker network ls

NETWORK ID          NAME                DRIVER              SCOPE

3e9fad4158b4        b1                  bridge              local

02cf0f7c8806        bridge              bridge              local

74ea9186efd3        host                host                local

d25ca440e9f6        none                null                local

因为我们设计了容器启动时候会拥有不同的IP地址,因此在容器中运行的MySQL实例的初始化参数中关于MGR的部分也需要指定这些IP地址。以下是my.cnf文件的设置内容。

[mysqld]

datadir=/var/lib/mysql

pid-file=/var/run/mysqld/mysqld.pid

port=3306

socket=/var/run/mysqld/mysqld.sock

server_id=2

gtid_mode=ON

enforce_gtid_consistency=ON

master_info_repository=TABLE

relay_log_info_repository=TABLE

binlog-format=ROW

binlog_checksum=NONE

log-slave-updates=1

log_bin=binlog

relay-log=bogon-relay-bin

# Group Replication

transaction_write_set_extraction = XXHASH64

loose-group_replication_group_name="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"

loose-group_replication_start_on_boot = off

loose-group_replication_local_address = '172.19.0.2:33061'

loose-group_replication_group_seeds ='172.19.0.2:33061,172.19.0.3:33061,172.19.0.4:33061'

loose-group_replication_bootstrap_group = off

对于第一个容器s1-container会使用到的my.cnf文件,这个参数为:

loose-group_replication_local_address="172.19.0.1:33061"

对于第二个容器s2-container会使用到的my.cnf文件,这个参数为:

loose-group_replication_local_address="172.19.0.3:33061"

对于第三个容器s3-container会使用到的my.cnf文件,这个参数为:

loose-group_replication_local_address="172.19.0.4:33061"

2.启动docker镜像有关mysql容器:

运行三个docker容器的完整命令如下:

[root@iz2zec57gfl6i9vbtdksl1z ~]# docker run --detach --memory=500m --memory-swap=1g --hostname=mysql-mgr-server3 --net=b1 --ip=172.19.0.4 --add-host mysql-mgr-server1:172.19.0.2 --add-host  mysql-mgr-server2:172.19.0.3 --publish 3309:3306 --volume=/mnt/mysql_data/conf.d/s3-docker/:/etc/mysql/conf.d --volume=/mnt/mysql_data/s3-docker:/var/lib/mysql --name=s3-docker -e MYSQL_ROOT_PASSWORD=123456 -d docker.io/mysql:5.7.17

[root@iz2zec57gfl6i9vbtdksl1z ~]# docker run --detach  --memory=500m --memory-swap=1g --hostname=mysql-mgr-server2 --net=b1 --ip=172.19.0.3 --add-host mysql-mgr-server1:172.19.0.2 --add-host  mysql-mgr-server3:172.19.0.4 --publish 3308:3306 --volume=/mnt/mysql_data/conf.d/s2-docker/:/etc/mysql/conf.d --volume=/mnt/mysql_data/s2-docker:/var/lib/mysql --name=s2-docker -e MYSQL_ROOT_PASSWORD=123456 -d docker.io/mysql:5.7.17

[root@iz2zec57gfl6i9vbtdksl1z ~]# docker run --detach  --memory=500m --memory-swap=1g --hostname=mysql-mgr-server1 --net=b1 --ip=172.19.0.2 --add-host mysql-mgr-server1:172.19.0.3 --add-host  mysql-mgr-server3:172.19.0.4 --publish 3307:3306 --volume=/mnt/mysql_data/conf.d/s1-docker/:/etc/mysql/conf.d --volume=/mnt/mysql_data/s1-docker:/var/lib/mysql --name=s1-docker -e MYSQL_ROOT_PASSWORD=123456 -d docker.io/mysql:5.7.17

查看是否启动mysql成功:

[root@iz2zec57gfl6i9vbtdksl1z ~]# docker ps -a

CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS              PORTS                    NAMES

30396bcd7ffb        docker.io/mysql:5.7.17   "docker-entrypoint.sh"   7 hours ago         Up 7 hours          0.0.0.0:3309->3306/tcp   s3-docker

6644ab2fa9ae        docker.io/mysql:5.7.17   "docker-entrypoint.sh"   7 hours ago         Up 7 hours          0.0.0.0:3308->3306/tcp   s2-docker

7ca53c437c5a        docker.io/mysql:5.7.17   "docker-entrypoint.sh"   8 hours ago         Up 8 hours          0.0.0.0:3307->3306/tcp   s1-docker

报错时在宿主机查看日志:

[root@iz2zec57gfl6i9vbtdksl1z conf.d]# docker logs <CONTAINER ID>

通过如下命令登录到Docker容器的操作系统中,再进入MySQL实例,启动MGR。我们目前设置的是Single Primary模式的MGR,先启动第一个Primary实例

[root@iz2zec57gfl6i9vbtdksl1z ~]# docker exec -it s1-docker bash

root@mysql-mgr-server1:/# mysql -uroot -p123456

mysql: [Warning] Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 116

Server version: 5.7.17-log MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SET SQL_LOG_BIN=0;

Query OK, 0 rows affected (0.00 sec)

mysql> CREATE USER rpl_user@'%';

Query OK, 0 rows affected (0.00 sec)

mysql> GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%' IDENTIFIED BY 'rpl_pass';

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.00 sec)

mysql> SET SQL_LOG_BIN=1;

Query OK, 0 rows affected (0.00 sec)

mysql> CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='rpl_pass' FOR CHANNEL 'group_replication_recovery';

Query OK, 0 rows affected, 2 warnings (0.03 sec)

mysql> INSTALL PLUGIN group_replication SONAME 'group_replication.so';

Query OK, 0 rows affected (0.01 sec)

mysql> SET GLOBAL group_replication_bootstrap_group=ON;

Query OK, 0 rows affected (0.01 sec)

mysql> START GROUP_REPLICATION;

Query OK, 0 rows affected (0.01 sec)

mysql> SET GLOBAL group_replication_bootstrap_group=OFF;

Query OK, 0 rows affected (0.01 sec)

mysql> SELECT * FROM performance_schema.replication_group_members;

+---------------------------+--------------------------------------+-------------------+-------------+--------------+

| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST       | MEMBER_PORT | MEMBER_STATE |

+---------------------------+--------------------------------------+-------------------+-------------+--------------+

| group_replication_applier | d79c04bf-87a3-11e7-865f-0242ac130002 | mysql-mgr-server1 |        3306 | ONLINE

+---------------------------+--------------------------------------+-------------------+-------------+--------------+

3 rows in set (0.00 sec)

mysql>

启动第二个只读实例:

[root@iz2zec57gfl6i9vbtdksl1z ~]# docker exec -it s2-docker bash

root@mysql-mgr-server2:/# mysql -uroot -p123456

mysql: [Warning] Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 3

Server version: 5.7.17-log MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SET SQL_LOG_BIN=0;

Query OK, 0 rows affected (0.00 sec)

mysql> CREATE USER rpl_user@'%';

Query OK, 0 rows affected (0.00 sec)

mysql> GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%' IDENTIFIED BY 'rpl_pass';

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.00 sec)

mysql> SET SQL_LOG_BIN=1;

Query OK, 0 rows affected (0.00 sec)

mysql> CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='rpl_pass' FOR CHANNEL 'group_replication_recovery';

Query OK, 0 rows affected, 2 warnings (0.03 sec)

mysql> INSTALL PLUGIN group_replication SONAME 'group_replication.so';

Query OK, 0 rows affected (0.01 sec)

mysql> START GROUP_REPLICATION;

Query OK, 0 rows affected (5.52 sec)

mysql> SELECT * FROM performance_schema.replication_group_members;

+---------------------------+--------------------------------------+-------------------+-------------+--------------+

| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST       | MEMBER_PORT | MEMBER_STATE |

+---------------------------+--------------------------------------+-------------------+-------------+--------------+

| group_replication_applier | d79c04bf-87a3-11e7-865f-0242ac130002 | mysql-mgr-server1 |        3306 | ONLINE       |

| group_replication_applier | f7127f84-87a5-11e7-97af-0242ac130003 | mysql-mgr-server2 |        3306 | ONLINE       |

+---------------------------+--------------------------------------+-------------------+-------------+--------------+

2 rows in set (0.00 sec)

启动第三个只读实例:

[root@iz2zec57gfl6i9vbtdksl1z ~]# docker exec -it s3-docker bash

root@mysql-mgr-server3:/# mysql -uroot -p123456

mysql: [Warning] Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 3

Server version: 5.7.17-log MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SET SQL_LOG_BIN=0;

Query OK, 0 rows affected (0.00 sec)

mysql> CREATE USER rpl_user@'%';

Query OK, 0 rows affected (0.00 sec)

mysql> GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%' IDENTIFIED BY 'rpl_pass';

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.00 sec)

mysql> SET SQL_LOG_BIN=1;

Query OK, 0 rows affected (0.00 sec)

mysql> CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='rpl_pass' FOR CHANNEL 'group_replication_recovery';

Query OK, 0 rows affected, 2 warnings (0.03 sec)

mysql> INSTALL PLUGIN group_replication SONAME 'group_replication.so';

Query OK, 0 rows affected (0.01 sec)

mysql> START GROUP_REPLICATION;

Query OK, 0 rows affected (0.01 sec)

mysql> SELECT * FROM performance_schema.replication_group_members;

+---------------------------+--------------------------------------+-------------------+-------------+--------------+

| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST       | MEMBER_PORT | MEMBER_STATE |

+---------------------------+--------------------------------------+-------------------+-------------+--------------+

| group_replication_applier | d79c04bf-87a3-11e7-865f-0242ac130002 | mysql-mgr-server1 |        3306 | ONLINE       |

| group_replication_applier | f7127f84-87a5-11e7-97af-0242ac130003 | mysql-mgr-server2 |        3306 | ONLINE       |

| group_replication_applier | feeee99d-87a5-11e7-97cb-0242ac130004 | mysql-mgr-server3 |        3306 | ONLINE       |

+---------------------------+--------------------------------------+-------------------+-------------+--------------+

3 rows in set (0.00 sec)

start group_replication可能一些问题

mysql> START GROUP_REPLICATION;

ERROR 3092 (HY000): The server is not configured properly to be an active member of the group. Please see more details on error log.

解决办法:回到宿主机中查看错误日志:

[root@iz2zec57gfl6i9vbtdksl1z ~]# docker logs -f -t --tail=10 <CONTAINER ID >


问题1:

2017-08-23T02:24:51.177878000Z 2017-08-23T02:24:51.175681Z 0 [Warning] Plugin group_replication reported: '[GCS] Connection attempt from IP address 172.19.0.4 refused. Address is not in the IP whitelist.'

2017-08-23T02:24:51.178024000Z 2017-08-23T02:24:51.175721Z 0 [ERROR] Plugin group_replication reported: '[GCS] Error connecting to the local group communication engine instance.'

2017-08-23T02:24:51.178176000Z 2017-08-23T02:24:51.175728Z 0 [Note] Plugin group_replication reported: 'state 4257 action xa_exit'

2017-08-23T02:24:51.178312000Z 2017-08-23T02:24:51.175798Z 0 [Note] Plugin group_replication reported: 'Exiting xcom thread'

2017-08-23T02:24:52.209910000Z 2017-08-23T02:24:52.209376Z 0 [ERROR] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 33061'

2017-08-23T02:25:51.176542000Z 2017-08-23T02:25:51.175539Z 3 [ERROR] Plugin group_replication reported: 'Timeout on wait for view after joining group'

2017-08-23T02:25:51.176898000Z 2017-08-23T02:25:51.175647Z 3 [Note] Plugin group_replication reported: 'Requesting to leave the group despite of not being a member'

2017-08-23T02:25:51.177142000Z 2017-08-23T02:25:51.175676Z 3 [ERROR] Plugin group_replication reported: '[GCS] The member is leaving a group without being on one.'

2017-08-23T02:25:51.179057000Z 2017-08-23T02:25:51.175896Z 3 [Note] Plugin group_replication reported: 'auto_increment_increment is reset to 1'

2017-08-23T02:25:51.179354000Z 2017-08-23T02:25:51.175905Z 3 [Note] Plugin group_replication reported: 'auto_increment_offset is reset to 1'

2017-08-23T02:25:51.179567000Z 2017-08-23T02:25:51.177979Z 15 [Note] Error reading relay log event for channel 'group_replication_applier': slave SQL thread was killed

2017-08-23T02:25:51.185216000Z 2017-08-23T02:25:51.184778Z 12 [Note] Plugin group_replication reported: 'The group replication applier thread was killed'

解决:

mysql> set global group_replication_ip_whitelist='172.19.0.0/24' ;

Query OK, 0 rows affected (0.00 sec)

问题2:

2017-08-23T02:29:34.592161000Z 2017-08-23T02:29:34.590561Z 0 [Note] Plugin group_replication reported: 'state 4277 action xa_complete'

2017-08-23T02:29:34.592311000Z 2017-08-23T02:29:34.590696Z 0 [Note] Plugin group_replication reported: 'new state x_run'

2017-08-23T02:29:35.691341000Z 2017-08-23T02:29:35.689373Z 0 [ERROR] Plugin group_replication reported: 'This member has more executed transactions than those present in the group. Local transactions: feeee99d-87a5-11e7-97cb-0242ac130004:1-5 > Group transactions: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-8,

2017-08-23T02:29:35.691504000Z d79c04bf-87a3-11e7-865f-0242ac130002:1-5,

2017-08-23T02:29:35.691652000Z f7127f84-87a5-11e7-97af-0242ac130003:1-5'

2017-08-23T02:29:35.691806000Z 2017-08-23T02:29:35.689397Z 0 [ERROR] Plugin group_replication reported: 'The member contains transactions not present in the group. The member will now exit the group.'

2017-08-23T02:29:35.691957000Z 2017-08-23T02:29:35.689401Z 0 [Note] Plugin group_replication reported: 'To force this member into the group you can use the group_replication_allow_local_disjoint_gtids_join option'

解决:

mysql> show variables like 'group_replication_allow_local_disjoint_gtids_join';     

+---------------------------------------------------+-------+

| Variable_name                                     | Value |

+---------------------------------------------------+-------+

| group_replication_allow_local_disjoint_gtids_join | OFF   |

+---------------------------------------------------+-------+

1 row in set (0.00 sec)

mysql> set global group_replication_allow_local_disjoint_gtids_join=1;

Query OK, 0 rows affected (0.00 sec)

mysql> START GROUP_REPLICATION;                                               

Query OK, 0 rows affected (2.12 sec)


测试:

在s1-docker创建库test,表test1

mysql> create database test

1 row in set (0.00 sec)

mysql> use test;

Database changed

mysql> create table test1 (id int primary key,name varchar(12));

Query OK, 0 rows affected (0.05 sec)

mysql> insert into test1 values (123,'abc');

Query OK, 1 row affected (0.00 sec)

mysql> select * from test1;

+-----+------+

| id  | name |

+-----+------+

| 111 | aaa  |

+-----+------+

2 rows in set (0.00 sec)

mysql>


在s2-docker查看是否同步:

root@mysql-mgr-server2:/var/lib/mysql# mysql -uroot -p123456

mysql: [Warning] Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 117

Server version: 5.7.17-log MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use test;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

mysql> select * from test1;

+-----+------+

| id  | name |

+-----+------+

| 111 | aaa  |

+-----+------+

2 rows in set (0.00 sec)

在s3-docker查看是否同步:

root@mysql-mgr-server3:/var/lib/mysql# mysql -uroot -p123456

mysql: [Warning] Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 119

Server version: 5.7.17-log MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use test;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

mysql> select * from test1;

+-----+------+

| id  | name |

+-----+------+

| 111 | aaa  |

+-----+------+

2 rows in set (0.00 sec)

主要参考mysql官方文档:

https://dev.mysql.com/doc/refman/5.7/en/group-replication-deploying-in-single-primary-mode.html

部分参考文档来源:

https://mp.weixin.qq.com/s/ORgPKcvThHMMsrtrjROuBQ

http://mysqlhighavailability.com/mysqlha/gr/doc/getting_started.html#deploying-a-group-with-three-servers-in-multi-master-mode

时间: 2024-12-01 16:04:28

阿里云ECS通过docker配置MySQL--MGR的相关文章

阿里云ECS拥抱Docker

阿里云ECS用户能使用Docker容器应用了,您能在ECS上把应用打包成Docker镜像.运行Docker容器,从我们提供的镜像库中快速下载官方镜像,或者部署自己的私有镜像库,并和伙伴们分享和协作. 什么是Docker? Docker是一个开源项目,诞生于2013年初,最初是dotCloud公司内部的一个业余项目.它基于Google公司推出的Go语言实现. Docker以Linux容器LXC为基础,实现轻量级的操作系统虚拟化解决方案.在LXC的基础上Docker进行了进一步的封装,让用户不需要去

阿里云ECS服务器升级配置、提前续费、重装系统常见应用记录

如今阿里云在IDC圈中的影响力和产品的范围广度已经严重影响到很多主机商的利益,照着这样的趋势发展,不断的增加产品种类以及各种周边的服务延伸,很多国内的个人主机商.企业类的主机商肯定需要调整原有的营销和产品模式.但是对于大部分用户来说,增加的竞争会使得我们降低成本,比如如今选择虚拟主机.VPS服务器等相对来说价格还是比较便宜.   老蒋手中有两台当初阿里云ECS服务器512MB内存方案配置,不过目前最低的配置方案是1GB内存方案,相对来说老配置方案比较难得且需要保留的,但是觉得两台机器有点浪费.老

阿里云ECS服务器Centos7配置vsftpd时,chroot_local_user与chroot_list_enable的组合效果

centos7配置vsftpd多主机多用户时,chroot_local_user与chroot_list_enable的组合效果 ------------------------------------------------------------------------------------------------ 修改配置文件 [root@localhost ~]# vim /etc/vsftpd/vsftpd.conf 这个配置文件的以下参数组合会有多种可能 chroot_local_

阿里云ECS Docker Machine Driver入门指南

+++ title = "Aliyun Elastic Compute Service" description = "Aliyun driver for machine" keywords = ["machine, aliyun, driver, ecs"] [menu.main] parent="smn_machine_drivers" +++ Docker Machine Driver of Aliyun ECS Doc

阿里云ecs服务器实例如何选择配置?(最详细教程)

阿里云ecs服务器实例如何选择配置? 购买前请先领取阿里云幸运券随机优惠还能百分百中奖小米电源一个!幸运的话中一等奖还能获得iPad mini. 1.阿里云ecs服务器实例地域配置: 计费方式建议选择"包年包月" 2.阿里云ecs服务器实例地域配置: 阿里云节点地区所对应的城市如下: 华北1:青岛 华北2:北京 华北3:张家口 华北5:呼和浩特 华东1:杭州 华东2:上海 华南1:深圳 华北地区:北京,天津,河北,山西,内蒙古. 华东地区:上海,江苏,浙江,山东,安徽. 华南地区:广东

阿里云ecs服务器价格_阿里云主机价格表

很多新手想购买阿里云ecs服务器,但由于对价格方面不是很了解,所以会找阿里云价格表作为参考了解一下.但都没能给出满意的答案,其实阿里云ecs服务器价格不是固定的,根据ecs服务器不同的配置,价格也会有所不同哦!但是可以到阿里云价格询价表,点击进去这个链接,然后根据自己要选择的ecs服务器配置给出对应价格.下图为阿里云服务器产品截图的基本价格表.(该截图只截取一小部分)   请在购买阿里云ecs服务器时先领取阿里云幸运券,幸运券可以在官方优惠上再加优惠,实现优惠加优惠哦! 通过阿里云询价表知道阿里

Xshell使用SSH远程登录阿里云ECS服务器CentOS7

Xshell使用SSH远程登录阿里云ECS服务器CentOS7 ---------------------------------------------- 新购买一台阿里云ECS服务器,配置根据自己选择 1.配置安全组入方向 TCP 22/22 端口允许通过 2.重新启动服务器 3.root登录 4.查看22端口是否开放 [root@localhost ~]# netstat -tnl 如果显示以下内容就说明22端口已经开放 Active Internet connections (only

使用Docker Machine管理阿里云ECS

Docker Machine是一个docker管理工具,它解决了docker的两个问题: docker只能运行在Linux上 docker只能管理运行本机的docker镜像. 本质上docker-machine是一个虚拟机管理工具,它通过创建一个安装好docker的虚拟机(支持VirtualBox,DigitalOcean,EC2等),并设置对应的环境变量(DOCKER_HOST,DOCKER_MACHINE_NAME等),使得本地的docker工具获得透明远程操作虚拟机的能力.从而使本身不支持

使用阿里云ECS自动化配置框架对实例的管理员账号进行自定义

1. 实例自动化配置框架 实例自动化配置框架是阿里云ECS为用户提供的一种自定义实例启动行为的架构,详细信息请参考阿里云线上帮助文档:https://help.aliyun.com/knowledge_detail/49121.html   本文档主要介绍怎么通过该框架在创建实例时让用户自己定义实例的管理员用户的方法. 2. 场景 用户想要在阿里云ECS购买时中达到如下的效果: 1) 不使用ECS默认自带的root用户作为管理员(具体用户可在脚本中进行禁止远程登录) 2) 创建一个新的管理员用户