CloudCone 重建系统&安装宝塔相应问题及其解决方法

文章首发于公众号【小白书签】:https://mp.weixin.qq.com/s/ySg0Ril9FR3qunanTAbrPw

由于网站流量不大,之前一直使用的甲骨文免费服务器。但人们常说免费的才是最贵的,其实也有一定道理。中途遇到机器莫名其妙被删除了,好在一直有备份,新买了服务器,折腾好久才恢复。后来,又买了 CloudCone 服务器备用,最近把网站切换到了 CloudCone,顺便记录下。

重建系统一直无法完成

由于比较习惯使用宝塔面板 7.7 版本,而据说这个版本又对 Centos7.x 系统兼容性最好。因此,就把 CloudCone 服务器系统重建(RE-INSTALL VPS)为 Centos 7.9,结果“InstallRecipe”任务进程的状态一直是“RUNNING”。后来发现只要服务器正常在线,即便“InstallRecipe”的状态并未完成,并不影响安装宝塔面板。

CloudCone 重建系统.webp

安装 curl 报错

安装宝塔面板后,原以为接下来就没什么了,没想到一波三折。在给服务器开启 BBR,安装 wget 和 curl 时,出现下方报错信息:

[root@www ~]# yum -y install wget
[root@www ~]# yum -y install curl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"


 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>
        or
            subscription-manager repos --disable=<repoid>

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: base/7/x86_64

而随之而来的问题是,在宝塔面板后台,点击“网站”会提示“请先安装web服务器”(即 Apache 或者 Nginx)。可以预料到,依旧是安装失败。

那么,Centos7 下 yum 安装报错Cannot find a valid baseurl for repo: base/7/x86_64怎么办呢?您可以尝试以下解决方法:

1.分别使用 ping 和nslookup命令,检查网络连接和 DNS 配置,如无问题,则继续往下看

2.更换镜像站点

其实上述报错代码中已有提示Could not resolve host: mirrorlist.centos.org; Unknown error,我们替换为国内下载加速“yum 源配置”到/etc/yum.repos.d/CentOS-Base.repo即可。在替换镜像源之前,建议使用命令先备份原有的 yum 源配置文件mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

  • 阿里云 CentOS 7 源(推荐):

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

或者

sudo curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

  • 更多国内镜像源(用于替换上述命令中的配置文件地址)

http://mirrors.aliyun.com/repo/Centos-7.repo

http://mirrors.cloud.tencent.com/repo/centos7_base.repo

https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo

http://mirrors.163.com/.help/CentOS7-Base-163.repo

3.清理缓存并生成新缓存,之后重试 wget 和 curl 安装命令即可

yum clean all
yum makecache

MySQL 无法启动

点击启用 MySQL 数据库后,提示“mysqld服务已启动”,但其依然是停止状态。按照网上一些教程操作,也并未奏效。后来发现通过“编译安装”(与“极速安装”相对)后,(MySQL 5.6)可以正常启用了。

其实上述教程不只适用于 CloudCone 的服务器,其他服务器遇到类似问题,也可以参考。最后,还是不得不感慨一下,CloudCone 服务器是真的便宜!

0

评论0

没有账号?注册  忘记密码?

社交账号快速登录

微信扫一扫关注
如已关注,请回复“登录”二字获取验证码