杭州校区切换校区

新闻资讯

  • news

    腾科暑假班圆满结束啦

    发布时间:2018-08-18

    <p style="font-family:&quot;color:#333333;font-size:14px;background-color:#FFFFFF;">随着高温天气的结束,腾科暑假班也进入结束时刻,经过一个炎热暑假的学习,相信都有很大的收获。</p><p style="font-family:&quot;color:#333333;font-size:14px;background-color:#FFFFFF;">大家每天顶着炙热的太阳来上课,学习条件虽然很艰苦,但是依然挡不住学员们对知识的渴望,每天在教室里跟着老师做实验,跟着老师学知识,别人的暑假是在家各种躺,而你们是各种忙,这么努力的你们,相信未来的道路,一定是比别人平坦的,短暂的暑假虽然过去,但是未来的周末班、下一次暑假班我们再聚,再聚首腾科,我们一起努力。</p><p style="font-family:&quot;color:#333333;font-size:14px;background-color:#FFFFFF;"><br></p><p style="font-family:&quot;color:#333333;font-size:14px;background-color:#FFFFFF;"><br></p><p style="font-family:&quot;color:#333333;font-size:14px;background-color:#FFFFFF;"><img src="http://115.29.210.249/tggPic/content/2018-08/1534586141388.jpg" data-ke-src="http://115.29.210.249/tggPic/content/2018-08/1534586141388.jpg" alt=""></p><p style="font-family:&quot;color:#333333;font-size:14px;background-color:#FFFFFF;"><img src="http://115.29.210.249/tggPic/content/2018-08/1534586188058.jpg" data-ke-src="http://115.29.210.249/tggPic/content/2018-08/1534586188058.jpg" alt=""></p><p style="font-family:&quot;color:#333333;font-size:14px;text-indent:2em;text-align:justify;background-color:#FFFFFF;">腾科IT教育集团是广州腾科网络技术有限公司旗下运营的网站平台。腾科是一家以提供新型、领先的IT技术培训(教育)解决方案为主要经营目标的专业公司。目前,腾科是思科(Cisco)、甲骨文(Oracle)、红帽(Red Hat)、华为(Huawei)、微软(Microsoft)、美国计算机行业协会(CompTIA)等国际知名IT厂商的合作伙伴,并且是其指定的授权培训和考试中心;另外还是Pearson VUE国际电子考试中心、普尔文(Prometric)国际IT认证考试中心、达索(solidworks)、安氏(LinkTrust)的授权经销商、共青团中央青年就业创业基地。同时腾科也与国内华南理工大学、华南师范大学、上海理工大学、深圳大学、长江大学、浙江工业大学等众多高等院校,立足于取之于高校、铸之于腾科、用之于企业的新理念,积极开展IT认证技能培训和IT职业课程教育,培养新型IT高级人才。</p><p style="font-family:&quot;color:#333333;font-size:14px;text-indent:2em;text-align:justify;background-color:#FFFFFF;">腾科向企业和IT从业人员提供众多高端IT培训课程。职业认证集中学习式培训、量身定做企业定制式培训、言传身教实地辅导式培训。</p>
  • news

    这十项 Linux 常识,作为 Linux运维的你真的懂了吗?

    发布时间:2018-07-29

    <p><span style="color:#D82821;font-size:15px;">1、GNU和GPL</span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:15px;"></span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;"><strong><span style="color:#FFA900;">GNU</span></strong><span>计划(又称革奴计划),是由Richard Stallman(理查德·斯托曼)在1983年9月27日公开发起的自由软件集体协作计划。它的目标是创建一套完全自由的操作系统。GNU也称为自由软件工程项目。</span></span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;"><strong><span style="font-size:15px;color:#FFA900;">GPL</span></strong><span style="font-size:15px;">是GNU的通用公共许可证(GNU General Public License,GPL),即“反版权”概念,是GNU协议之一,目的是保护GNU软件可以自由的使用、复制、研究、修改和发布。同时要求软件必须以源代码的形式发布。</span></span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;">GNU系统与Linux内核结合构成一个完整的操作系统:一个基于Linux的GNU系统,该操作系统在通常情况下称为“GNU/Linux”,或简称Linux。</span></p><p style="color:#333333;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;background-color:#FFFFFF;"><br></p><p><span style="color:#D82821;font-size:15px;">2、Linux发行版</span></p><p style="color:#333333;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;">&nbsp;一个典型的Linux发行版包括:Linux内核,一些GNU程序库和工具,命令行shell,图形界面的X Window系统和相应的桌面环境,如KDE或GNOME,并包含数千种从办公套件,编译器,文本编辑器到科学工具的应用软件。</span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;"><strong><span style="font-size:15px;">主流的发行版:</span></strong></span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;">Red Hat Enterprise Linux、CentOS、SUSE、Ubuntu、Debian、Fedora、Gentoo</span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><br></p><p><span style="color:#D82821;font-size:15px;">3、Unix和Linux</span></p><p style="color:#333333;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;">Linux是基于Unix的,属于Unix类,Uinx操作系统支持多用户、多任务、多线程和支持多种CPU架构的操作系统。Linux继承了Unix以网络为核心的设计思想,是一个性能稳定的多用户网络操作系统。</span></p><p><span style="color:#D82821;font-size:15px;">4、Swap分区</span></p><p style="color:#333333;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;">Swap分区,即交换区,系统在物理内存不够时,与Swap进行交换。即当系统的物理内存不够用时,把硬盘中一部分空间释放出来,以供当前运行的程序使用。当那些程序要运行时,再从Swap分区中恢复保存的数据到内存中。那些被释放内存空间的程序一般是很长时间没有什么操作的程序。</span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;">Swap空间一般应大于或等于物理内存的大小,同时最小不应小于64M,最大应该是物理内存的两倍。</span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><br></p><p><span style="color:#D82821;font-size:15px;">5、GRUB的概念</span></p><p style="color:#333333;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;">GNU GRUB(GRand Unified Bootloader简称“GRUB”)是一个来自GNU项目的多操作系统启动引导管理程序。</span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;">GRUB是一个支持多种操作系统的启动引导管理器,在一台有多个操作系统的计算机中,可以通过GRUB在计算机启动时选择用户希望运行的操作系统。同时GRUB可以引导Linux系统分区上的不同内核,也可用于向内核传递启动参数,如进入单用户模式。</span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;">&nbsp; &nbsp;&nbsp;</span></p><p><span style="color:#D82821;font-size:15px;">6、Buffer和Cache</span></p><p style="color:#333333;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;"><strong><span style="color:#FFA900;">Cache</span></strong><span>(缓存)位于CPU与内存之间的临时存储器,缓存容量比内存小的多但交换速度比内存要快得多。Cache通过缓存文件数据块,解决CPU运算速度与内存读写速度不匹配的矛盾,提高CPU和内存之间的数据交换速度。Cache缓存越大,CPU处理速度越快。</span></span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;"><strong><span style="font-size:15px;color:#FFA900;">Buffer</span></strong><span style="font-size:15px;">(缓冲)高速缓冲存储器,通过缓存磁盘(I/O设备)数据块,加快对磁盘上数据的访问,减少I/O,提高内存和硬盘(或其他I/O设备)之间的数据交换速度。Buffer是即将要被写入磁盘的,而Cache是被从磁盘中读出来的。</span></span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><br></p><p><span style="color:#D82821;font-size:15px;">7、TCP三次握手</span></p><p style="color:#333333;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;background-color:#FFFFFF;"><br></p><ol class="list-paddingleft-2" style="color:#333333;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;background-color:#FFFFFF;"><li><p><span style="font-size:14px;">请求端发送SYN(SYN=A)数据包,等待响应端确认</span></p></li><li><p><span style="font-size:14px;">响应端接收SYN,并返回SYN(A+1)和自己的ACK(K)包给请求端</span></p></li><li><p><span style="font-size:14px;">请求端接收到响应端的SYN+ACK包,再次向响应端发送确认包ACK(K+1)</span></p></li></ol><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;">请求端和响应端建立TCP连接,完成三次握手,开始进行数据传输</span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><br></p><p><span style="color:#D82821;font-size:15px;">8、linux系统目录结构</span></p><p style="color:#333333;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;">Linux文件系统采用带链接的树形目录结构,即只有一个根目录(通常用“/”表示),其中含有下级子目录或文件的信息;子目录中又可含有更下级的子目录或者文件的信息。</span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><br></p><ul class="list-paddingleft-2" style="color:#333333;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;background-color:#FFFFFF;"><li><p><span style="font-size:14px;">/:第一层次结构的根,整个文件系统层次结构的根目录。即文件系统的入口,最高一级目录。</span></p></li><li><p><span style="font-size:14px;">/boot:包含Linux内核及系统引导程序所需的文件,例如kernel、initrd;grub系统引导管理器也在这个目录下。</span></p></li><li><p><span style="font-size:14px;">/bin:基本系统所需要的命令,功能和"/usr/bin"类似,这个目录下的文件都是可执行的.普通用户也是可以执行的。 &nbsp; &nbsp;</span></p></li><li><p><span style="font-size:14px;">/sbin:基本的系统维护命令,只能由超级用户使用。</span></p></li><li><p><span style="font-size:14px;">/etc:所有的系统配置文件。</span></p></li><li><p><span style="font-size:14px;">/dev:设备文件存储目录.像终端、磁盘、光驱等。</span></p></li><li><p><span style="font-size:14px;">/var:存放经常变动的数据,像日志、邮件等。</span></p></li><li><p><span style="font-size:14px;">/home:普通用户的目录默认存储目录。 &nbsp;</span></p></li><li><p><span style="font-size:14px;">/opt:第三方软件的存放目录,比如用户自定义软件包和编译的软件包就安装到这个目录中。</span></p></li><li><p><span style="font-size:14px;">/lib:库文件和内核模块存放目录,包含系统程序所需要的所有共享库文件。</span></p></li></ul><p style="color:#333333;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;background-color:#FFFFFF;"><br></p><p><span style="color:#D82821;font-size:15px;">9、硬链接和软链接</span></p><p style="color:#333333;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;"><strong><span style="color:#FFA900;">硬链接</span></strong><span>(Hard Link):硬链接是使用同一个索引节点(inode号)的链接, 即可以允许多个文件名指向同一个文件索引节点(硬链接不支持目录链接,不能跨分区链接),删除一个硬链接,不会影响该索引节点的源文件以及其下的多个硬链接。</span></span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;">ln source new-link</span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;"><strong><span style="font-size:15px;color:#FFA900;">软连接</span></strong><span style="font-size:15px;">(符号链接,Symbolic Link):符号链接是以路径的形式创建的链接,类似于windows的快捷方式链接,符号链接允许创建多个文件名链接到同一个源文件,删除源文件,其下的所有软连接将不可用。(软连接支持目录,支持跨分区、跨文件系统)</span></span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;">ln -s source new-link</span></p><p><span style="color:#D82821;font-size:15px;">10、RAID技术</span></p><p style="color:#333333;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;">磁盘阵列(Redundant Arrays of independent Disks,RAID),廉价冗余(独立)磁盘阵列。</span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;">RAID是一种把多块独立的物理硬盘按不同的方式组合起来形成一个硬盘组(逻辑硬盘),提供比单个硬盘更高的存储性能和数据备份技术。RAID技术,可以实现把多个磁盘组合在一起作为一个逻辑卷提供磁盘跨越功能;可以把数据分成多个数据块(Block)并行写入/读出多个磁盘以提高访问磁盘的速度;可以通过镜像或校验操作提供容错能力。具体的功能以不同的RAID组合实现。</span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;">在用户看来,RAID组成的磁盘组就像是一个硬盘,可以对它进行分区、格式化等操作。RAID的存储速度比单个硬盘高很多,并且可以提供自动数据备份,提供良好的容错能力。</span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><br></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;color:#007AAA;"><strong><span style="font-size:15px;">RAID级别,不同的RAID组合方式分为不同的RAID级别:</span></strong></span></p><p style="font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;color:#3E3E3E;background-color:#FFFFFF;"><span style="font-size:14px;"><strong><span style="font-size:15px;"><br></span></strong></span></p><ol class="list-paddingleft-2" style="color:#333333;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:17px;text-align:justify;background-color:#FFFFFF;"><li><p><span style="font-size:14px;"><strong><span style="color:#FFA900;">RAID 0:</span></strong><span>称为Stripping条带存储技术,所有磁盘完全地并行读,并行写,是组建磁盘阵列最简单的一种形式,只需要2块以上的硬盘即可,成本低,可以提供整个磁盘的性能和吞吐量,但RAID 0没有提供数据冗余和错误修复功能,因此单块硬盘的损坏会导致所有的数据丢失。(RAID 0只是单纯地提高磁盘容量和性能,没有为数据提供可靠性保证,适用于对数据安全性要求不高的环境)</span></span></p></li><li><p><span style="font-size:14px;"><strong><span style="color:#FFA900;">RAID 1:</span></strong><span>镜像存储,通过把两块磁盘中的一块磁盘的数据镜像到另一块磁盘上, 实现数据冗余,在两块磁盘上产生互为备份的数据,其容量仅等于一块磁盘的容量。当数据在写入一块磁盘时,会在另一块闲置的磁盘上生产镜像,在不影响性能情况下最大限度的保证系统的可靠性和可修复性;当原始数据繁忙时,可直接从镜像拷贝中读取数据(从两块硬盘中较快的一块中读出),提高读取性能。相反的,RAID 1的写入速度较缓慢。RAID 1一般支持“热交换”,即阵列中硬盘的移除或替换可以在系统运行状态下进行,无须中断退出系统。RAID 1是磁盘阵列中硬盘单位成本最高的,但它提供了很高的数据安全性、可靠性和可用性,当一块硬盘失效时,系统可以自动切换到镜像磁盘上读写,而不需要重组失效的数据。</span></span></p></li><li><p><span style="font-size:14px;"><strong><span style="color:#FFA900;">RAID 0+1:</span></strong><span>也被称为RAID 10,实际是将RAID 0和RAID 1结合的形式,在连续地以位或字节为单位分割数据并且并行读/写多个磁盘的同时,为每一块磁盘做镜像进行冗余。通过RAID 0+1的组合形式,数据除分布在多个盘上外,每个盘都有其物理镜像盘,提供冗余能力,允许一个以下磁盘故障,而不影响数据可用性,并且有快速读/写能力。RAID 0+1至少需要4个硬盘在磁盘镜像中建立带区集。RAID 0+1技术在保证数据高可靠性的同时,也保证了数据读/写的高效性。</span></span></p></li><li><p><span style="font-size:14px;"><strong><span style="color:#FFA900;">RAID 5:</span></strong><span>是一种存储性能、数据安全和存储成本兼顾的存储解决方案。RAID 5可以理解为是RAID 0和RAID 1的折衷方案,RAID 5至少需要三块硬盘。RAID 5可以为系统提供数据安全保障,但保障程度要比镜像低而磁盘空间利用率要比镜像高。RAID 5具有和RAID 0相近似的数据读取速度,只是多了一个奇偶校验信息,写入数据的速度比对单个磁盘进行写入操作稍慢。同时由于多个数据对应一个奇偶校验信息,RAID 5的磁盘空间利用率要比RAID 1高,存储成本相对较低,是目前运用较多的一种解决方案。</span></span></p></li></ol>
  • news

    入门MySQL数据库导入与导出及重置root密码

    发布时间:2018-07-15

    <h5 style="font-size:1em;font-family:-apple-system-font, BlinkMacSystemFont, &quot;text-align:justify;color:#37474F;background-color:#FFFFFF;"><span style="font-size:inherit;color:inherit;line-height:inherit;">如何导入和导出数据库</span></h5><p style="color:inherit;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:inherit;text-align:justify;background-color:#FFFFFF;">要导出数据库,打开终端,确保您未登录MySQL并键入,</p> <pre><span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">mysqldump</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">-u</span>&nbsp;<span class="" style="font-size:inherit;color:inherit;line-height:inherit;">[username]</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">-p</span>&nbsp;<span class="" style="font-size:inherit;color:inherit;line-height:inherit;">[database&nbsp;name]</span>&nbsp;&gt;&nbsp;<span class="" style="font-size:inherit;color:inherit;line-height:inherit;">[database&nbsp;name]</span><span class="" style="font-size:inherit;line-height:inherit;color:#A5DA2D;">.sql</span>&nbsp;</pre> <p style="color:inherit;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:inherit;text-align:justify;background-color:#FFFFFF;">您在命令中选择的数据库现在将导出到您的Droplet。</p><p style="color:inherit;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:inherit;text-align:justify;background-color:#FFFFFF;">要导入数据库,首先在MySQL shell中创建一个新的空白数据库作为数据的目标。</p> <pre><span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">CREATE</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">DATABASE</span>&nbsp;newdatabase;&nbsp;</pre> <p style="color:inherit;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:inherit;text-align:justify;background-color:#FFFFFF;">然后注销MySQL shell,并在命令行中键入以下命令:</p> <pre>mysql&nbsp;-u&nbsp;[username]&nbsp;-p&nbsp;newdatabase&nbsp;With&nbsp;that,&nbsp;your&nbsp;chosen&nbsp;database&nbsp;has&nbsp;been&nbsp;imported&nbsp;into&nbsp;your&nbsp;destination&nbsp;database&nbsp;in&nbsp;MySQL.&nbsp;&nbsp; How&nbsp;to&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">Reset</span>&nbsp;a&nbsp;Root&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">Password</span> <span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">When</span>&nbsp;you&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">first</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">install</span>&nbsp;MySQL,&nbsp;you&nbsp;have&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">to</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">set</span>&nbsp;up&nbsp;your&nbsp;root&nbsp;password.&nbsp;However,&nbsp;should&nbsp;you&nbsp;forget&nbsp;it&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">at</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">any</span>&nbsp;point,&nbsp;you&nbsp;can&nbsp;still&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">recover</span>&nbsp;it.&nbsp;&nbsp; Step&nbsp;One—Shut&nbsp;Down&nbsp;MySQL <span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">In</span>&nbsp;terminal,&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">stop</span>&nbsp;the&nbsp;MySQL&nbsp;process &nbsp;/etc/init.d/mysql&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">stop</span> Step&nbsp;Two—<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">Access</span>&nbsp;MySQL&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">Safe</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">Mode</span> <span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">In</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">safe</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">mode</span>,&nbsp;you&nbsp;will&nbsp;be&nbsp;able&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">to</span>&nbsp;make&nbsp;changes&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">within</span>&nbsp;the&nbsp;MySQL&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">system</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">with</span>&nbsp;a&nbsp;root&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">password</span>&nbsp;alone,&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">without</span>&nbsp;the&nbsp;need&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">for</span>&nbsp;MySQL&nbsp;root&nbsp;password. sudo&nbsp;mysqld_safe&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#808080;">--skip-grant-tables&nbsp;&amp;&nbsp;Once&nbsp;safe&nbsp;mode&nbsp;has&nbsp;started&nbsp;up,&nbsp;log&nbsp;into&nbsp;MySQL&nbsp;and&nbsp;when&nbsp;prompted,&nbsp;use&nbsp;your&nbsp;standard&nbsp;root&nbsp;password.</span> mysql&nbsp;-u&nbsp;root&nbsp;mysql Step&nbsp;Three—<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">Set</span>&nbsp;Up&nbsp;a&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">New</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">Password</span> Finally,&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">set</span>&nbsp;up&nbsp;the&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">new</span>&nbsp;MySQL&nbsp;root&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">password</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">by</span>&nbsp;typing&nbsp;the&nbsp;command&nbsp;below.&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">Replace</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#EEDC70;">"newpassword"</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">with</span>&nbsp;the&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">password</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">of</span>&nbsp;your&nbsp;choice. <span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">update</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">user</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">set</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">password</span>=<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">PASSWORD</span>(<span class="" style="font-size:inherit;line-height:inherit;color:#EEDC70;">"newpassword"</span>)&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">where</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">User</span>=<span class="" style="font-size:inherit;line-height:inherit;color:#EEDC70;">'root'</span>;&nbsp;Be&nbsp;sure&nbsp;to&nbsp;reload&nbsp;everything: &nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">FLUSH</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">PRIVILEGES</span>;&nbsp;and&nbsp;you&nbsp;now&nbsp;have&nbsp;a&nbsp;new&nbsp;root&nbsp;password. By&nbsp;Etel&nbsp;Sverdlov</pre> <p style="color:inherit;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:inherit;text-align:justify;background-color:#FFFFFF;">这样,您选择的数据库已导入到MySQL中的目标数据库。</p><h5 style="font-size:1em;font-family:-apple-system-font, BlinkMacSystemFont, &quot;text-align:justify;color:#37474F;background-color:#FFFFFF;"><span style="font-size:inherit;color:inherit;line-height:inherit;">如何重置root密码</span></h5><p style="color:inherit;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:inherit;text-align:justify;background-color:#FFFFFF;">当您首次安装MySQL时,您必须设置root密码。但是,如果你忘记它在任何时候,你仍然可以恢复它。</p><h5 style="font-size:1em;font-family:-apple-system-font, BlinkMacSystemFont, &quot;text-align:justify;color:#37474F;background-color:#FFFFFF;"><span style="font-size:inherit;color:inherit;line-height:inherit;">第一步 - 关闭MySQL</span></h5><p style="color:inherit;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:inherit;text-align:justify;background-color:#FFFFFF;">在终端中,停止MySQL进程</p><p style="color:inherit;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:inherit;text-align:justify;background-color:#FFFFFF;">/etc/init.d/mysql stop</p><h5 style="font-size:1em;font-family:-apple-system-font, BlinkMacSystemFont, &quot;text-align:justify;color:#37474F;background-color:#FFFFFF;"><span style="font-size:inherit;color:inherit;line-height:inherit;">第二步 - 访问MySQL安全模式</span></h5><p style="color:inherit;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:inherit;text-align:justify;background-color:#FFFFFF;">在安全模式下,您将能够在MySQL系统中单独使用root密码进行更改,而无需MySQL root密码。</p> <pre><span class="" style="font-size:inherit;line-height:inherit;color:#EEDC70;">sudo</span>&nbsp;mysqld_safe&nbsp;--skip-grant-tables&nbsp;&amp;&nbsp;</pre> <p style="color:inherit;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:inherit;text-align:justify;background-color:#FFFFFF;">一旦安全模式启动,登录MySQL并提示,使用您的标准root密码。</p> <pre><span class="" style="font-size:inherit;line-height:inherit;color:#EEDC70;">mysql</span>&nbsp;-u&nbsp;root&nbsp;mysql</pre> <h5 style="font-size:1em;font-family:-apple-system-font, BlinkMacSystemFont, &quot;text-align:justify;color:#37474F;background-color:#FFFFFF;"><span style="font-size:inherit;color:inherit;line-height:inherit;">第三步 - 设置新密码</span></h5><p style="color:inherit;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:inherit;text-align:justify;background-color:#FFFFFF;">最后,通过键入以下命令设置新的MySQL root密码。将“newpassword”替换为您选择的密码。</p> <pre><span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">update</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">user</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">set</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">password</span>=<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">PASSWORD</span>(<span class="" style="font-size:inherit;line-height:inherit;color:#EEDC70;">"newpassword"</span>)&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">where</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">User</span>=<span class="" style="font-size:inherit;line-height:inherit;color:#EEDC70;">'root'</span>;</pre> <p style="color:inherit;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:inherit;text-align:justify;background-color:#FFFFFF;">一定要重新加载一切:</p> <pre>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">FLUSH</span>&nbsp;<span class="" style="font-size:inherit;line-height:inherit;color:#F82375;">PRIVILEGES</span>;&nbsp;</pre> <p style="color:inherit;font-family:-apple-system-font, BlinkMacSystemFont, &quot;font-size:inherit;text-align:justify;background-color:#FFFFFF;">并且您现在有一个新的root密码。</p>
  • news

    MySQL 文档存储介绍

    发布时间:2018-06-24

    <p style="font-family:&quot;color:#333333;font-size:14px;background-color:#FFFFFF;"><span style="font-family:Optima-Regular, PingFangTC-light;line-height:28px;">MySQL 文档存储 可以跳过底层数据结构创建、数据规范化和其它使用传统数据库时需要做的工作,直接存储数据。</span></p><p style="font-family:&quot;color:#333333;font-size:14px;background-color:#FFFFFF;"><span style="font-family:Optima-Regular, PingFangTC-light;line-height:28px;"></span></p><p style="font-family:Optima-Regular, PingFangTC-light;color:#333333;font-size:14px;background-color:#FFFFFF;text-align:justify;">MySQL 可以提供 NoSQL JSON&nbsp;文档存储Document Store了,这样开发者保存数据前无需规范化normalize数据、创建数据库,也无需在开发之前就制定好数据样式。从 MySQL 5.7 版本和 MySQL 8.0 版本开始,开发者可以在表的一列中存储 JSON 文档。由于引入 X DevAPI,你可以从你的代码中移除令人不爽的结构化查询字符串,改为使用支持现代编程设计的 API 调用。</p><p style="font-family:Optima-Regular, PingFangTC-light;color:#333333;font-size:14px;background-color:#FFFFFF;text-align:justify;">系统学习过结构化查询语言(SQL)、关系理论relational theory、集合set和其它关系数据库底层理论的开发者并不多,但他们需要一个安全可靠的数据存储。如果数据库管理人员不足,事情很快就会变得一团糟,</p><p style="font-family:Optima-Regular, PingFangTC-light;color:#333333;font-size:14px;background-color:#FFFFFF;text-align:justify;"><span style="font-family:&quot;color:#4D8AD8;line-height:28px;">MySQL 文档存储</span><span class="" style="font-family:&quot;color:#FFFFFF;line-height:1em;font-size:9px;vertical-align:super;background-color:#666666;">[1]</span>&nbsp;允许开发者跳过底层数据结构创建、数据规范化和其它使用传统数据库时需要做的工作,直接存储数据。只需创建一个 JSON&nbsp;文档集合document collection,接着就可以使用了。</p><p class="" style="font-family:Optima-Regular, PingFangTC-light;color:#FFFFFF;text-align:justify;font-size:1.4em;background-color:#3F51B5;">JSON 数据类型</p><p style="font-family:Optima-Regular, PingFangTC-light;color:#333333;font-size:14px;background-color:#FFFFFF;text-align:justify;">所有这一切都基于多年前 MySQL 5.7 引入的 JSON 数据类型。它允许在表的一行中提供大约 1GB 大小的列。数据必须是有效的 JSON,否则服务器会报错;但开发者可以自由使用这些空间。</p><p class="" style="font-family:Optima-Regular, PingFangTC-light;color:#FFFFFF;text-align:justify;font-size:1.4em;background-color:#3F51B5;">X DevAPI</p><p style="font-family:Optima-Regular, PingFangTC-light;color:#333333;font-size:14px;background-color:#FFFFFF;text-align:justify;">旧的 MySQL 协议已经历经差不多四分之一个世纪,已经显现出疲态,因此新的协议被开发出来,协议名为&nbsp;<span style="font-family:&quot;color:#4D8AD8;line-height:28px;">X DevAPI</span><span class="" style="font-family:&quot;color:#FFFFFF;line-height:1em;font-size:9px;vertical-align:super;background-color:#666666;">[2]</span>。协议引入高级会话概念,允许代码从单台服务器扩展到多台,使用符合通用主机编程语言样式common host-language programming patterns的非阻塞异步 I/O。需要关注的是如何遵循现代实践和编码风格,同时使用 CRUD (Create、 Replace、 Update、 Delete)样式。换句话说,你不再需要在你精美、纯洁的代码中嵌入丑陋的 SQL 语句字符串。</p><p style="font-family:Optima-Regular, PingFangTC-light;color:#333333;font-size:14px;background-color:#FFFFFF;text-align:justify;">一个新的 shell 支持这种新协议,即所谓的&nbsp;<span style="font-family:&quot;color:#4D8AD8;line-height:28px;">MySQL Shell</span><span class="" style="font-family:&quot;color:#FFFFFF;line-height:1em;font-size:9px;vertical-align:super;background-color:#666666;">[3]</span>。该 shell 可用于设置高可用集群high-availability cluster、检查服务器升级就绪状态upgrade readiness以及与 MySQL 服务器交互。支持的交互方式有以下三种:JavaScript,Python 和 SQL。</p><p class="" style="font-family:Optima-Regular, PingFangTC-light;color:#FFFFFF;text-align:justify;font-size:1.4em;background-color:#3F51B5;">代码示例</p><p style="font-family:Optima-Regular, PingFangTC-light;color:#333333;font-size:14px;background-color:#FFFFFF;text-align:justify;">下面的代码示例基于 JavaScript 方式使用 MySQL Shell,可以从&nbsp;JS&gt;&nbsp;提示符看出。</p><p style="font-family:Optima-Regular, PingFangTC-light;color:#333333;font-size:14px;background-color:#FFFFFF;text-align:justify;">下面,我们将使用用户&nbsp;dstokes&nbsp;、密码&nbsp;password&nbsp;登录本地系统上的&nbsp;demo&nbsp;库。db&nbsp;是一个指针,指向&nbsp;demo&nbsp;库。</p> <pre class=""><ol class="list-paddingleft-2"><li><p><span class="" style="color:#B8FFB8;line-height:28px;">$ mysqlsh dstokes</span><span class="" style="color:#B8FFB8;line-height:28px;">:</span><span class="" style="color:#B8FFB8;line-height:28px;">password@localhost</span><span class="" style="color:#B8FFB8;line-height:28px;">/</span><span class="" style="color:#B8FFB8;line-height:28px;">demo</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">JS</span><span class="" style="color:#B8FFB8;line-height:28px;">&gt;</span><span class="" style="color:#B8FFB8;line-height:28px;"> db</span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#B8FFB8;line-height:28px;">createCollection</span><span class="" style="color:#B8FFB8;line-height:28px;">(</span><span class="" style="color:#65B042;line-height:28px;">"example"</span><span class="" style="color:#B8FFB8;line-height:28px;">)</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">JS</span><span class="" style="color:#B8FFB8;line-height:28px;">&gt;</span><span class="" style="color:#B8FFB8;line-height:28px;"> db</span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#B8FFB8;line-height:28px;">example</span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#B8FFB8;line-height:28px;">add</span><span class="" style="color:#B8FFB8;line-height:28px;">(</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; &nbsp; &nbsp; </span><span class="" style="color:#B8FFB8;line-height:28px;">{</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="" style="color:#89BDFF;line-height:28px;">Name</span><span class="" style="color:#B8FFB8;line-height:28px;">:</span><span class="" style="color:#B8FFB8;line-height:28px;"> </span><span class="" style="color:#65B042;line-height:28px;">"Dave"</span><span class="" style="color:#B8FFB8;line-height:28px;">,</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="" style="color:#89BDFF;line-height:28px;">State</span><span class="" style="color:#B8FFB8;line-height:28px;">:</span><span class="" style="color:#B8FFB8;line-height:28px;"> &nbsp;</span><span class="" style="color:#65B042;line-height:28px;">"Texas"</span><span class="" style="color:#B8FFB8;line-height:28px;">,</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; &nbsp; &nbsp; &nbsp; foo </span><span class="" style="color:#B8FFB8;line-height:28px;">:</span><span class="" style="color:#B8FFB8;line-height:28px;"> </span><span class="" style="color:#65B042;line-height:28px;">"bar"</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; &nbsp; &nbsp; </span><span class="" style="color:#B8FFB8;line-height:28px;">}</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; &nbsp; &nbsp;</span><span class="" style="color:#B8FFB8;line-height:28px;">)</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">JS</span><span class="" style="color:#B8FFB8;line-height:28px;">&gt;</span></p></li></ol></pre> <p style="font-family:Optima-Regular, PingFangTC-light;color:#333333;font-size:14px;background-color:#FFFFFF;text-align:justify;">在上面的示例中,我们登录服务器,连接到&nbsp;demo&nbsp;库,创建了一个名为&nbsp;example&nbsp;的集合,最后插入一条记录;整个过程无需创建表,也无需使用 SQL。只要你能想象的到,你可以使用甚至滥用这些数据。这不是一种代码对象与关系语句之间的映射器,因为并没有将代码映射为 SQL;新协议直接与服务器层打交道。</p><p class="" style="font-family:Optima-Regular, PingFangTC-light;color:#FFFFFF;text-align:justify;font-size:1.4em;background-color:#3F51B5;">Node.js 支持</p><p style="font-family:Optima-Regular, PingFangTC-light;color:#333333;font-size:14px;background-color:#FFFFFF;text-align:justify;">新 shell 看起来挺不错,你可以用其完成很多工作;但你可能更希望使用你选用的编程语言。下面的例子使用&nbsp;world_x&nbsp;示例数据库,搜索&nbsp;_id&nbsp;字段匹配&nbsp;CAN.&nbsp;的记录。我们指定数据库中的特定集合,使用特定参数调用&nbsp;find&nbsp;命令。同样地,操作也不涉及 SQL。</p> <pre class=""><ol class="list-paddingleft-2"><li><p><span class="" style="color:#E28964;line-height:28px;">var</span><span class="" style="color:#B8FFB8;line-height:28px;"> mysqlx </span><span class="" style="color:#B8FFB8;line-height:28px;">=</span><span class="" style="color:#B8FFB8;line-height:28px;"> </span><span class="" style="color:#E28964;line-height:28px;">require</span><span class="" style="color:#B8FFB8;line-height:28px;">(</span><span class="" style="color:#65B042;line-height:28px;">'@mysql/xdevapi'</span><span class="" style="color:#B8FFB8;line-height:28px;">);</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">mysqlx</span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#B8FFB8;line-height:28px;">getSession</span><span class="" style="color:#B8FFB8;line-height:28px;">({</span><span class="" style="color:#B8FFB8;line-height:28px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="" style="color:#AEAEAE;line-height:28px;font-style:italic;">//Auth to server</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; &nbsp; &nbsp; &nbsp; host</span><span class="" style="color:#B8FFB8;line-height:28px;">:</span><span class="" style="color:#B8FFB8;line-height:28px;"> </span><span class="" style="color:#65B042;line-height:28px;">'localhost'</span><span class="" style="color:#B8FFB8;line-height:28px;">,</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; &nbsp; &nbsp; &nbsp; port</span><span class="" style="color:#B8FFB8;line-height:28px;">:</span><span class="" style="color:#B8FFB8;line-height:28px;"> </span><span class="" style="color:#65B042;line-height:28px;">'33060'</span><span class="" style="color:#B8FFB8;line-height:28px;">,</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; &nbsp; &nbsp; &nbsp; dbUser</span><span class="" style="color:#B8FFB8;line-height:28px;">:</span><span class="" style="color:#B8FFB8;line-height:28px;"> </span><span class="" style="color:#65B042;line-height:28px;">'root'</span><span class="" style="color:#B8FFB8;line-height:28px;">,</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; &nbsp; &nbsp; &nbsp; dbPassword</span><span class="" style="color:#B8FFB8;line-height:28px;">:</span><span class="" style="color:#B8FFB8;line-height:28px;"> </span><span class="" style="color:#65B042;line-height:28px;">'password'</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">}).</span><span class="" style="color:#E28964;line-height:28px;">then</span><span class="" style="color:#B8FFB8;line-height:28px;">(</span><span class="" style="color:#E28964;line-height:28px;">function</span><span class="" style="color:#B8FFB8;line-height:28px;"> </span><span class="" style="color:#B8FFB8;line-height:28px;">(</span><span class="" style="color:#B8FFB8;line-height:28px;">session</span><span class="" style="color:#B8FFB8;line-height:28px;">)</span><span class="" style="color:#B8FFB8;line-height:28px;"> </span><span class="" style="color:#B8FFB8;line-height:28px;">{</span><span class="" style="color:#B8FFB8;line-height:28px;"> &nbsp; &nbsp;</span><span class="" style="color:#AEAEAE;line-height:28px;font-style:italic;">// use world_x.country.info</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; &nbsp; &nbsp;</span><span class="" style="color:#E28964;line-height:28px;">var</span><span class="" style="color:#B8FFB8;line-height:28px;"> schema </span><span class="" style="color:#B8FFB8;line-height:28px;">=</span><span class="" style="color:#B8FFB8;line-height:28px;"> session</span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#B8FFB8;line-height:28px;">getSchema</span><span class="" style="color:#B8FFB8;line-height:28px;">(</span><span class="" style="color:#65B042;line-height:28px;">'world_x'</span><span class="" style="color:#B8FFB8;line-height:28px;">);</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; &nbsp; &nbsp;</span><span class="" style="color:#E28964;line-height:28px;">var</span><span class="" style="color:#B8FFB8;line-height:28px;"> collection </span><span class="" style="color:#B8FFB8;line-height:28px;">=</span><span class="" style="color:#B8FFB8;line-height:28px;"> schema</span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#B8FFB8;line-height:28px;">getCollection</span><span class="" style="color:#B8FFB8;line-height:28px;">(</span><span class="" style="color:#65B042;line-height:28px;">'countryinfo'</span><span class="" style="color:#B8FFB8;line-height:28px;">);</span></p></li><li></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">collection &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="" style="color:#AEAEAE;line-height:28px;font-style:italic;">// Get row for 'CAN'</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; </span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#E28964;line-height:28px;">find</span><span class="" style="color:#B8FFB8;line-height:28px;">(</span><span class="" style="color:#65B042;line-height:28px;">"$._id == 'CAN'"</span><span class="" style="color:#B8FFB8;line-height:28px;">)</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; </span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#B8FFB8;line-height:28px;">limit</span><span class="" style="color:#B8FFB8;line-height:28px;">(</span><span class="" style="color:#3387CC;line-height:28px;">1</span><span class="" style="color:#B8FFB8;line-height:28px;">)</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; </span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#B8FFB8;line-height:28px;">execute</span><span class="" style="color:#B8FFB8;line-height:28px;">(</span><span class="" style="color:#B8FFB8;line-height:28px;">doc </span><span class="" style="color:#B8FFB8;line-height:28px;">=&gt;</span><span class="" style="color:#B8FFB8;line-height:28px;"> console</span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#B8FFB8;line-height:28px;">log</span><span class="" style="color:#B8FFB8;line-height:28px;">(</span><span class="" style="color:#B8FFB8;line-height:28px;">doc</span><span class="" style="color:#B8FFB8;line-height:28px;">))</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; </span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#E28964;line-height:28px;">then</span><span class="" style="color:#B8FFB8;line-height:28px;">(()</span><span class="" style="color:#B8FFB8;line-height:28px;"> </span><span class="" style="color:#B8FFB8;line-height:28px;">=&gt;</span><span class="" style="color:#B8FFB8;line-height:28px;"> console</span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#B8FFB8;line-height:28px;">log</span><span class="" style="color:#B8FFB8;line-height:28px;">(</span><span class="" style="color:#65B042;line-height:28px;">"\n\nAll done"</span><span class="" style="color:#B8FFB8;line-height:28px;">));</span></p></li><li></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; session</span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#B8FFB8;line-height:28px;">close</span><span class="" style="color:#B8FFB8;line-height:28px;">();</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">})</span></p></li></ol></pre> <p style="font-family:Optima-Regular, PingFangTC-light;color:#333333;font-size:14px;background-color:#FFFFFF;text-align:justify;">下面例子使用 PHP,搜索&nbsp;_id&nbsp;字段匹配&nbsp;USA&nbsp;的记录:</p> <pre class=""><ol class="list-paddingleft-2"><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&lt;?</span><span class="" style="color:#B8FFB8;line-height:28px;">PHP</span></p></li><li><p><span class="" style="color:#AEAEAE;line-height:28px;font-style:italic;">// Connection parameters</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; $user </span><span class="" style="color:#B8FFB8;line-height:28px;">=</span><span class="" style="color:#B8FFB8;line-height:28px;"> </span><span class="" style="color:#65B042;line-height:28px;">'root'</span><span class="" style="color:#B8FFB8;line-height:28px;">;</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; $passwd </span><span class="" style="color:#B8FFB8;line-height:28px;">=</span><span class="" style="color:#B8FFB8;line-height:28px;"> </span><span class="" style="color:#65B042;line-height:28px;">'S3cret#'</span><span class="" style="color:#B8FFB8;line-height:28px;">;</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; $host </span><span class="" style="color:#B8FFB8;line-height:28px;">=</span><span class="" style="color:#B8FFB8;line-height:28px;"> </span><span class="" style="color:#65B042;line-height:28px;">'localhost'</span><span class="" style="color:#B8FFB8;line-height:28px;">;</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; $port </span><span class="" style="color:#B8FFB8;line-height:28px;">=</span><span class="" style="color:#B8FFB8;line-height:28px;"> </span><span class="" style="color:#65B042;line-height:28px;">'33060'</span><span class="" style="color:#B8FFB8;line-height:28px;">;</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; $connection_uri </span><span class="" style="color:#B8FFB8;line-height:28px;">=</span><span class="" style="color:#B8FFB8;line-height:28px;"> </span><span class="" style="color:#65B042;line-height:28px;">'mysqlx://'</span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#B8FFB8;line-height:28px;">$user</span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#65B042;line-height:28px;">':'</span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#B8FFB8;line-height:28px;">$passwd</span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#65B042;line-height:28px;">'@'</span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#B8FFB8;line-height:28px;">$host</span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#65B042;line-height:28px;">':'</span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#B8FFB8;line-height:28px;">$port</span><span class="" style="color:#B8FFB8;line-height:28px;">;</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; </span><span class="" style="color:#E28964;line-height:28px;">echo</span><span class="" style="color:#B8FFB8;line-height:28px;"> $connection_uri </span><span class="" style="color:#B8FFB8;line-height:28px;">.</span><span class="" style="color:#B8FFB8;line-height:28px;"> </span><span class="" style="color:#65B042;line-height:28px;">"\n"</span><span class="" style="color:#B8FFB8;line-height:28px;">;</span></p></li><li></li><li><p><span class="" style="color:#AEAEAE;line-height:28px;font-style:italic;">// Connect as a Node Session</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; $nodeSession </span><span class="" style="color:#B8FFB8;line-height:28px;">=</span><span class="" style="color:#B8FFB8;line-height:28px;"> mysql_xdevapi\getNodeSession</span><span class="" style="color:#B8FFB8;line-height:28px;">(</span><span class="" style="color:#B8FFB8;line-height:28px;">$connection_uri</span><span class="" style="color:#B8FFB8;line-height:28px;">);</span></p></li><li><p><span class="" style="color:#AEAEAE;line-height:28px;font-style:italic;">// "USE world_x" schema</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; $schema </span><span class="" style="color:#B8FFB8;line-height:28px;">=</span><span class="" style="color:#B8FFB8;line-height:28px;"> $nodeSession</span><span class="" style="color:#B8FFB8;line-height:28px;">-&gt;</span><span class="" style="color:#B8FFB8;line-height:28px;">getSchema</span><span class="" style="color:#B8FFB8;line-height:28px;">(</span><span class="" style="color:#65B042;line-height:28px;">"world_x"</span><span class="" style="color:#B8FFB8;line-height:28px;">);</span></p></li><li><p><span class="" style="color:#AEAEAE;line-height:28px;font-style:italic;">// Specify collection to use</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; $collection </span><span class="" style="color:#B8FFB8;line-height:28px;">=</span><span class="" style="color:#B8FFB8;line-height:28px;"> $schema</span><span class="" style="color:#B8FFB8;line-height:28px;">-&gt;</span><span class="" style="color:#B8FFB8;line-height:28px;">getCollection</span><span class="" style="color:#B8FFB8;line-height:28px;">(</span><span class="" style="color:#65B042;line-height:28px;">"countryinfo"</span><span class="" style="color:#B8FFB8;line-height:28px;">);</span></p></li><li><p><span class="" style="color:#AEAEAE;line-height:28px;font-style:italic;">// SELECT * FROM world_x WHERE _id = "USA"</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; $result </span><span class="" style="color:#B8FFB8;line-height:28px;">=</span><span class="" style="color:#B8FFB8;line-height:28px;"> $collection</span><span class="" style="color:#B8FFB8;line-height:28px;">-&gt;</span><span class="" style="color:#E28964;line-height:28px;">find</span><span class="" style="color:#B8FFB8;line-height:28px;">(</span><span class="" style="color:#65B042;line-height:28px;">'_id = "USA"'</span><span class="" style="color:#B8FFB8;line-height:28px;">)-&gt;</span><span class="" style="color:#B8FFB8;line-height:28px;">execute</span><span class="" style="color:#B8FFB8;line-height:28px;">();</span></p></li><li><p><span class="" style="color:#AEAEAE;line-height:28px;font-style:italic;">// Fetch/Display data</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; $data </span><span class="" style="color:#B8FFB8;line-height:28px;">=</span><span class="" style="color:#B8FFB8;line-height:28px;"> $result</span><span class="" style="color:#B8FFB8;line-height:28px;">-&gt;</span><span class="" style="color:#B8FFB8;line-height:28px;">fetchAll</span><span class="" style="color:#B8FFB8;line-height:28px;">();</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">&nbsp; var_dump</span><span class="" style="color:#B8FFB8;line-height:28px;">(</span><span class="" style="color:#B8FFB8;line-height:28px;">$data</span><span class="" style="color:#B8FFB8;line-height:28px;">);</span></p></li><li><p><span class="" style="color:#B8FFB8;line-height:28px;">?&gt;</span></p></li></ol></pre> <p style="font-family:Optima-Regular, PingFangTC-light;color:#333333;font-size:14px;background-color:#FFFFFF;text-align:justify;">可以看出,在上面两个使用不同编程语言的例子中,find&nbsp;操作符的用法基本一致。这种一致性对跨语言编程的开发者有很大帮助,对试图降低新语言学习成本的开发者也不无裨益。</p><p style="font-family:Optima-Regular, PingFangTC-light;color:#333333;font-size:14px;background-color:#FFFFFF;text-align:justify;">支持的语言还包括 C、Java、Python 和 JavaScript 等,未来还会有更多支持的语言。</p><p class="" style="font-family:Optima-Regular, PingFangTC-light;color:#FFFFFF;text-align:justify;font-size:1.4em;background-color:#3F51B5;">从两种方式受益</p><p style="font-family:Optima-Regular, PingFangTC-light;color:#333333;font-size:14px;background-color:#FFFFFF;text-align:justify;">我会告诉你使用 NoSQL 方式录入的数据也可以用 SQL 方式使用?换句话说,我会告诉你新引入的 NoSQL 方式可以访问旧式关系型表中的数据?现在使用 MySQL 服务器有多种方式,作为 SQL 服务器,作为 NoSQL 服务器或者同时作为两者。</p><span style="color:#666666;font-family:&quot;font-size:14px;background-color:#FFFFFF;"></span>
  • news

    如何在 RHEL 中使用订阅管理器启用软件仓库

    发布时间:2018-06-13

    <blockquote style="font-family:&quot;font-size:16px;"><p>了解如何在 RHEL 中使用订阅管理器来启用软件仓库。 这篇文章还包括了将系统注册到 Red Hat 的步骤、添加订阅和发生错误时的解决方案。</p></blockquote><p style="font-family:&quot;font-size:16px;">在本文中,我们将逐步介绍如何在刚安装的 RHEL 服务器中启用 Red Hat 软件仓库。</p><p style="font-family:&quot;font-size:16px;">可以利用&nbsp;subscription-manager&nbsp;命令启用软件仓库,如下所示:</p> <pre class="prettyprint linenums prettyprinted"><ol class="linenums" style="color:#AEAEAE;"><li class="L0" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;">root@kerneltalks </span><span class="com" style="color:#AEAEAE;font-style:italic;">#</span><span class="pln" style="color:#B8FFB8;"> subscription</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">manager repos </span><span class="pun" style="color:#B8FFB8;">--</span><span class="pln" style="color:#B8FFB8;">enable rhel</span><span class="pun" style="color:#B8FFB8;">-</span><span class="lit" style="color:#3387CC;">6</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">server</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">rhv</span><span class="pun" style="color:#B8FFB8;">-</span><span class="lit" style="color:#3387CC;">4</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">agent</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">beta</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">debug</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">rpms</span></li><li class="L1" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Error</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="str" style="color:#65B042;">'rhel-6-server-rhv-4-agent-beta-debug-rpms'</span><span class="pln" style="color:#B8FFB8;"> does </span><span class="kwd" style="color:#E28964;">not</span><span class="pln" style="color:#B8FFB8;"> match a valid repository ID</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Use</span><span class="pln" style="color:#B8FFB8;"> </span><span class="str" style="color:#65B042;">"subscription-manager repos --list"</span><span class="pln" style="color:#B8FFB8;"> to see valid repositories</span><span class="pun" style="color:#B8FFB8;">.</span></li></ol></pre> <p style="font-family:&quot;font-size:16px;">当您的订阅没有配置好时,您会看到上述错误。让我们一步一步地通过&nbsp;subscription-manager&nbsp;来启用软件仓库。</p><h3 id="toc_1" style="font-size:1.4em;font-family:&quot;font-weight:300;color:#FFFFFF;background-color:#3F51B5;">步骤 1:使用 Red Hat 注册您的系统</h3><p style="font-family:&quot;font-size:16px;">这里假设您已经安装了新系统并且尚未在 Red Hat 上注册。如果您已经注册了该系统,那么您可以忽略此步骤。</p><p style="font-family:&quot;font-size:16px;">您可以使用下面的命令来检查您的系统是否已在 Red Hat 注册了该订阅:</p> <pre class="prettyprint linenums prettyprinted"><ol class="linenums" style="color:#AEAEAE;"><li class="L0" style="text-indent:-28px;"><span class="com" style="color:#AEAEAE;font-style:italic;">#</span><span class="pln" style="color:#B8FFB8;"> subscription</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">manager version</span></li><li class="L1" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;">server type</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">This</span><span class="pln" style="color:#B8FFB8;"> system </span><span class="kwd" style="color:#E28964;">is</span><span class="pln" style="color:#B8FFB8;"> currently </span><span class="kwd" style="color:#E28964;">not</span><span class="pln" style="color:#B8FFB8;"> registered</span><span class="pun" style="color:#B8FFB8;">.</span></li><li class="L2" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;">subscription management server</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Unknown</span></li><li class="L3" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;">subscription management rules</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Unknown</span></li><li class="L4" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;">subscription</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">manager</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="lit" style="color:#3387CC;">1.18</span><span class="pun" style="color:#B8FFB8;">.</span><span class="lit" style="color:#3387CC;">10</span><span class="pun" style="color:#B8FFB8;">-</span><span class="lit" style="color:#3387CC;">1.el6</span></li><li class="L5" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;">python</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">rhsm</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="lit" style="color:#3387CC;">1.18</span><span class="pun" style="color:#B8FFB8;">.</span><span class="lit" style="color:#3387CC;">6</span><span class="pun" style="color:#B8FFB8;">-</span><span class="lit" style="color:#3387CC;">1.el6</span></li></ol></pre> <p style="font-family:&quot;font-size:16px;">在这里输出的第一行中,您可以看到该系统未注册。那么,让我们开始注册系统。您需要在&nbsp;subscription-manager&nbsp;命令中使用&nbsp;register&nbsp;选项。在这一步需要使用您的 Red Hat 帐户凭证。</p> <pre class="prettyprint linenums prettyprinted"><ol class="linenums" style="color:#AEAEAE;"><li class="L0" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;">root@kerneltalks </span><span class="com" style="color:#AEAEAE;font-style:italic;">#</span><span class="pln" style="color:#B8FFB8;"> subscription</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">manager </span><span class="kwd" style="color:#E28964;">register</span></li><li class="L1" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Registering</span><span class="pln" style="color:#B8FFB8;"> to</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> subscription</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">rhsm</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">redhat</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">com</span><span class="pun" style="color:#B8FFB8;">:</span><span class="lit" style="color:#3387CC;">443</span><span class="pun" style="color:#B8FFB8;">/</span><span class="pln" style="color:#B8FFB8;">subscription</span></li><li class="L2" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Username</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> admin@kerneltalks</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">com</span></li><li class="L3" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Password</span><span class="pun" style="color:#B8FFB8;">:</span></li><li class="L4" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Network</span><span class="pln" style="color:#B8FFB8;"> error</span><span class="pun" style="color:#B8FFB8;">,</span><span class="pln" style="color:#B8FFB8;"> unable to connect to server</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Please</span><span class="pln" style="color:#B8FFB8;"> see </span><span class="pun" style="color:#B8FFB8;">/</span><span class="kwd" style="color:#E28964;">var</span><span class="pun" style="color:#B8FFB8;">/</span><span class="pln" style="color:#B8FFB8;">log</span><span class="pun" style="color:#B8FFB8;">/</span><span class="pln" style="color:#B8FFB8;">rhsm</span><span class="pun" style="color:#B8FFB8;">/</span><span class="pln" style="color:#B8FFB8;">rhsm</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">log </span><span class="kwd" style="color:#E28964;">for</span><span class="pln" style="color:#B8FFB8;"> </span><span class="kwd" style="color:#E28964;">more</span><span class="pln" style="color:#B8FFB8;"> information</span><span class="pun" style="color:#B8FFB8;">.</span></li></ol></pre> <p style="font-family:&quot;font-size:16px;">如果您遇到上述错误,那么表明您的服务器无法连接到 RedHat。检查您的网络连接,或者您能<a href="https://kerneltalks.com/howto/how-to-configure-nameserver-in-linux/" data-ke-src="https://kerneltalks.com/howto/how-to-configure-nameserver-in-linux/">解决网站名称解析的问题</a>。有时候,即使你能够 ping 通订阅服务器,你也会看到这个错误。这可能是因为您的环境中有代理服务器。在这种情况下,您需要将其详细信息添加到文件&nbsp;/etc/rhsm/rhsm.conf&nbsp;中。以下详细的代理信息应根据你的环境填充:</p> <pre class="prettyprint linenums prettyprinted"><ol class="linenums" style="color:#AEAEAE;"><li class="L0" style="text-indent:-28px;"><span class="com" style="color:#AEAEAE;font-style:italic;">#</span><span class="pln" style="color:#B8FFB8;"> an http proxy server to </span><span class="kwd" style="color:#E28964;">use</span></li><li class="L1" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> proxy_hostname </span><span class="pun" style="color:#B8FFB8;">=</span></li><li class="L2" style="text-indent:-28px;"></li><li class="L3" style="text-indent:-28px;"><span class="com" style="color:#AEAEAE;font-style:italic;">#</span><span class="pln" style="color:#B8FFB8;"> port </span><span class="kwd" style="color:#E28964;">for</span><span class="pln" style="color:#B8FFB8;"> http proxy server</span></li><li class="L4" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> proxy_port </span><span class="pun" style="color:#B8FFB8;">=</span></li><li class="L5" style="text-indent:-28px;"></li><li class="L6" style="text-indent:-28px;"><span class="com" style="color:#AEAEAE;font-style:italic;">#</span><span class="pln" style="color:#B8FFB8;"> user name </span><span class="kwd" style="color:#E28964;">for</span><span class="pln" style="color:#B8FFB8;"> authenticating to an http proxy</span><span class="pun" style="color:#B8FFB8;">,</span><span class="pln" style="color:#B8FFB8;"> </span><span class="kwd" style="color:#E28964;">if</span><span class="pln" style="color:#B8FFB8;"> needed</span></li><li class="L7" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> proxy_user </span><span class="pun" style="color:#B8FFB8;">=</span></li><li class="L8" style="text-indent:-28px;"></li><li class="L9" style="text-indent:-28px;"><span class="com" style="color:#AEAEAE;font-style:italic;">#</span><span class="pln" style="color:#B8FFB8;"> password </span><span class="kwd" style="color:#E28964;">for</span><span class="pln" style="color:#B8FFB8;"> basic http proxy auth</span><span class="pun" style="color:#B8FFB8;">,</span><span class="pln" style="color:#B8FFB8;"> </span><span class="kwd" style="color:#E28964;">if</span><span class="pln" style="color:#B8FFB8;"> needed</span></li><li class="L0" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> proxy_password </span><span class="pun" style="color:#B8FFB8;">=</span></li></ol></pre> <p style="font-family:&quot;font-size:16px;">一旦你完成了这些,通过使用下面的命令重新检查&nbsp;subscription-manager&nbsp;是否获得了新的代理信息:</p> <pre class="prettyprint linenums prettyprinted"><ol class="linenums" style="color:#AEAEAE;"><li class="L0" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;">root@kerneltalks </span><span class="com" style="color:#AEAEAE;font-style:italic;">#</span><span class="pln" style="color:#B8FFB8;"> subscription</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">manager config</span></li><li class="L1" style="text-indent:-28px;"><span class="pun" style="color:#B8FFB8;">[</span><span class="pln" style="color:#B8FFB8;">server</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L2" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> </span><span class="kwd" style="color:#E28964;">hostname</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="pln" style="color:#B8FFB8;">subscription</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">rhsm</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">redhat</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">com</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L3" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> insecure </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="lit" style="color:#3387CC;">0</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L4" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> port </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="lit" style="color:#3387CC;">443</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L5" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> prefix </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[/</span><span class="pln" style="color:#B8FFB8;">subscription</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L6" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> proxy_hostname </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="pln" style="color:#B8FFB8;">kerneltalksproxy</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">abc</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">com</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L7" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> proxy_password </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="pln" style="color:#B8FFB8;">asdf</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L8" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> proxy_port </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="lit" style="color:#3387CC;">3456</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L9" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> proxy_user </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="pln" style="color:#B8FFB8;">user2</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L0" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> server_timeout </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="lit" style="color:#3387CC;">180</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L1" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> ssl_verify_depth </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="lit" style="color:#3387CC;">3</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L2" style="text-indent:-28px;"></li><li class="L3" style="text-indent:-28px;"><span class="pun" style="color:#B8FFB8;">[</span><span class="pln" style="color:#B8FFB8;">rhsm</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L4" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> baseurl </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="pln" style="color:#B8FFB8;">https</span><span class="pun" style="color:#B8FFB8;">:</span><span class="com" style="color:#AEAEAE;font-style:italic;">//cdn.redhat.com]</span></li><li class="L5" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> ca_cert_dir </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="str" style="color:#65B042;">/etc/</span><span class="pln" style="color:#B8FFB8;">rhsm</span><span class="pun" style="color:#B8FFB8;">/</span><span class="pln" style="color:#B8FFB8;">ca</span><span class="pun" style="color:#B8FFB8;">/]</span></li><li class="L6" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> consumercertdir </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="str" style="color:#65B042;">/etc/</span><span class="pln" style="color:#B8FFB8;">pki</span><span class="pun" style="color:#B8FFB8;">/</span><span class="pln" style="color:#B8FFB8;">consumer</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L7" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> entitlementcertdir </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="str" style="color:#65B042;">/etc/</span><span class="pln" style="color:#B8FFB8;">pki</span><span class="pun" style="color:#B8FFB8;">/</span><span class="pln" style="color:#B8FFB8;">entitlement</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L8" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> full_refresh_on_yum </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="lit" style="color:#3387CC;">0</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L9" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> manage_repos </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="lit" style="color:#3387CC;">1</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L0" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> pluginconfdir </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="str" style="color:#65B042;">/etc/</span><span class="pln" style="color:#B8FFB8;">rhsm</span><span class="pun" style="color:#B8FFB8;">/</span><span class="pln" style="color:#B8FFB8;">pluginconf</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">d</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L1" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> plugindir </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="str" style="color:#65B042;">/usr/</span><span class="pln" style="color:#B8FFB8;">share</span><span class="pun" style="color:#B8FFB8;">/</span><span class="pln" style="color:#B8FFB8;">rhsm</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">plugins</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L2" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> productcertdir </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="str" style="color:#65B042;">/etc/</span><span class="pln" style="color:#B8FFB8;">pki</span><span class="pun" style="color:#B8FFB8;">/</span><span class="pln" style="color:#B8FFB8;">product</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L3" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> repo_ca_cert </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="str" style="color:#65B042;">/etc/</span><span class="pln" style="color:#B8FFB8;">rhsm</span><span class="pun" style="color:#B8FFB8;">/</span><span class="pln" style="color:#B8FFB8;">ca</span><span class="pun" style="color:#B8FFB8;">/</span><span class="pln" style="color:#B8FFB8;">redhat</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">uep</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">pem</span></li><li class="L4" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> report_package_profile </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="lit" style="color:#3387CC;">1</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L5" style="text-indent:-28px;"></li><li class="L6" style="text-indent:-28px;"><span class="pun" style="color:#B8FFB8;">[</span><span class="pln" style="color:#B8FFB8;">rhsmcertd</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L7" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> autoattachinterval </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="lit" style="color:#3387CC;">1440</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L8" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> certcheckinterval </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="lit" style="color:#3387CC;">240</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L9" style="text-indent:-28px;"></li><li class="L0" style="text-indent:-28px;"><span class="pun" style="color:#B8FFB8;">[</span><span class="pln" style="color:#B8FFB8;">logging</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L1" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;"> default_log_level </span><span class="pun" style="color:#B8FFB8;">=</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">[</span><span class="pln" style="color:#B8FFB8;">INFO</span><span class="pun" style="color:#B8FFB8;">]</span></li><li class="L2" style="text-indent:-28px;"></li><li class="L3" style="text-indent:-28px;"><span class="pun" style="color:#B8FFB8;">[]</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Default</span><span class="pln" style="color:#B8FFB8;"> value </span><span class="kwd" style="color:#E28964;">in</span><span class="pln" style="color:#B8FFB8;"> </span><span class="kwd" style="color:#E28964;">use</span></li></ol></pre> <p style="font-family:&quot;font-size:16px;">现在,请尝试重新注册您的系统。</p> <pre class="prettyprint linenums prettyprinted"><ol class="linenums" style="color:#AEAEAE;"><li class="L0" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;">root@kerneltalks </span><span class="com" style="color:#AEAEAE;font-style:italic;">#</span><span class="pln" style="color:#B8FFB8;"> subscription</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">manager </span><span class="kwd" style="color:#E28964;">register</span></li><li class="L1" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Registering</span><span class="pln" style="color:#B8FFB8;"> to</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> subscription</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">rhsm</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">redhat</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">com</span><span class="pun" style="color:#B8FFB8;">:</span><span class="lit" style="color:#3387CC;">443</span><span class="pun" style="color:#B8FFB8;">/</span><span class="pln" style="color:#B8FFB8;">subscription</span></li><li class="L2" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Username</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> admin@kerneltalks</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">com</span></li><li class="L3" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Password</span><span class="pun" style="color:#B8FFB8;">:</span></li><li class="L4" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">You</span><span class="pln" style="color:#B8FFB8;"> must first accept </span><span class="typ" style="color:#89BDFF;">Red</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Hat</span><span class="str" style="color:#65B042;">'s Terms and conditions. Please visit https://www.redhat.com/wapps/tnc/termsack?event[]=signIn . You may have to log out of and back into the Customer Portal in order to see the terms.</span></li></ol></pre> <p style="font-family:&quot;font-size:16px;">如果您是第一次将服务器添加到 Red Hat 帐户,您将看到上述错误。转到该&nbsp;<a href="https://www.redhat.com/wapps/tnc/termsack?event%5B%5D=signIn" data-ke-src="https://www.redhat.com/wapps/tnc/termsack?event%5B%5D=signIn">URL</a>并接受条款。回到终端,然后再试一次。</p> <pre class="prettyprint linenums prettyprinted"><ol class="linenums" style="color:#AEAEAE;"><li class="L0" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;">oot@kerneltalks </span><span class="com" style="color:#AEAEAE;font-style:italic;">#</span><span class="pln" style="color:#B8FFB8;"> subscription</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">manager </span><span class="kwd" style="color:#E28964;">register</span></li><li class="L1" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Registering</span><span class="pln" style="color:#B8FFB8;"> to</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> subscription</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">rhsm</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">redhat</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">com</span><span class="pun" style="color:#B8FFB8;">:</span><span class="lit" style="color:#3387CC;">443</span><span class="pun" style="color:#B8FFB8;">/</span><span class="pln" style="color:#B8FFB8;">subscription</span></li><li class="L2" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Username</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> admin@kerneltalks</span><span class="pun" style="color:#B8FFB8;">.</span><span class="pln" style="color:#B8FFB8;">com</span></li><li class="L3" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Password</span><span class="pun" style="color:#B8FFB8;">:</span></li><li class="L4" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">The</span><span class="pln" style="color:#B8FFB8;"> system has been registered </span><span class="kwd" style="color:#E28964;">with</span><span class="pln" style="color:#B8FFB8;"> ID</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> xxxxb2</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">xxxx</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">xxxx</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">xxxx</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">xx8e199xxx</span></li></ol></pre> <p style="font-family:&quot;font-size:16px;">Bingo!系统现在已在 Red Hat 上注册。你可以再次用&nbsp;version&nbsp;选项来验证它。</p> <pre class="prettyprint linenums prettyprinted"><ol class="linenums" style="color:#AEAEAE;"><li class="L0" style="text-indent:-28px;"><span class="com" style="color:#AEAEAE;font-style:italic;">#</span><span class="pln" style="color:#B8FFB8;">subscription</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">managerversionservertype</span><span class="pun" style="color:#B8FFB8;">:</span><span class="typ" style="color:#89BDFF;">RedHatSubscriptionManagementsubscriptionmanagementserver</span><span class="pun" style="color:#B8FFB8;">:</span><span class="lit" style="color:#3387CC;">2.0</span><span class="pun" style="color:#B8FFB8;">.</span><span class="lit" style="color:#3387CC;">43</span><span class="pun" style="color:#B8FFB8;">-</span><span class="lit" style="color:#3387CC;">1subscriptionmanagementrules</span><span class="pun" style="color:#B8FFB8;">:</span><span class="lit" style="color:#3387CC;">5.26subscription</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">manager</span><span class="pun" style="color:#B8FFB8;">:</span><span class="lit" style="color:#3387CC;">1.18</span><span class="pun" style="color:#B8FFB8;">.</span><span class="lit" style="color:#3387CC;">10</span><span class="pun" style="color:#B8FFB8;">-</span><span class="lit" style="color:#3387CC;">1.el6python</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">rhsm</span><span class="pun" style="color:#B8FFB8;">:</span><span class="lit" style="color:#3387CC;">1.18</span><span class="pun" style="color:#B8FFB8;">.</span><span class="lit" style="color:#3387CC;">6</span><span class="pun" style="color:#B8FFB8;">-</span><span class="lit" style="color:#3387CC;">1.el6</span><span class="str" style="color:#65B042;">" decode="</span><span class="kwd" style="color:#E28964;">true</span><span class="str" style="color:#65B042;">" ]root@kerneltalks # subscription-manager version</span></li><li class="L1" style="text-indent:-28px;"><span class="str" style="color:#65B042;">server type: Red Hat Subscription Management</span></li><li class="L2" style="text-indent:-28px;"><span class="str" style="color:#65B042;">subscription management server: 2.0.43-1</span></li><li class="L3" style="text-indent:-28px;"><span class="str" style="color:#65B042;">subscription management rules: 5.26</span></li><li class="L4" style="text-indent:-28px;"><span class="str" style="color:#65B042;">subscription-manager: 1.18.10-1.el6</span></li><li class="L5" style="text-indent:-28px;"><span class="str" style="color:#65B042;">python-rhsm: 1.18.6-1.el6</span></li></ol></pre> <h3 id="toc_2" style="font-size:1.4em;font-family:&quot;font-weight:300;color:#FFFFFF;background-color:#3F51B5;">步骤 2:将订阅添加到您的服务器</h3><p style="font-family:&quot;font-size:16px;">首先尝试列出软件仓库。您将无法列出任何内容,因为我们尚未在我们的服务器中添加任何订阅。</p> <pre class="prettyprint linenums prettyprinted"><ol class="linenums" style="color:#AEAEAE;"><li class="L0" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;">root@kerneltalks </span><span class="com" style="color:#AEAEAE;font-style:italic;">#</span><span class="pln" style="color:#B8FFB8;"> subscription</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">manager repos </span><span class="pun" style="color:#B8FFB8;">--</span><span class="kwd" style="color:#E28964;">list</span></li><li class="L1" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">This</span><span class="pln" style="color:#B8FFB8;"> system has </span><span class="kwd" style="color:#E28964;">no</span><span class="pln" style="color:#B8FFB8;"> repositories available through subscriptions</span><span class="pun" style="color:#B8FFB8;">.</span></li></ol></pre> <p style="font-family:&quot;font-size:16px;">正如您所看到&nbsp;subscription-manager&nbsp;找不到任何软件仓库,您需要将订阅添加到您的服务器上。一旦订阅被添加,subscription-manager&nbsp;将能够列出下列的软件仓库。</p><p style="font-family:&quot;font-size:16px;">要添加订阅,请先使用以下命令检查服务器的所有可用订阅:</p> <pre class="prettyprint linenums prettyprinted"><ol class="linenums" style="color:#AEAEAE;"><li class="L0" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;">root@kerneltalks </span><span class="com" style="color:#AEAEAE;font-style:italic;">#</span><span class="pln" style="color:#B8FFB8;"> subscription</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">manager </span><span class="kwd" style="color:#E28964;">list</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">--</span><span class="pln" style="color:#B8FFB8;">available</span></li><li class="L1" style="text-indent:-28px;"><span class="pun" style="color:#B8FFB8;">+-------------------------------------------+</span></li><li class="L2" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Available</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Subscriptions</span></li><li class="L3" style="text-indent:-28px;"><span class="pun" style="color:#B8FFB8;">+-------------------------------------------+</span></li><li class="L4" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Subscription</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Name</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Red</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Hat</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Enterprise</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Linux</span><span class="pln" style="color:#B8FFB8;"> </span><span class="kwd" style="color:#E28964;">for</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Virtual</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Datacenters</span><span class="pun" style="color:#B8FFB8;">,</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Standard</span></li><li class="L5" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Provides</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Red</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Hat</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Beta</span></li><li class="L6" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Red</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Hat</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Software</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Collections</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">(</span><span class="kwd" style="color:#E28964;">for</span><span class="pln" style="color:#B8FFB8;"> RHEL </span><span class="typ" style="color:#89BDFF;">Server</span><span class="pun" style="color:#B8FFB8;">)</span></li><li class="L7" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Red</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Hat</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Enterprise</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Linux</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Atomic</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Host</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Beta</span></li><li class="L8" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Oracle</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Java</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">(</span><span class="kwd" style="color:#E28964;">for</span><span class="pln" style="color:#B8FFB8;"> RHEL </span><span class="typ" style="color:#89BDFF;">Server</span><span class="pun" style="color:#B8FFB8;">)</span></li><li class="L9" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Red</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Hat</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Enterprise</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Linux</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Server</span></li><li class="L0" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;">dotNET on RHEL </span><span class="pun" style="color:#B8FFB8;">(</span><span class="kwd" style="color:#E28964;">for</span><span class="pln" style="color:#B8FFB8;"> RHEL </span><span class="typ" style="color:#89BDFF;">Server</span><span class="pun" style="color:#B8FFB8;">)</span></li><li class="L1" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Red</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Hat</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Enterprise</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Linux</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Atomic</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Host</span></li><li class="L2" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Red</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Hat</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Software</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Collections</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Beta</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">(</span><span class="kwd" style="color:#E28964;">for</span><span class="pln" style="color:#B8FFB8;"> RHEL </span><span class="typ" style="color:#89BDFF;">Server</span><span class="pun" style="color:#B8FFB8;">)</span></li><li class="L3" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Red</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Hat</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Developer</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Tools</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Beta</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">(</span><span class="kwd" style="color:#E28964;">for</span><span class="pln" style="color:#B8FFB8;"> RHEL </span><span class="typ" style="color:#89BDFF;">Server</span><span class="pun" style="color:#B8FFB8;">)</span></li><li class="L4" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Red</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Hat</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Developer</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Toolset</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">(</span><span class="kwd" style="color:#E28964;">for</span><span class="pln" style="color:#B8FFB8;"> RHEL </span><span class="typ" style="color:#89BDFF;">Server</span><span class="pun" style="color:#B8FFB8;">)</span></li><li class="L5" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Red</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Hat</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Developer</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Tools</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">(</span><span class="kwd" style="color:#E28964;">for</span><span class="pln" style="color:#B8FFB8;"> RHEL </span><span class="typ" style="color:#89BDFF;">Server</span><span class="pun" style="color:#B8FFB8;">)</span></li><li class="L6" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;">SKU</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> RH00050</span></li><li class="L7" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Contract</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> xxxxxxxx</span></li><li class="L8" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Pool</span><span class="pln" style="color:#B8FFB8;"> ID</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="lit" style="color:#3387CC;">8a85f98c6011059f0160110a2ae6000f</span></li><li class="L9" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Provides</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Management</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Yes</span></li><li class="L0" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Available</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Unlimited</span></li><li class="L1" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Suggested</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="lit" style="color:#3387CC;">0</span></li><li class="L2" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Service</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Level</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Standard</span></li><li class="L3" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Service</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Type</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> L1</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">L3</span></li><li class="L4" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Subscription</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Type</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Stackable</span><span class="pln" style="color:#B8FFB8;"> </span><span class="pun" style="color:#B8FFB8;">(</span><span class="typ" style="color:#89BDFF;">Temporary</span><span class="pun" style="color:#B8FFB8;">)</span></li><li class="L5" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Ends</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="lit" style="color:#3387CC;">12</span><span class="pun" style="color:#B8FFB8;">/</span><span class="lit" style="color:#3387CC;">01</span><span class="pun" style="color:#B8FFB8;">/</span><span class="lit" style="color:#3387CC;">2018</span></li><li class="L6" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">System</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Type</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Virtual</span></li></ol></pre> <p style="font-family:&quot;font-size:16px;">您将获得可用于您的服务器的此类订阅的软件仓库列表。您需要阅读它提供的内容并记下对您有用或需要的订阅的&nbsp;Pool ID。</p><p style="font-family:&quot;font-size:16px;">现在,使用 pool ID 将订阅添加到您的服务器。</p> <pre class="prettyprint linenums prettyprinted"><ol class="linenums" style="color:#AEAEAE;"><li class="L0" style="text-indent:-28px;"><span class="com" style="color:#AEAEAE;font-style:italic;">#</span><span class="pln" style="color:#B8FFB8;"> subscription</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">manager attach </span><span class="pun" style="color:#B8FFB8;">--</span><span class="pln" style="color:#B8FFB8;">pool</span><span class="pun" style="color:#B8FFB8;">=</span><span class="lit" style="color:#3387CC;">8a85f98c6011059f0160110a2ae6000f</span></li><li class="L1" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Successfully</span><span class="pln" style="color:#B8FFB8;"> attached a subscription </span><span class="kwd" style="color:#E28964;">for</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Red</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Hat</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Enterprise</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Linux</span><span class="pln" style="color:#B8FFB8;"> </span><span class="kwd" style="color:#E28964;">for</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Virtual</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Datacenters</span><span class="pun" style="color:#B8FFB8;">,</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Standard</span></li></ol></pre> <p style="font-family:&quot;font-size:16px;">如果您不确定选择哪一个,则可以使用下面的命令自动地添加最适合您的服务器的订阅:</p> <pre class="prettyprint linenums prettyprinted"><ol class="linenums" style="color:#AEAEAE;"><li class="L0" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;">root@kerneltalks </span><span class="com" style="color:#AEAEAE;font-style:italic;">#</span><span class="pln" style="color:#B8FFB8;"> subscription</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">manager attach </span><span class="pun" style="color:#B8FFB8;">--</span><span class="kwd" style="color:#E28964;">auto</span></li><li class="L1" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Installed</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Product</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Current</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Status</span><span class="pun" style="color:#B8FFB8;">:</span></li><li class="L2" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Product</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Name</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Red</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Hat</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Enterprise</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Linux</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Server</span></li><li class="L3" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Status</span><span class="pun" style="color:#B8FFB8;">:</span><span class="pln" style="color:#B8FFB8;"> </span><span class="typ" style="color:#89BDFF;">Subscribed</span></li></ol></pre> <p style="font-family:&quot;font-size:16px;">接下来是最后一步启用软件仓库。</p><h3 id="toc_3" style="font-size:1.4em;font-family:&quot;font-weight:300;color:#FFFFFF;background-color:#3F51B5;">步骤 3:启用软件仓库</h3><p style="font-family:&quot;font-size:16px;">现在您将能够启用软件仓库,该软件仓库在您的附加订阅下可用。</p> <pre class="prettyprint linenums prettyprinted"><ol class="linenums" style="color:#AEAEAE;"><li class="L0" style="text-indent:-28px;"><span class="pln" style="color:#B8FFB8;">root@kerneltalks </span><span class="com" style="color:#AEAEAE;font-style:italic;">#</span><span class="pln" style="color:#B8FFB8;"> subscription</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">manager repos </span><span class="pun" style="color:#B8FFB8;">--</span><span class="pln" style="color:#B8FFB8;">enable rhel</span><span class="pun" style="color:#B8FFB8;">-</span><span class="lit" style="color:#3387CC;">6</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">server</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">rhv</span><span class="pun" style="color:#B8FFB8;">-</span><span class="lit" style="color:#3387CC;">4</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">agent</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">beta</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">debug</span><span class="pun" style="color:#B8FFB8;">-</span><span class="pln" style="color:#B8FFB8;">rpms</span></li><li class="L1" style="text-indent:-28px;"><span class="typ" style="color:#89BDFF;">Repository</span><span class="pln" style="color:#B8FFB8;"> </span><span class="str" style="color:#65B042;">'rhel-6-server-rhv-4-agent-beta-debug-rpms'</span><span class="pln" style="color:#B8FFB8;"> </span><span class="kwd" style="color:#E28964;">is</span><span class="pln" style="color:#B8FFB8;"> enabled </span><span class="kwd" style="color:#E28964;">for</span><span class="pln" style="color:#B8FFB8;"> </span><span class="kwd" style="color:#E28964;">this</span><span class="pln" style="color:#B8FFB8;"> system</span><span class="pun" style="color:#B8FFB8;">.</span></li></ol></pre> <p style="font-family:&quot;font-size:16px;">到这里,您已经完成了。您可以<a href="https://kerneltalks.com/howto/how-to-list-yum-repositories-in-rhel-centos/" data-ke-src="https://kerneltalks.com/howto/how-to-list-yum-repositories-in-rhel-centos/">用 yum 命令列出软件仓库</a>并确认。</p>
在线咨询 ×

您好,请问有什么可以帮您?我们将竭诚提供最优质服务!