Server Building and Management (9-1)

Source: Internet
Author: User
Tags aliyun

1. Server:

192.168.9.106 admin192.168.9.107 node1192.168.9.108 node2

2. Create Deph account and give sudo permission: (3 units)

创建账号[[email protected] ~]# mkdir /app/userhome -p[[email protected] ~]# useradd -d /app/userhome/deph deph[[email protected] ~]# passwd deph赋予sudo权限[[email protected] ~]# echo "deph ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/deph[[email protected] ~]# sudo chmod 0440 /etc/sudoers.d/deph修改sudo配置文件#此处有一个小坑,使用不同账户,执行执行脚本时候sudo经常会碰到 sudo: sorry, you must have a tty to run sudo这个情况,其实修改一下sudo的配置就好了,用vi /etc/sudoers (最好用visudo命令),注释掉 Default requiretty 一行[[email protected] ~]# visudo#Default requiretty

3. Establish the trust of the admin host and Node nodes

#创建秘钥[[email protected] ~]# su - deph[[email protected] ~]$ ssh-keygen#分发公钥[[email protected] ~]$ ssh-copy-id [email protected][[email protected] ~]$ ssh-copy-id [email protected]#修改 管理节点的~/.ssh/config文件,ceph-deploy以便ceph-deploy能够以您创建的用户身份登录Ceph节点[[email protected] ~]$ vim .ssh/configHost adminHostname adminUser dephHost node1Hostname node1User dephHost node2Hostname node2User deph#修改权限[[email protected] ~]$ cd .ssh/[[email protected] .ssh]$ chmod 600 config#测试登录ssh[[email protected] ~]$ ssh node1[[email protected] ~]$ exitlogoutConnection to node1 closed.[[email protected] ~]$ ssh node2[[email protected] ~]$ exitlogoutConnection to node2 closed

4. Modify the Repo file

#移动原repo文件[[email protected] ~]$ exit[[email protected] ~]# cd /etc/yum.repos.d/[[email protected] yum.repos.d]# mkdir source[[email protected] yum.repos.d]# mv C* source/[[email protected] yum.repos.d]# mv e* source/#修改yum源,官网的yum源可能会很慢,下载aliyun源[[email protected] yum.repos.d]# curl http://mirrors.aliyun.com/repo/Centos-7.repo >/etc/yum.repos.d/CentOS-Base.repo [[email protected] yum.repos.d]# curl http://mirrors.aliyun.com/repo/epel-7.repo >/etc/yum.repos.d/epel.repo[[email protected] yum.repos.d]# sed -i ‘/aliyuncs/d‘ /etc/yum.repos.d/CentOS-Base.repo[[email protected] yum.repos.d]# sed -i ‘/aliyuncs/d‘ /etc/yum.repos.d/epel.repo [[email protected] yum.repos.d]# yum makecache

Server Building and Management (9-1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.