分享解决的问题

linux问题

一、yum安装某个软件时找不到mirrorlist.txt

Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Update 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

解决方法:

1、切换到 /etc/yum.repos.d/ 目录:
# cd /etc/yum.repos.d/
2、备份旧文件以防不测
# cp CentOS-Base.repo CentOS-Base.repo.old
3、打开 vi CentOS-Base.repo并做如下替换
[base]
name=CentOS-$releasever - Base
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
# baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=https://vault.centos.org/6.10/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

# released updates
[updates]
name=CentOS-$releasever - Updates
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
# baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=https://vault.centos.org/6.10/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

# additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
# baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
baseurl=https://vault.centos.org/6.10/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
4、yum clean all 和yum update

至此,一般情况都可以使用了。
如果碰到以下错误
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again 或http://download.fedoraproject.org/pub/epel/6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - “The requested URL returned error: 404 Not Found”
解决方法:

vim epel.repo,把epel的mirror屏蔽,把baseurl打开并且换成https://vault.centos.org/6.10/os/$basearch/

二、linux设置多网卡

ifconfig eth1:13 127.0.0.1(你的ip)  netmask 255.255.255.0 up

三、linux下使用ab进行post方式压测

ab -c 1 -n 1  -v 4 -p 'post.txt' -T "application/x-www-form-urlencoded" "http://hdbdt.com/api/add"
    -p:模拟post请求的数据,文件格式为a=1&b=2,配合-T使用
    -T:post数据所使用的Content-Type头信息
	-c:代表并发的客户端的个数
	-n:代表并发的总数
  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值