Linux环境安装1

一 概述

1.1 概要

  • 模拟真实项目,碰到难题,使用技术/解决方案/架构设计思想;
  • 缓存架构,高并发;
  • 基于hystrix,缓存架构高可用的,高可用架构的设计以及相关的技术;
  • 商品详情页系统架构 -> 缓存架构 -> 高并发技术+解决方案+架构 -> 高可用技术+解决方案+架构

1.2 网站商品页变更

  • 小电商: 修改商品信息,重新渲染商品页;
  • 大电商: 商品服务(mysql)->ehcache->redis<-nginx(html 模板,本地缓存[有效期如10分钟])<-前端;

1.3 redis的重要性

redis架构,每秒钟几十万的访问量QPS,99.99%的高可用性,TB级的海量的数据,备份和恢复;
存取redis,存数据,取数据,支撑你的缓存架构,最基础的就是redis架构;
解决各种各样高并发场景下的缓存面临的难题,缓存架构中不断的引入各种解决方案和技术,解决高并发的问题 ;
解决各种各样缓存架构本身面临的高可用的问题,缓存架构中引入各种解决方案和技术,解决高可用的问题;

1.4 环境准备

1.4.1 安装CentOS,安装JDK和Perl;

1.4.2 CentOS集群安装

CentOS 64-2: ip 92.168.17.132
CentOS 64-3: ip 92.168.17.133
CentOS 64-4: ip 92.168.17.134
CentOS 64-5: ip 92.168.17.135

1.4.3 CentOS为ssh免密码互相通信

1.4.3.1 首先在全部四台机器上配置对本机的ssh免密码登录

ssh-keygen -t rsa
生成本机的公钥,过程中不断敲回车即可,ssh-keygen命令默认会将公钥放在/root/.ssh目录下
cp /root/.ssh/id_rsa.pub authorized_keys
将公钥复制为authorized_keys文件,此时使用ssh连接本机就不需要输入密码了;

[root@eshop-cache01 ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
62:a8:d4:d6:5f:34:17:89:8e:ea:09:3f:6a:17:d4:fa root@eshop-cache01
The key's randomart image is:
+--[ RSA 2048]----+
|           ...   |
|          . ..   |
|       . oo .    |
|   . o. o..o     |
|  . +.+oS .      |
| . o..+o .       |
|  .  + +.        |
|    . * E        |
|   ..o .         |
+-----------------+

[root@eshop-cache01 ~]# cp /root/.ssh/id_rsa.pub authorized_keys
1.4.3.2 在2/3/4号机器密钥copy至1号机器:进入2/3/4机器"ssh-copy-id -i eshop-cache01";


[root@eshop-cache02 ~]# ssh-copy-id -i eshop-cache01
The authenticity of host 'eshop-cache01 (192.168.17.132)' can't be established.
RSA key fingerprint is ef:62:5b:eb:a5:73:13:86:24:83:bb:b5:d6:0c:d4:3e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'eshop-cache01,192.168.17.132' (RSA) to the list of known hosts.
root@eshop-cache01's password: 
Now try logging into the machine, with "ssh 'eshop-cache01'", and check in:

  .ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

[root@eshop-cache02 ~]# 

1.4.3.3 此时查看1号机器有全部机器的密钥
[root@eshop-cache01 ~]# cat /root/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6lmJmQxxB7rXV1F/RTUHea+Vh0Cpf+p0m9kYd7NYE8tTLWcwOReqlXeXGMxWC0rJ5HZIfVdtTHVm6OAemvtID3Jpoo/v+MGzsa9rOQinww9F6FT9fo8+1aWAEY2jHCdNnakzX/0U5Cm7zbLkajmSn/89Xm5BnUtoyejDq3jKlAoBSvYs1ESNGRUeh46oCZvEvyF1rJnqktvjH7Sk09IKudMmMu/LV8nKI/YfxP64tJxG2TvuTlt/xB2d7Fif5ZnCDeLy1cVsz+7Crzy6jiz2lhOlXfCFi2oO******************************************************== root@eshop-cache01
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAv+jNq29W+FI14pAsMb6AHTMC38vwxmd5BHwWTqwSHwQAVJd83rTUSFqVDJkAca3YA4ehoMEzv67ygKpANS4w8UmqW1Pq/jg+hCnCG9R+KAGtWbVaPToCvG3mHbZepH42uM6WYtKXNgO6V9oj7C3SSDM7BtVQejtbBiJXW9lLhH6sB2YTWw5vgb+Ng4gkivrQkTFu+P1taZMr86Xv/BSen5mxB/PKsPsY/EOJavtt5y6ZxB8DodgP03V4x8HKtmNgTpYy///cgeWSn2hwgXQ2AEThpVJxRk7N******************************************************== root@eshop-cache02 
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6pSjkxsdPKbMpkH9EUy/pDXpm34ydRENVgA8T1Iy8zWIXoTArOLME0sEzR68eLa66gSTCqx+yyJs2KPtpIm2zA6XI26RMQGi7FyQdn4D7XUOSqC1rqQsoYN2kAJouc4tSf9UIqIKgmHWNozgBUut6cwvU/im7wMtp0lzAa7Sdf4y4gIpv3MW7vpRvGBVuPzvHeN1W/yfpHh9YO3+9Fgfgu3MeAZBWibh2kI6iUExhpDx/S7ePNcgF+aYt9I9wgNM8z7VieNZZb507Dgz9FPrMcwGFqKIp+bB******************************************************== root@eshop-cache03
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtl/cXr2YMiM+HkUBsD/7DBsK6Yl8GiSLJDEpiibBol2lHBmlJqa7/HQqvMOLDPAaqbtMjPhXFa4UVHSB3dISJk41PyugS05AO6Nqqc62RQ35uZwoQkz1r0hMdq1dOVdCy3r7SVqJDBaabhBHaogX7l7XD1s28uLK/z0d/yaQfnK90QuJu/vyhblhzPWDYkZAM0SnpIWakx4D7EucKUhAf2bVgvjJpBLphgOd5PvbxXj5JXUcwD9Q4x3N9son4bfPjcPCo9seXnUaGlFFEUpEUxeSyPUe4T1t******************************************************== root@eshop-cache04
[root@eshop-cache01 ~]# 

1.4.3.4 将全部密钥复制2/3/4机器

scp /root/.ssh/authorized_keys eshop-cache02:/root/.ssh/
scp /root/.ssh/authorized_keys eshop-cache03:/root/.ssh/
scp /root/.ssh/authorized_keys eshop-cache04:/root/.ssh/

2 其它

2.1 安装rzsz

[root@eshop-cache01 soft_bob]# yum -y install lrzsz 
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base

处理如下:

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
vim /etc/yum.repos.d/CentOS-Base.repo

修改后内容如下:

[centos-office]
name=centos-office
failovermethod=priority
baseurl=https://vault.centos.org/6.10/os/x86_64/
gpgcheck=1
gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6

然后在安装即可

yum -y install lrzsz 

你可能感兴趣的:(linux,运维,服务器)