39.企业阿里云云计算集群实践


1.阿里云服务器架构
公有云:亚马逊云,阿里云
https://account.aliyun.com/
支付宝扫码登录即可
账户名:crmntb
  

安全组;防火墙
VPC,搭建内部网络;内外网交换机、路由器等一堆
SLB;负载均衡
ECS,云服务器;普通服务器
RDS,阿里云数据库;数据库
OSS;存储

2.创建ECS并绑定EIP
  
  

  
点击购买 ECS实例,
  

  
  
  
  

aliyun@123
  
  
  
  

交换机的私有IP,但此刻没有公网IP,
  

申请公网IP:
  
  
  
  

绑定弹性公网IP:
  
  
  
  
118.190.201.169(弹性)
10.0.0.185(私有)


本地远程登录云服务器:
118.190.201.169
aliyun@123

[root@iZm5ec2th4yjgfmambk376Z ~]# hostname ecs01
[root@iZm5ec2th4yjgfmambk376Z ~]# logout
Connecting to 118.190.201.169:22...
[root@ecs01 ~]# hostname -I
10.0.0.185
[root@ecs01 ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.185 netmask 255.255.255.0 broadcast 10.0.0.255


接下来,数据库和存储:
3.创建RDS完成LAMP搭建
(1)实践部署lnmp-wordpress:
[root@ecs01 ~]# yum install -y vim unzip lrzsz nfs-utils
[root@ecs01 ~]# hostname nginx-web01
[root@ecs01 ~]# echo 'nginx-web01' >>/etc/networks
[root@ecs01 ~]# grep nginx /etc/networks
nginx-web01
[root@ecs01 ~]# echo '127.0.0.1 nginx-web01' >>/etc/hosts
[root@ecs01 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 nginx-web01
[root@ecs01 ~]# ping nginx-web01

[root@ecs01 ~]# mkdir /alidata && cd /tmp/
[root@nginx-web01 tmp]# ll
total 8388
-rw-r--r-- 1 root root 106187 Mar 15 13:35 sh-1.5.5.zip
-rw-r--r-- 1 root root 8479240 Mar 15 13:35 wordpress-4.7-zh_CN.tar.gz

[root@nginx-web01 tmp]# unzip sh-1.5.5.zip && chmod 777 -R sh-1.5.5 && cd sh-1.5.5 && ./install.sh
Please select the web of nginx/apache, input 1 or 2 : 1
Please select the nginx version of 1.4.4, input 1: 1
Please select the web of php/tomcat, input 1 or 2: 1
Please select the php version of 5.2.17/5.3.29/5.4.23/5.5.7, input 1 or 2 or 3 or 4 : 4
Please select the mysql version of 5.1.73/5.5.40/5.6.21, input 1 or 2 or 3 : 3

[root@nginx-web01 sh-1.5.5]# tree /alidata/ -L 2
/alidata/
├── log
│   ├── mysql
│   ├── nginx
│   └── php
├── server
│   ├── mysql -> /alidata/server/mysql-5.6.21
│   ├── mysql-5.6.21
│   ├── nginx -> /alidata/server/nginx-1.4.4
│   ├── nginx-1.4.4
│   ├── php -> /alidata/server/php-5.5.7
│   └── php-5.5.7
├── website-info.log
└── www
└── phpwind

[root@nginx-web01 ~]# /etc/init.d/mysqld stop
[root@nginx-web01 ~]# /etc/init.d/vsftpd stop

(2)创建阿里云数据库:
  
  

创建存储,选择文件存储NAS:
  
  
太贵,暂时不买存储包了。

  
  
点击管理,设置白名单,点击基本信息:
内网地址:rm-m5efu26q5at29irgl.mysql.rds.aliyuncs.com //会自动解析为IP
[root@nginx-web01 ~]# ping rm-m5efu26q5at29irgl.mysql.rds.aliyuncs.com
PING rm-m5efu26q5at29irgl.mysql.rds.aliyuncs.com (10.0.0.186) 56(84) bytes of data.
64 bytes from 10.0.0.186 (10.0.0.186): icmp_seq=1 ttl=64 time=0.152 ms
64 bytes from 10.0.0.186 (10.0.0.186): icmp_seq=2 ttl=64 time=0.198 ms
ping通这说明可以使用该数据库了。


创建阿里云的wordpress数据库和用户,密码:oldboy123*
  

  

  

安装wordpress:
[root@nginx-web01 ~]# cd /tmp && tar xf wordpress-4.7-zh_CN.tar.gz -C /alidata/www/ && cd /alidata/www/ && chown www.www -R wordpress[root@nginx-web01 www]# ll
total 8
drwxr-xr-x 26 www www 4096 Mar 15 16:53 phpwind
drwxr-xr-x 5 www www 4096 Dec 8 2016 wordpress

[root@nginx-web01 www]# cd /alidata/server/nginx/conf/vhosts && cp phpwind.conf wordpress.conf && \mv phpwind.conf phpwind.conf.bak && sed -i 's#phpwind#wordpress#g' wordpress.conf

[root@nginx-web01 vhosts]# nginx -t
nginx: the configuration file /alidata/server/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /alidata/server/nginx/conf/nginx.conf test is successful
[root@nginx-web01 vhosts]# /etc/init.d/nginx reload


输入:118.190.201.169
进入wordpress部署界面:
  
  
  

密码:oldboy123*
内网地址:rm-m5efu26q5at29irgl.mysql.rds.aliyuncs.com

至此,完成创建阿里云的服务器和阿里云的数据库。

SLB

4.释放所有按量付费项目
  
  
  
  
  
  

  释放后24小时即可提现。

posted @ 2018-03-15 17:58  bkycrmn  阅读(179)  评论(0)    收藏  举报