To solve the problem of slow access to official sources when installing dependencies, Tencent Cloud has set up a cache service for some software. You can accelerate the installation of dependencies by using the Tencent Cloud software repository, which currently supports public network access and private network access.
http://mirrors.cloud.tencent.com/
http://mirrors.tencentyun.com/
- This document takes the public network access address of the Tencent Cloud software repository as an example to introduce how to use the software sources in the Tencent Cloud software repository in CVM. If you access the repository using a private network, please replace the public network access address with the private network access address.
- The source address used in this document is for reference only. Please obtain the latest address from the Tencent Cloud software repository.
The Tencent Cloud software repository updates software sources from the official website of each software source once per day.
You have already logged in to CVM.
Before using the Tencent Cloud image source, please confirm your CVM has Python installed.
Execute the following command to install pip using Tencent Could PyPI.
pip install pip -i the directory where PyPI is located in
For example, if the PyPI you need to use is in the http://mirrors.cloud.tencent.com/pypi/simple
directory, execute the following command:
pip install 17monip -i http://mirrors.cloud.tencent.com/pypi/simple --trusted-host mirrors.cloud.tencent.com
Execute the following command to modify the index-url
parameter in the ~/.pip/pip.conf
file to the source path of the Tencent Cloud software repository.
[global]
index-url = the directory where PyPI is located in
trusted-host = public network/private network access address
For example, if the PyPI you need to use is in the http://mirrors.cloud.tencent.com/pypi/simple
directory, execute the following command:
[global]
index-url = http://mirrors.cloud.tencent.com/pypi/simple
trusted-host = mirrors.cloud.tencent.com
Before using the Tencent Cloud image source, please confirm your CVM has JDK and Maven installed.
settings.xml
configuration file of Maven.<mirrors> ... </ mirrors>
code block and configure the following content into it. <mirror>
<id>nexus-tencentyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus tencentyun</name>
<url>http://mirrors.cloud.tencent.com/nexus/repository/maven-public/</url>
</mirror>
Before using the Tencent Cloud image source, please confirm your CVM has Node.js and NPM installed.
Execute the following command to install NPM using the Tencent Cloud NPM.
npm config set registry http://mirrors.cloud.tencent.com/npm/
No manual configuration is required. When the CVM in the Tencent Kubernetes Engine (TKE) cluster creates a node, Docker will be installed automatically and configured with the Tencent Cloud private network image.
Before using the Tencent Cloud Docker, please confirm your CVM has Docker installed.
Only Docker 1.3.2 or later versions support the Docker Hub Mirror mechanism. If you have not installed Docker 1.3.2 or later versions, or if the installed version is too old, please install or upgrade it first.
Choose different operation steps based on the operating system of the CVM.
/etc/default/docker
configuration file.vim /etc/default/docker
DOCKER_OPTS="--registry-mirror=https://mirror.ccs.tencentyun.com"
/etc/docker/daemon.json
configuration file.vim /etc/docker/daemon.json
{
"registry-mirrors": [
"https://mirror.ccs.tencentyun.com"
]
}
sudo su echo "EXTRA_ARGS=\"–registry-mirror=https://mirror.ccs.tencentyun.com\"" >> /var/lib/boot2docker/profile exit
The following steps take CentOS 7 as an example. Specific steps vary by operating system.
MariaDB.repo
file under /etc/yum.repos.d/
.vi /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.2 CentOS7-amd64
[mariadb]
name = MariaDB
baseurl = http://mirrors.cloud.tencent.com/mariadb/yum/10.2/centos7-amd64/
gpgkey = http://mirrors.cloud.tencent.com/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
yum clean all
yum install MariaDB-client MariaDB-server
The following steps take MongoDB 4.0 as an example. If you need to install another version, please change the version number in the mirror path.
mongodb.repo
file under /etc/yum.repos.d/
.vi /etc/yum.repos.d/mongodb.repo
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=http://mirrors.cloud.tencent.com/mongodb/yum/el7-4.0
gpgcheck=0
enabled=1
yum install -y mongodb-org
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 68818C72E52529D4
mirror
path.#Debian 8
echo "deb http://mirrors.cloud.tencent.com/mongodb/apt/debian jessie/mongodb-org/4.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
#Debian 9
echo "deb http://mirrors.cloud.tencent.com/mongodb/apt/debian stretch/mongodb-org/4.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 68818C72E52529D4
mirror
path.#Ubuntu 14.04
echo "deb [ arch=amd64 ] http://mirrors.cloud.tencent.com/mongodb/apt/ubuntu trusty/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
#Ubuntu 16.04
echo "deb [ arch=amd64 ] http://mirrors.cloud.tencent.com/mongodb/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
#Ubuntu 18.04
echo "deb [ arch=amd64 ] http://mirrors.cloud.tencent.com/mongodb/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
Before using the Tencent Cloud image source, please confirm your CVM has Ruby installed.
Execute the following command to modify the RubyGems source address.
gem source -r https://rubygems.org/
gem source -a http://mirrors.cloud.tencent.com/rubygems/
Was this page helpful?