ubuntu 18.04 设置静态ip方法

1. 前言

本教程将会演示如何设置Ubuntu16.04 Server版和Ubuntu18.04 Server版系统的静态固定IP地址。

2. 确认你要修改的网卡号

先确认你要修改的网卡号,假设你的服务器有多张网卡:

ubuntu1804:~$ ip addr

我的服务器配置如下:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:0c:29:f1:b5:e1 brd ff:ff:ff:ff:ff:ff
inet 172.16.87.140/24 brd 172.16.87.255 scope global dynamic ens33
valid_lft 1500sec preferred_lft 1500sec
inet6 fe80::20c:29ff:fef1:b5e1/64 scope link
valid_lft forever preferred_lft forever

3. 默认的网卡配置文件

默认情况下,网络使用DHCP

ubuntu1804:~$ cat /etc/netplan/50-cloud-init.yaml
配置文件内容如下

network:
    ethernets:
        ens33:
            dhcp4: yes
            addresses: []

    version: 2

4. 设置静态IP

需要把配置文件修改为以下内容:

ubuntu1804:~$ sudo vi /etc/netplan/50-cloud-init.yaml

假设IP地址修改为192.168.1.100,子网掩码24位即255.255.255.0,网关设置为192.168.1.1,DNS1:223.5.5.5,DNS2:223.6.6.6

network:
    ethernets:
        ens33:
            dhcp4: no
            addresses: [192.168.1.100/24]
            optional: true
            gateway4: 192.168.1.1
            nameservers:
                    addresses: [223.5.5.5,223.6.6.6]

    version: 2

5. 应用新配置

ubuntu1804:~$ sudo netplan apply

使用ip addr检查新地址

ubuntu1804:~$ ip addr

6. 测试网络连通性

ubuntu1804:~$ ping 192.168.1.100

原创声明,本文系作者授权云+社区发表,未经许可,不得转载。

如有侵权,请联系 yunjia_community@tencent.com 删除。

https://cloud.tencent.com/developer/article/1514181
此记录之

完整部署CentOS7.2+OpenStack+kvm 云平台环境(1)–基础环境搭建

公司在IDC机房有两台很高配置的服务器,计划在上面部署openstack云平台虚拟化环境,用于承载后期开发测试和其他的一些对内业务。 以下对openstack的部署过程及其使用做一详细介绍,仅仅依据本人实际经验而述,如有不当,敬请指出~

********************************************************************************************************************************

1 OpenStack 介绍

1.1 百度百科 OpenStack 是一个由 NASA ( 美国国家航空航天局)和 Rackspace 合作研发并发起的,以 Apache 许可证授权的自由软件和开放源代码项目。

1.2 版本历史

1.3 openstack 架构概念

1.4 openstack 各个服务名称对应

***************************************************************************************************************

以下安装部署已经过测试,完全通过!

建议在物理机上部署openstack,并且是centos7或ubuntu系统下,centos6x的源里已不支持openstack部分组件下载了。

2 环境准备 openstack 主机名不能改,装的时候是什么就是什么, 运维标准化。

1、 CentOS 7.2 系统 2 台 node1 即作为控制节点,也作为计算节点;(即可以单机部署,单机部署时则下面记录的控制节点和计算节点的操作步骤都要在本机执行下) node2 就只是计算节点 控制节点去操控计算节点,计算节点上可以创建虚拟机

linux-node1.openstack   192.168.1.17 网卡 NAT em2 (外网ip假设是58.68.250.17)(em2是内网网卡,下面neutron配置文件里会设置到) linux-node2.openstack   192.168.1.8   网卡 NAT em2

控制节点:linux-node1.openstack    192.168.1.17

计算节点:linux-node2.openstack 192.168.1.8

2.域名解析和关闭防火墙 (控制节点和计算节点都做) /etc/hosts                                                         #主机名一开始设置好,后面就不能更改了,否则就会出问题!这里设置好ip与主机名的对应关系 192.168.1.17 linux-node1.openstack       192.168.1.8   linux-node2.openstack

关闭 selinux sed -i ‘s#SELINUX=enforcing#SELINUX=disabled#g’ /etc/sysconfig/selinux setenforce 0 关闭 iptables systemctl start firewalld.service systemctl stop firewalld.service systemctl disable firewalld.service

3 安装配置 OpenStack 官方文档 http://docs.openstack.org/

3.1 安装软件包

linux-node1.openstack   安装

*************************************************************************************

#Base yum install -y http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm yum install -y centos-release-openstack-liberty yum install -y python-openstackclient

##MySQL yum install -y mariadb mariadb-server MySQL-python

##RabbitMQ yum install -y rabbitmq-server

##Keystone yum install -y openstack-keystone httpd mod_wsgi memcached python-memcached

##Glance yum install -y openstack-glance python-glance python-glanceclient

##Nova yum install -y openstack-nova-api openstack-nova-cert openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler python-novaclient

##Neutron linux-node1.example.com yum install -y openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge python-neutronclient ebtables ipset

##Dashboard yum install -y openstack-dashboard

##Cinder yum install -y openstack-cinder python-cinderclient

*************************************************************************************

linux-node2.openstack   安装

##Base yum install -y http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm yum install centos-release-openstack-liberty yum install python-openstackclient

##Nova linux-node2.openstack yum install -y openstack-nova-compute sysfsutils

##Neutron linux-node2.openstack yum install -y openstack-neutron openstack-neutron-linuxbridge ebtables ipset

##Cinder yum install -y openstack-cinder python-cinderclient targetcli python-oslo-policy

*************************************************************************************

3.2 设置时间同步、 关闭 selinux 和 iptables 在 linux-node1 上配置( 只有 centos7 能用, 6 还用 ntp) [root@linux-node1 ~]# yum install -y chrony [root@linux-node1 ~]# vim /etc/chrony.conf allow 192.168/16 #允许那些服务器和自己同步时间 [root@linux-node1 ~]# systemctl enable chronyd.service    #开机启动 [root@linux-node1 ~]# systemctl start chronyd.service [root@linux-node1 ~]# timedatectl set-timezone Asia/Shanghai     #设置时区 [root@linux-node1 ~]# timedatectl status Local time: Fri 2016-08-26 11:14:19 CST Universal time: Fri 2016-08-26 03:14:19 UTC RTC time: Fri 2016-08-26 03:14:19 Time zone: Asia/Shanghai (CST, +0800) NTP enabled: yes NTP synchronized: yes RTC in local TZ: no DST active: n/a

在 linux-node2 上配置 [root@linux-node2 ~]# yum install -y chrony [root@linux-node2 ~]# vim /etc/chrony.conf server 192.168.1.17 iburst #只留一行 [root@linux-node2 ~]# systemctl enable chronyd.service [root@linux-node2 ~]# systemctl start chronyd.service [root@linux-node2 ~]# timedatectl set-timezone Asia/Shanghai [root@linux-node2 ~]# chronyc sources

3.3 安装及配置 mysql

[root@linux-node1 ~]# cp /usr/share/mysql/my-medium.cnf /etc/my.cnf                   #或者是/usr/share/mariadb/my-medium.cnf [mysqld] default-storage-engine = innodb innodb_file_per_table collation-server = utf8_general_ci init-connect = ‘SET NAMES utf8’ character-set-server = utf8 [root@linux-node1 ~]# systemctl enable mariadb.service                                                      #Centos7里面mysql叫maridb [root@linux-node1 ~]# ln -s ‘/usr/lib/systemd/system/mariadb.service’ ‘/etc/systemd/system/multi-user.target.wants/mariadb.service’ [root@linux-node1 ~]# mysql_install_db –datadir=”/var/lib/mysql” –user=”mysql”               #初始化数据库 [root@linux-node1 ~]# systemctl start mariadb.service [root@linux-node1 ~]# mysql_secure_installation                                                                 #设置密码及初始化 密码 123456,一路 y 回车

创建数据库 [root@openstack-server ~]# mysql -p123456 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 5579 Server version: 5.5.50-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. MariaDB [(none)]> CREATE DATABASE keystone; MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone.* TO ‘keystone’@’localhost’ IDENTIFIED BY ‘keystone’; MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone.* TO ‘keystone’@’%’ IDENTIFIED BY ‘keystone’; MariaDB [(none)]> CREATE DATABASE glance; MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO ‘glance’@’localhost’ IDENTIFIED BY ‘glance’; MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO ‘glance’@’%’ IDENTIFIED BY ‘glance’; MariaDB [(none)]> CREATE DATABASE nova; MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO ‘nova’@’localhost’ IDENTIFIED BY ‘nova’; MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO ‘nova’@’%’ IDENTIFIED BY ‘nova’; MariaDB [(none)]> CREATE DATABASE neutron; MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO ‘neutron’@’localhost’ IDENTIFIED BY ‘neutron’; MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO ‘neutron’@’%’ IDENTIFIED BY ‘neutron’; MariaDB [(none)]> CREATE DATABASE cinder; MariaDB [(none)]> GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder’@’localhost’ IDENTIFIED BY ‘cinder’; MariaDB [(none)]> GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder’@’%’ IDENTIFIED BY ‘cinder’; MariaDB [(none)]> flush privileges; MariaDB [(none)]> show databases; +——————–+ | Database | +——————–+ | information_schema   | | cinder                       | | glance                       | | keystone                    | | mysql                        | | neutron                     | | nova                         | | performance_schema | +——————–+ 8 rows in set (0.00 sec)

MariaDB [(none)]>

—————————————————————————————————————————- 参考另一篇博客:http://www.cnblogs.com/kevingrace/p/5811167.html 修改下mysql的连接数,否则openstack后面的操作会报错:“ERROR 1040 (08004): Too many connections ” —————————————————————————————————————————-

3.4 配置 rabbitmq MQ 全称为 Message Queue, 消息队列( MQ)是一种应用程序对应用程序的通信方法。应用 程序通过读写出入队列的消息(针对应用程序的数据)来通信,而无需专用连接来链接它们。 消 息传递指的是程序之间通过在消息中发送数据进行通信,而不是通过直接调用彼此来通 信,直接调用通常是用于诸如远程过程调用的技术。排队指的是应用程序通过 队列来通信。 队列的使用除去了接收和发送应用程序同时执行的要求。 RabbitMQ 是一个在 AMQP 基础上完整的,可复用的企业消息系统。他遵循 Mozilla Public License 开源协议。 启动 rabbitmq, 端口 5672,添加 openstack 用户

[root@linux-node1 ~]# systemctl enable rabbitmq-server.service [root@linux-node1 ~]# ln -s ‘/usr/lib/systemd/system/rabbitmq-server.service’ ‘/etc/systemd/system/multi-user.target.wants/rabbitmq-server.service’ [root@linux-node1 ~]# systemctl start rabbitmq-server.service [root@linux-node1 ~]# rabbitmqctl add_user openstack openstack                               #添加用户及密码 [root@linux-node1 ~]# rabbitmqctl set_permissions openstack “.*” “.*” “.*”                                   #允许配置、写、读访问 openstack [root@linux-node1 ~]# rabbitmq-plugins list                                 #查看支持的插件 ……… [ ] rabbitmq_management 3.6.2                                    #使用此插件实现 web 管理 ……… [root@linux-node1 ~]# rabbitmq-plugins enable rabbitmq_management #启动插件 The following plugins have been enabled: mochiweb webmachine rabbitmq_web_dispatch amqp_client rabbitmq_management_agent rabbitmq_management Plugin configuration has changed. Restart RabbitMQ for changes to take effect. [root@linux-node1 ~]# systemctl restart rabbitmq-server.service

[root@linux-node1 ~]#lsof -i:15672

访问RabbitMQ,访问地址是http://58.68.250.17:15672 默认用户名密码都是guest,浏览器添加openstack用户到组并登陆测试,连不上情况一般是防火墙没有关闭所致!

之后退出使用 openstack 登录 如何使用 zabbix 监控? 左下角有 HTTP API 的介绍,可以实现 zabbix 的监控

*********************************************************************************************

以上完成基础环境的配置,下面开始安装 openstack 的组件

3.5 配置 Keystone 验证服务 所有的服务,都需要在 keystone 上注册 3.5.1 Keystone 介绍

3.5.2 配置 Keystone 端口 5000 和 35357

1、修改/etc/keystone/keystone.conf 取一个随机数 [root@linux-node1 ~]# openssl rand -hex 10 35d6e6f377a889571bcf [root@linux-node1 ~]# cat /etc/keystone/keystone.conf|grep -v “^#”|grep -v “^$” [DEFAULT] admin_token = 35d6e6f377a889571bcf                                    #设置 token,和上面产生的随机数值一致 verbose = true [assignment] [auth] [cache] [catalog] [cors] [cors.subdomain] [credential] [database] connection = mysql://keystone:keystone@192.168.1.17/keystone                                          #设置数据库连接 写到database下 [domain_config] [endpoint_filter] [endpoint_policy] [eventlet_server] [eventlet_server_ssl] [federation] [fernet_tokens] [identity] [identity_mapping] [kvs] [ldap] [matchmaker_redis] [matchmaker_ring] [memcache] servers = 192.168.1.17:11211 [oauth1] [os_inherit] [oslo_messaging_amqp] [oslo_messaging_qpid] [oslo_messaging_rabbit] [oslo_middleware] [oslo_policy] [paste_deploy] [policy] [resource] [revoke] driver = sql [role] [saml] [signing] [ssl] [token] provider = uuid driver = memcache [tokenless_auth] [trust]

2、 创建数据库表, 使用命令同步 [root@linux-node1 ~]# su -s /bin/sh -c “keystone-manage db_sync” keystone No handlers could be found for logger “oslo_config.cfg”                                          #出现这个信息,不影响后续操作!忽略~

[root@linux-node1 ~]# ll /var/log/keystone/keystone.log -rw-r–r–. 1 keystone keystone 298370 Aug 26 11:36 /var/log/keystone/keystone.log      #之所以上面 su 切换是因为这个日志文件属主 [root@linux-node1 config]# mysql -h 192.168.1.17 -u keystone -p      #数据库检查表,生产环境密码不要用keystone,改成复杂点的密码

3、 启动 memcached 和 apache 启动 memcached [root@linux-node1 ~]# systemctl enable memcached [root@linux-node1 ~]#ln -s ‘/usr/lib/systemd/system/memcached.service’ ‘/etc/systemd/system/multi-user.target.wants/memcached.service’ [root@linux-node1 ~]# systemctl start memcached 配置 httpd [root@linux-node1 ~]# vim /etc/httpd/conf/httpd.conf ServerName 192.168.1.17:80 [root@linux-node1 ~]# cat /etc/httpd/conf.d/wsgi-keystone.conf Listen 5000 Listen 35357

<VirtualHost *:5000> WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP} WSGIProcessGroup keystone-public WSGIScriptAlias / /usr/bin/keystone-wsgi-public WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On <IfVersion >= 2.4> ErrorLogFormat “%{cu}t %M” </IfVersion> ErrorLog /var/log/httpd/keystone-error.log CustomLog /var/log/httpd/keystone-access.log combined <Directory /usr/bin> <IfVersion >= 2.4> Require all granted </IfVersion> <IfVersion < 2.4> Order allow,deny Allow from all </IfVersion> </Directory> </VirtualHost>

<VirtualHost *:35357> WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP} WSGIProcessGroup keystone-admin WSGIScriptAlias / /usr/bin/keystone-wsgi-admin WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On <IfVersion >= 2.4> ErrorLogFormat “%{cu}t %M” </IfVersion> ErrorLog /var/log/httpd/keystone-error.log CustomLog /var/log/httpd/keystone-access.log combined <Directory /usr/bin> <IfVersion >= 2.4> Require all granted </IfVersion> <IfVersion < 2.4> Order allow,deny Allow from all </IfVersion> </Directory> </VirtualHost>

启动 httpd [root@linux-node1 config]# systemctl enable httpd [root@linux-node1 config]#ln -s ‘/usr/lib/systemd/system/httpd.service’ ‘/etc/systemd/system/multi-user.target.wants/httpd.service’ [root@linux-node1 config]# systemctl start httpd [root@linux-node1 ~]# netstat -lntup|grep httpd tcp6 0 0 :::5000 :::* LISTEN 23632/httpd tcp6 0 0 :::80 :::* LISTEN 23632/httpd tcp6 0 0 :::35357 :::* LISTEN 23632/httpd 如果 http 起不来关闭 selinux 或者安装 yum install openstack-selinux

4、 创建 keystone 用户 临时设置 admin_token 用户的环境变量,用来创建用户 [root@linux-node1 ~]# export OS_TOKEN=35d6e6f377a889571bcf                           #上面产生的随机数值 [root@linux-node1 ~]# export OS_URL=http://192.168.1.17:35357/v3 [root@linux-node1 ~]# export OS_IDENTITY_API_VERSION=3

创建 admin 项目—创建 admin 用户(密码 admin,生产不要这么玩) —创建 admin 角色—把 admin 用户加入到 admin 项目赋予 admin 的角色(三个 admin 的位置:项目,用户,角色) [root@linux-node1 ~]#openstack project create –domain default –description “Admin Project” admin [root@linux-node1 ~]#openstack user create –domain default –password-prompt admin [root@linux-node1 ~]#openstack role create admin [root@linux-node1 ~]#openstack role add –project admin –user admin admin 创建一个普通用户 demo [root@linux-node1 ~]#openstack project create –domain default –description “Demo Project” demo [root@linux-node1 ~]#openstack user create –domain default –password=demo demo [root@linux-node1 ~]#openstack role create user [root@linux-node1 ~]#openstack role add –project demo –user demo user

创建 service 项目,用来管理其他服务用 [root@linux-node1 ~]#openstack project create –domain default –description “Service Project” service

以上的名字都是固定的,不能改

查看创建的而用户和项目 [root@linux-node1 ~]# openstack user list +———————————-+——-+ | ID | Name | +———————————-+——-+ | b1f164577a2d43b9a6393527f38e3f75 | demo | | b694d8f0b70b41d883665f9524c77766 | admin | +———————————-+——-+ [root@linux-node1 ~]# openstack project list +———————————-+———+ | ID | Name | +———————————-+———+ | 604f9f78853847ac9ea3c31f2c7f677d | demo | | 777f4f0108b1476eabc11e00dccaea9f | admin | | aa087f62f1d44676834d43d0d902d473 | service | +———————————-+———+ 5、注册 keystone 服务,以下三种类型分别为公共的、内部的、管理的。 [root@linux-node1 ~]#openstack service create –name keystone –description “OpenStack Identity” identity [root@linux-node1 ~]#openstack endpoint create –region RegionOne identity public http://192.168.1.17:5000/v2.0 [root@linux-node1 ~]#openstack endpoint create –region RegionOne identity internal http://192.168.1.17:5000/v2.0 [root@linux-node1 ~]#openstack endpoint create –region RegionOne identity admin http://192.168.1.17:35357/v2.0 [root@linux-node1 ~]# openstack endpoint list #查看 +———————————-+———–+————–+————–+———+—- ——-+———————————+ | ID | Region | Service Name | Service Type | Enabled | Interface | URL | +———————————-+———–+————–+————–+———+—- ——-+———————————+ | 011a24def8664506985815e0ed2f8fa5 | RegionOne | keystone | identity | True | internal | http://192.168.1.17:5000/v2.0 | | b0981cae6a8c4b3186edef818733fec6 | RegionOne | keystone | identity | True | public | http://192.168.1.17:5000/v2.0 | | c4e0c79c0a8142eda4d9653064563991 | RegionOne | keystone | identity | True | admin | http://192.168.1.17:35357/v2.0 | +———————————-+———–+————–+————–+———+—- ——-+———————————+ [root@linux-node1 ~]# openstack endpoint delete ID                                    #使用这个命令删除

6、 验证,获取 token,只有获取到才能说明 keystone 配置成功 [root@linux-node1 ~]# unset OS_TOKEN [root@linux-node1 ~]# unset OS_URL [root@linux-node1 ~]# openstack –os-auth-url http://192.168.1.17:35357/v3 –os-project-domain-id default –os-user-domain-id default –os-project-name admin –os-username admin –os-auth-type password token issue                   #回车 Password: admin +————+———————————-+ | Field | Value | +————+———————————-+ | expires | 2015-12-17T04:22:00.600668Z | | id | 1b530a078b874438aadb77af11ce297e | | project_id | 777f4f0108b1476eabc11e00dccaea9f | | user_id | b694d8f0b70b41d883665f9524c77766 | +————+———————————-+

使用环境变量来获取 token,环境变量在后面创建虚拟机时也需要用。 创建两个环境变量文件,使用时直接 source!!!(注意,下面两个sh文件所在的路径,在查看命令前都要source下,不然会报错!!) [root@linux-node1 ~]# cat admin-openrc.sh export OS_PROJECT_DOMAIN_ID=default export OS_USER_DOMAIN_ID=default export OS_PROJECT_NAME=admin export OS_TENANT_NAME=admin export OS_USERNAME=admin export OS_PASSWORD=admin export OS_AUTH_URL=http://192.168.1.17:35357/v3 export OS_IDENTITY_API_VERSION=3

[root@linux-node1 ~]# cat demo-openrc.sh export OS_PROJECT_DOMAIN_ID=default export OS_USER_DOMAIN_ID=default export OS_PROJECT_NAME=demo export OS_TENANT_NAME=demo export OS_USERNAME=demo export OS_PASSWORD=demo export OS_AUTH_URL=http://192.168.1.17:5000/v3 export OS_IDENTITY_API_VERSION=3 [root@linux-node1 ~]# source admin-openrc.sh [root@linux-node1 ~]# openstack token issue +————+———————————-+ | Field | Value | +————+———————————-+ | expires | 2015-12-17T04:26:08.625399Z | | id | 58370ae3b9bb4c07a67700dd184ad3b1 | 16 | project_id | 777f4f0108b1476eabc11e00dccaea9f | | user_id | b694d8f0b70b41d883665f9524c77766 | +————+———————————-+

3.6 配置 glance 镜像服务 3.6.1 glance 介绍

3.6.2 glance 配置 端口: api            9191 registry    9292 1、修改/etc/glance/glance-api.conf 和/etc/glance/glance-registry.conf [root@linux-node1 ~]# cat /etc/glance/glance-api.conf|grep -v “^#”|grep -v “^$” [DEFAULT] verbose=True notification_driver = noop                                           #galnce 不需要消息队列 [database] connection=mysql://glance:glance@192.168.1.17/glance [glance_store] default_store=file filesystem_store_datadir=/var/lib/glance/images/ [image_format] [keystone_authtoken] auth_uri = http://192.168.1.17:5000 auth_url = http://192.168.1.17:35357 auth_plugin = password project_domain_id = default user_domain_id = default project_name = service username = glance password = glance [matchmaker_redis] [matchmaker_ring] [oslo_concurrency] [oslo_messaging_amqp] [oslo_messaging_qpid] [oslo_messaging_rabbit] [oslo_policy] [paste_deploy] flavor=keystone [store_type_location_strategy] [task] [taskflow_executor]

[root@linux-node1 ~]# cat /etc/glance/glance-registry.conf|grep -v “^#”|grep -v “^$” [DEFAULT] verbose=True notification_driver = noop [database] connection=mysql://glance:glance@192.168.1.17/glance [glance_store] [keystone_authtoken] auth_uri = http://192.168.1.17:5000 auth_url = http://192.168.1.17:35357 auth_plugin = password project_domain_id = default user_domain_id = default project_name = service username = glance password = glance [matchmaker_redis] [matchmaker_ring] [oslo_messaging_amqp] [oslo_messaging_qpid] [oslo_messaging_rabbit] [oslo_policy] [paste_deploy] flavor=keystone

2、创建数据库表,同步数据库 [root@linux-node1 ~]# su -s /bin/sh -c “glance-manage db_sync” glance [root@linux-node1 ~]# mysql -h 192.168.1.17 -uglance -p

3、 创建关于 glance 的 keystone 用户 [root@linux-node1 ~]# source admin-openrc.sh [root@linux-node1 ~]# openstack user create –domain default –password=glance glance [root@linux-node1 ~]# openstack role add –project service –user glance admin

4、启动 glance [root@linux-node1 ~]#systemctl enable openstack-glance-api [root@linux-node1 ~]#systemctl enable openstack-glance-registry [root@linux-node1 ~]#systemctl start openstack-glance-api [root@linux-node1 ~]#systemctl start openstack-glance-registry [root@linux-node1 ~]# netstat -lnutp |grep 9191 #registry tcp 0 0 0.0.0.0:9191 0.0.0.0:* LISTEN 24890/python2 [root@linux-node1 ~]# netstat -lnutp |grep 9292 #api tcp 0 0 0.0.0.0:9292 0.0.0.0:* LISTEN 24877/python2

5、在 keystone 上注册 [root@linux-node1 ~]# source admin-openrc.sh [root@linux-node1 ~]#openstack service create –name glance –description “OpenStack Image service” image [root@linux-node1 ~]#openstack endpoint create –region RegionOne image public http://192.168.1.17:9292 [root@linux-node1 ~]#openstack endpoint create –region RegionOne image internal http://192.168.1.17:9292 [root@linux-node1 ~]#openstack endpoint create –region RegionOne image admin http://192.168.1.17:9292

6、添加 glance 环境变量并测试 [root@linux-node1 src]# echo “export OS_IMAGE_API_VERSION=2” | tee -a admin-openrc.sh demo-openrc.sh [root@linux-node1 src]# glance image-list +—-+——+ | ID | Name | +—-+——+ +—-+——+

7、 下载镜像并上传到 glance 【此处下载的qcow2格式镜像比较小,可以直接下载ios格式镜像,然后用oz工具制造】 [root@linux-node1 ~]# wget -q http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img   #也可以提前下载下来 [root@linux-node1 ~]# glance image-create –name “cirros” –file cirros-0.3.4-x86_64-disk.img –disk-format qcow2 –container-format bare –visibility public –progress [=============================>] 100% +——————+————————————–+ | Property | Value | +——————+————————————–+ | checksum | ee1eca47dc88f4879d8a229cc70a07c6 | | container_format | bare | | created_at | 2015-12-17T04:11:02Z | | disk_format | qcow2 | | id | 2707a30b-853f-4d04-861d-e05b0f1855c8 | | min_disk | 0 | | min_ram | 0 | | name | cirros | | owner | 777f4f0108b1476eabc11e00dccaea9f | | protected | False | | size | 13287936 | | status | active | | tags | [] | | updated_at | 2015-12-17T04:11:03Z | | virtual_size | None | | visibility | public | +——————+————————————–+ ——————————————————————————————————————————- 下载ios格式镜像,需要用OZ工具制造openstack镜像,具体操作请见另一篇博客:

实际生产环境下,肯定要使用ios镜像进行制作了

http://www.cnblogs.com/kevingrace/p/5821823.html

——————————————————————————————————————————-

或者直接下载centos的qcow2格式镜像进行上传,qcow2格式镜像直接就可以在openstack里使用,不需要进行格式转换! 下载地址:http://cloud.centos.org/centos,可以到里面下载centos5/6/7的qcow2格式的镜像

[root@linux-node1 ~]#wget http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 [root@linux-node1 ~]#glance image-create –name “CentOS-7-x86_64” –file CentOS-7-x86_64-GenericCloud.qcow2 –disk-format qcow2 –container-format bare –visibility public –progress

——————————————————————————————————————————

[root@linux-node1 ~]# glance image-list +————————————–+——–+ | ID | Name | +————————————–+——–+ | 2707a30b-853f-4d04-861d-e05b0f1855c8 | cirros | +————————————–+——–+

[root@linux-node1 ~]# ll /var/lib/glance/images/ 总用量 12980 -rw-r—–. 1 glance glance 1569390592 Aug 26 12:50 35b36f08-eeb9-4a91-9366-561f0a308a1b

3.7 配置 nova 计算服务 3.7.1 nova 介绍 nova 必备的组件

nova scheduler

3.7.2 Nova 控制节点配置

1、修改/etc/nova/nova.conf [root@linux-node1 ~]# cat /etc/nova/nova.conf|grep -v “^#”|grep -v “^$” [DEFAULT] my_ip=192.168.1.17 enabled_apis=osapi_compute,metadata auth_strategy=keystone network_api_class=nova.network.neutronv2.api.API linuxnet_interface_driver=nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver security_group_api=neutron firewall_driver = nova.virt.firewall.NoopFirewallDriver debug=true verbose=true rpc_backend=rabbit allow_resize_to_same_host=True scheduler_default_filters=RetryFilter,AvailabilityZoneFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter [api_database] [barbican] [cells] [cinder] [conductor] [cors] [cors.subdomain] [database] connection=mysql://nova:nova@192.168.1.17/nova [ephemeral_storage_encryption] [glance] host=$my_ip [guestfs] [hyperv] [image_file_url] [ironic] [keymgr] [keystone_authtoken] auth_uri = http://192.168.1.17:5000 auth_url = http://192.168.1.17:35357 auth_plugin = password project_domain_id = default user_domain_id = default project_name = service username = nova password = nova [libvirt] virt_type=kvm #如果控制节点也作为计算节点(单机部署的话),这一行也添加上(这行是计算节点配置的) [matchmaker_redis] [matchmaker_ring] [metrics] [neutron] url = http://192.168.1.17:9696 auth_url = http://192.168.1.17:35357 auth_plugin = password project_domain_id = default user_domain_id = default region_name = RegionOne project_name = service username = neutron password = neutron service_metadata_proxy = True metadata_proxy_shared_secret = neutron lock_path=/var/lib/nova/tmp [osapi_v21] [oslo_concurrency] [oslo_messaging_amqp] [oslo_messaging_qpid] [oslo_messaging_rabbit] rabbit_host=192.168.1.17 rabbit_port=5672 rabbit_userid=openstack rabbit_password=openstack [oslo_middleware] [rdp] [serial_console] [spice] [ssl] [trusted_computing] [upgrade_levels] [vmware] [vnc] novncproxy_base_url=http://58.68.250.17:6080/vnc_auto.html  #如果控制节点也作为计算节点(单机部署的话),这一行也添加上(这行是计算节点配置的),配置控制节点的公网ip vncserver_listen= $my_ip vncserver_proxyclient_address= $my_ip keymap=en-us #如果控制节点也作为计算节点(单机部署的话),这一行也添加上(这行是计算节点配置的) [workarounds] [xenserver] [zookeeper]

*********************************************************************** {网络部分为啥这么写:network_api_class=nova.network.neutronv2.api.API} [root@linux-node1 ~]# ls /usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py /usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py 这里面有一个 API 方法,其他配置类似 ***********************************************************************

2、同步数据库 [root@linux-node1 ~]# su -s /bin/sh -c “nova-manage db sync” nova [root@linux-node1 ~]# mysql -h 192.168.1.17 -unova -p 检查

3、创建 nova 的 keystone 用户 [root@linux-node1 ~]# openstack user create –domain default –password=nova nova [root@linux-node1 ~]# openstack role add –project service –user nova admin

4、启动 nova 相关服务 [root@linux-node1 ~]#systemctl enable openstack-nova-api.service openstack-nova-cert.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service [root@linux-node1 ~]#systemctl start openstack-nova-api.service openstack-nova-cert.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service

5、在 keystone 上注册 [root@linux-node1 ~]# source admin-openrc.sh [root@linux-node1 ~]# openstack service create –name nova –description “OpenStack Compute” compute [root@linux-node1 ~]# openstack endpoint create –region RegionOne compute public http://192.168.1.17:8774/v2/%\(tenant_id\)s [root@linux-node1 ~]# openstack endpoint create –region RegionOne compute internal http://192.168.1.17:8774/v2/%\(tenant_id\)s [root@linux-node1 ~]# openstack endpoint create –region RegionOne compute admin http://192.168.1.17:8774/v2/%\(tenant_id\)s 检查 [root@linux-node1 ~]# openstack host list +—————————+————-+———-+ | Host Name | Service | Zone | +—————————+————-+———-+ | linux-node1.oldboyedu.com | conductor | internal | | linux-node1.oldboyedu.com | scheduler | internal | | linux-node1.oldboyedu.com | consoleauth | internal | | linux-node1.oldboyedu.com | cert | internal | +—————————+————-+———-+

3.7.3   nova 计算节点配置 1、 nova compute 介绍

2、修改配置文件/etc/nova/nova.conf 可以直接从 node1 拷贝到 node2 上 [root@linux-node1 ~]# scp /etc/nova/nova.conf 192.168.1.8:/etc/nova/ 手动更改如下配置 [root@linux-node2 ~]# vim /etc/nova/nova.conf my_ip=192.168.1.8 novncproxy_base_url=http://192.168.1.17:6080/vnc_auto.html vncserver_listen=0.0.0.0 vncserver_proxyclient_address= $my_ip keymap=en-us [glance] host=192.168.56.17 [libvirt] virt_type=kvm                   #虚拟机类型,默认是 kvm

3、启动服务 [root@linux-node2 ~]# systemctl enable libvirtd openstack-nova-compute [root@linux-node2 ~]# systemctl start libvirtd openstack-nova-compute

4、在控制节点测试(计算节点上也行,需要环境变量) [root@linux-node1 ~]# openstack host list +—————————+————-+———-+ | Host Name | Service | Zone | +—————————+————-+———-+ | linux-node1.oldboyedu.com | conductor | internal | | linux-node1.oldboyedu.com | consoleauth | internal | | linux-node1.oldboyedu.com | scheduler | internal | | linux-node1.oldboyedu.com | cert | internal | | linux-node2.oldboyedu.com | compute | nova | +—————————+————-+———-+

[root@linux-node1 ~]# nova image-list                  #测试 glance 是否正常 +————————————–+——–+——–+——–+ | ID | Name | Status | Server | +————————————–+——–+——–+——–+ | 2707a30b-853f-4d04-861d-e05b0f1855c8 | cirros | ACTIVE | | +————————————–+——–+——–+——–+ [root@linux-node1 ~]# nova endpoints                     #测试 keystone WARNING: keystone has no endpoint in ! Available endpoints for this service:           #这一行告警不影响后面的操作 +———–+———————————-+ | keystone | Value | +———–+———————————-+ | id | 02fed35802734518922d0ca2d672f469 | | interface | internal | | region | RegionOne | | region_id | RegionOne | | url | http://192.168.1.17:5000/v2.0 | +———–+———————————-+ +———–+———————————-+ | keystone | Value | +———–+———————————-+ | id | 52b0a1a700f04773a220ff0e365dea45 | | interface | public | | region | RegionOne | | region_id | RegionOne | | url | http://192.168.1.17:5000/v2.0 | +———–+———————————-+ +———–+———————————-+ | keystone | Value | +———–+———————————-+ | id | 88df7df6427d45619df192979219e65c | | interface | admin | | region | RegionOne | | region_id | RegionOne | | url | http://192.168.1.17:35357/v2.0 | +———–+———————————-+ WARNING: nova has no endpoint in ! Available endpoints for this service: +———–+————————————————————–+ | nova | Value | +———–+————————————————————–+ | id | 1a3115941ff54b7499a800c7c43ee92a | | interface | internal | | region | RegionOne | | region_id | RegionOne | | url | http://192.168.1.17:8774/v2/65a0c00638c247a0a274837aa6eb165f | +———–+————————————————————–+ +———–+————————————————————–+ | nova | Value | +———–+————————————————————–+ | id | 5278f33a42754c9a8d90937932b8c0b3 | | interface | admin | | region | RegionOne | | region_id | RegionOne | | url | http://192.168.1.17:8774/v2/65a0c00638c247a0a274837aa6eb165f | +———–+————————————————————–+ +———–+————————————————————–+ | nova | Value | +———–+————————————————————–+ | id | 8c4fa7b9a24949c5882949d13d161d36 | | interface | public | | region | RegionOne | | region_id | RegionOne | | url | http://192.168.1.17:8774/v2/65a0c00638c247a0a274837aa6eb165f | +———–+————————————————————–+ WARNING: glance has no endpoint in ! Available endpoints for this service: +———–+———————————-+ | glance | Value | +———–+———————————-+ | id | 31fbf72537a14ba7927fe9c7b7d06a65 | | interface | admin | | region | RegionOne | | region_id | RegionOne | | url | http://192.168.1.17:9292 | +———–+———————————-+ +———–+———————————-+ | glance | Value | +———–+———————————-+ | id | be788b4aa2ce4251b424a3182d0eea11 | | interface | public | | region | RegionOne | | region_id | RegionOne | | url | http://192.168.1.17:9292 | +———–+———————————-+ +———–+———————————-+ | glance | Value | +———–+———————————-+ | id | d0052712051a4f04bb59c06e2d5b2a0b | | interface | internal | | region | RegionOne | | region_id | RegionOne | | url | http://192.168.1.17:9292 | +———–+———————————-+

3.8 Neutron 网络服务 3.8.1 Neutron 介绍 neutron 由来

openstack 网络分类:

Neutron 组件

3.8.2 Neutron 控制节点配置( 5 个配置文件) 1、修改/etc/neutron/neutron.conf 文件

[root@linux-node1 ~]# cat /etc/neutron/neutron.conf|grep -v “^#”|grep -v “^$” [DEFAULT] state_path = /var/lib/neutron core_plugin = ml2 service_plugins = router auth_strategy = keystone notify_nova_on_port_status_changes = True notify_nova_on_port_data_changes = True nova_url = http://192.168.1.17:8774/v2 rpc_backend=rabbit [matchmaker_redis] [matchmaker_ring] [quotas] [agent] [keystone_authtoken] auth_uri = http://192.168.1.17:5000 auth_url = http://192.168.1.17:35357 auth_plugin = password project_domain_id = default user_domain_id = default project_name = service username = neutron password = neutron admin_tenant_name = %SERVICE_TENANT_NAME% admin_user = %SERVICE_USER% admin_password = %SERVICE_PASSWORD% [database] connection = mysql://neutron:neutron@192.168.1.17:3306/neutron [nova] auth_url = http://192.168.1.17:35357 auth_plugin = password project_domain_id = default user_domain_id = default region_name = RegionOne project_name = service username = nova password = nova [oslo_concurrency] lock_path = $state_path/lock [oslo_policy] [oslo_messaging_amqp] [oslo_messaging_qpid] [oslo_messaging_rabbit] rabbit_host = 192.168.1.17 rabbit_port = 5672 rabbit_userid = openstack rabbit_password = openstack [qos]

2、 配置/etc/neutron/plugins/ml2/ml2_conf.ini [root@linux-node1 ~]# cat /etc/neutron/plugins/ml2/ml2_conf.ini|grep -v “^#”|grep -v “^$” [ml2] type_drivers = flat,vlan,gre,vxlan,geneve tenant_network_types = vlan,gre,vxlan,geneve mechanism_drivers = openvswitch,linuxbridge extension_drivers = port_security [ml2_type_flat] flat_networks = physnet1 [ml2_type_vlan] [ml2_type_gre] [ml2_type_vxlan] [ml2_type_geneve] [securitygroup] enable_ipset = True

3、配置/etc/neutron/plugins/ml2/ linuxbridge_agent.ini [root@linux-node1 ~]# cat /etc/neutron/plugins/ml2/linuxbridge_agent.ini|grep -v “^#”|grep -v “^$” [linux_bridge] physical_interface_mappings = physnet1:em2 [vxlan] enable_vxlan = false [agent] prevent_arp_spoofing = True [securitygroup] firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver enable_security_group = True

4、修改/etc/neutron/dhcp_agent.ini [root@linux-node1 ~]# cat /etc/neutron/dhcp_agent.ini|grep -v “^#”|grep -v “^$” [DEFAULT] interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq enable_isolated_metadata = true [AGENT]

5、修改/etc/neutron/metadata_agent.ini [root@linux-node1 ~]# cat /etc/neutron/metadata_agent.ini|grep -v “^#”|grep -v “^$” [DEFAULT] auth_uri = http://192.168.1.17:5000 auth_url = http://192.168.1.17:35357 auth_region = RegionOne auth_plugin = password project_domain_id = default user_domain_id = default project_name = service username = neutron password = neutron nova_metadata_ip = 192.168.1.17 metadata_proxy_shared_secret = neutron admin_tenant_name = %SERVICE_TENANT_NAME% admin_user = %SERVICE_USER% admin_password = %SERVICE_PASSWORD% [AGENT]

6、创建连接并创建 keystone 的用户 [root@linux-node1 ~]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini [root@linux-node1 ~]# openstack user create –domain default –password=neutron neutron [root@linux-node1 ~]# openstack role add –project service –user neutron admin

7、更新数据库 [root@linux-node1 ~]# su -s /bin/sh -c “neutron-db-manage –config-file /etc/neutron/neutron.conf –config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head” neutron

8、注册 keystone [root@linux-node1 ~]# source admin-openrc.sh [root@linux-node1 ~]# openstack service create –name neutron –description “OpenStack Networking” network [root@linux-node1 ~]# openstack endpoint create –region RegionOne network public http://192.168.1.17:9696 [root@linux-node1 ~]# openstack endpoint create –region RegionOne network internal http://192.168.1.17:9696 [root@linux-node1 ~]# openstack endpoint create –region RegionOne network admin http://192.168.1.17:9696

9、 启动服务并检查 因为neutron和nova有联系,做neutron时修改nova的配置文件,上面nova.conf已经做了neutron的关联配置,所以要重启openstack-nova-api服务。 这里将nova的关联服务都一并重启了: [root@linux-node1 ~]# systemctl restart openstack-nova-api.service openstack-nova-cert.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service

启动neutron相关服务 [root@linux-node1 ~]# systemctl enable neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service [root@linux-node1 ~]# systemctl start neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service

检查 [root@linux-node1 ~]# neutron agent-list +————————————–+——————–+——————+——-+—————-+—————————+ | id | agent_type | host | alive | admin_state_up | binary | +————————————–+——————–+——————+——-+—————-+—————————+ | 385cebf9-9b34-4eca-b780-c515dbc7eec0 | Linux bridge agent | openstack-server | 🙂 | True | neutron-linuxbridge-agent | | b3ff8ffe-1ff2-4659-b823-331def4e6a93 | DHCP agent | openstack-server | 🙂 | True | neutron-dhcp-agent | | b5bed625-47fd-4e79-aa55-01cf8a8cc577 | Metadata agent | openstack-server | 🙂 | True | neutron-metadata-agent | +————————————–+——————–+——————+——-+—————-+—————————+

查看注册信息 [root@openstack-server src]# openstack endpoint list +———————————-+———–+————–+————–+———+———–+——————————————-+ | ID | Region | Service Name | Service Type | Enabled | Interface | URL | +———————————-+———–+————–+————–+———+———–+——————————————-+ | 02fed35802734518922d0ca2d672f469 | RegionOne | keystone | identity | True | internal | http://192.168.1.17:5000/v2.0 | | 1a3115941ff54b7499a800c7c43ee92a | RegionOne | nova | compute | True | internal | http://192.168.1.17:8774/v2/%(tenant_id)s | | 31fbf72537a14ba7927fe9c7b7d06a65 | RegionOne | glance | image | True | admin | http://192.168.1.17:9292 | | 5278f33a42754c9a8d90937932b8c0b3 | RegionOne | nova | compute | True | admin | http://192.168.1.17:8774/v2/%(tenant_id)s | | 52b0a1a700f04773a220ff0e365dea45 | RegionOne | keystone | identity | True | public | http://192.168.1.17:5000/v2.0 | | 88df7df6427d45619df192979219e65c | RegionOne | keystone | identity | True | admin | http://192.168.1.17:35357/v2.0 | | 8c4fa7b9a24949c5882949d13d161d36 | RegionOne | nova | compute | True | public | http://192.168.1.17:8774/v2/%(tenant_id)s | | be788b4aa2ce4251b424a3182d0eea11 | RegionOne | glance | image | True | public | http://192.168.1.17:9292 | | c059a07fa3e141a0a0b7fc2f46ca922c | RegionOne | neutron | network | True | public | http://192.168.1.17:9696 | | d0052712051a4f04bb59c06e2d5b2a0b | RegionOne | glance | image | True | internal | http://192.168.1.17:9292 | | ea325a8a2e6e4165997b2e24a8948469 | RegionOne | neutron | network | True | internal | http://192.168.1.17:9696 | | ffdec11ccf024240931e8ca548876ef0 | RegionOne | neutron | network | True | admin | http://192.168.1.17:9696 | +———————————-+———–+————–+————–+———+———–+——————————————-+

3.8.3 Neutron 计算节点配置 1、修改相关配置文件 从 node1 上直接拷贝

[root@linux-node1 ~]# scp /etc/neutron/neutron.conf 192.168.1.8:/etc/neutron/ [root@linux-node1 ~]# scp /etc/neutron/plugins/ml2/linuxbridge_agent.ini 192.168.1.8:/etc/neutron/plugins/ml2/ [root@linux-node1 ~]# scp /etc/neutron/plugins/ml2/ml2_conf.ini 192.168.1.8:/etc/neutron/plugins/ml2/ 修改计算节点的 nova 配置文件中 neutron 部分, 并重启 openstack-nova-compute 服务, 因为 上面 nova 计算节点也是从控制节点拷贝的,此处无需操作

2、 创建软连接并启动服务 [root@linux-node2 ~]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini [root@linux-node2 ~]# systemctl enable neutron-linuxbridge-agent.service [root@linux-node2 ~]# systemctl start neutron-linuxbridge-agent.service

检查 [root@linux-node1 ~]# neutron agent-list +————————————–+——————–+——————+——-+—————-+—————————+ | id | agent_type | host | alive | admin_state_up | binary | +————————————–+——————–+——————+——-+—————-+—————————+ | 385cebf9-9b34-4eca-b780-c515dbc7eec0 | Linux bridge agent | openstack-server | 🙂 | True | neutron-linuxbridge-agent | | b3ff8ffe-1ff2-4659-b823-331def4e6a93 | DHCP agent | openstack-server | 🙂 | True | neutron-dhcp-agent | | b5bed625-47fd-4e79-aa55-01cf8a8cc577 | Metadata agent | openstack-server | 🙂 | True | neutron-metadata-agent | +————————————–+——————–+——————+——-+—————-+—————————+

3.9 创建虚拟机 3.9.1 创建桥接网络

1、 创建网络 [root@linux-node1 ~]# source admin-openrc.sh                     #在哪个项目下创建虚拟机,这里选择在demo下创建;也可以在admin下 [root@linux-node1 ~]# neutron net-create flat –shared –provider:physical_network physnet1 –provider:network_type flat

2、 创建子网(填写宿主机的内网网关,下面DNS和内网网关可以设置成宿主机的内网ip,下面192.168.1.100-200是分配给虚拟机的ip范围) [root@linux-node1 ~]# neutron subnet-create flat 192.168.1.0/24 –name flat-subnet –allocation-pool start=192.168.1.100,end=192.168.1.200 –dns-nameserver 192.168.1.1 –gateway 192.168.1.1

3、 查看子网 [root@linux-node1 ~]# neutron net-list +————————————–+——+—————————————————–+ | id | name | subnets | +————————————–+——+—————————————————–+ | 1d9657f6-de9e-488f-911f-020c8622fe78 | flat | c53da14a-01fe-4f6c-8485-232489deaa6e 192.168.1.0/24 | +————————————–+——+—————————————————–+

[root@linux-node1 ~]# neutron subnet-list +————————————–+————-+—————-+—————————————————-+ | id | name | cidr | allocation_pools | +————————————–+————-+—————-+—————————————————-+ | c53da14a-01fe-4f6c-8485-232489deaa6e | flat-subnet | 192.168.1.0/24 | {“start”: “192.168.1.100”, “end”: “192.168.1.200”} | +————————————–+————-+—————-+—————————————————-+ 需要关闭 VMware 的 dhcp

3.9.2 创建虚拟机(为vm分配内网ip,后续利用squid代理或宿主机NAT端口转发进行对外或对内访问) 1、创建 key [root@linux-node1 ~]# source demo-openrc.sh               (这是在demo账号下创建虚拟机;要是在admin账号下创建虚拟机,就用source admin-openrc.sh) [root@linux-node1 ~]# ssh-keygen -q -N “”

2、将公钥添加到虚拟机 [root@linux-node1 ~]# nova keypair-add –pub-key /root/.ssh/id_rsa.pub mykey [root@linux-node1 ~]# nova keypair-list +——-+————————————————-+ | Name | Fingerprint | +——-+————————————————-+ | mykey | cd:7a:1e:cd:c0:43:9b:b1:f4:3b:cf:cd:5e:95:f8:00 | +——-+————————————————-+

3、创建安全组 [root@linux-node1 ~]# nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0 [root@linux-node1 ~]# nova secgroup-add-rule default tcp 22 22 0.0.0.0/0

4、 创建虚拟机 查看支持的虚拟机类型 [root@linux-node1 ~]# nova flavor-list +—-+———–+———–+——+———–+——+——-+————-+———–+ | ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | +—-+———–+———–+——+———–+——+——-+————-+———–+ | 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True | | 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True | | 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True | | 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True | | 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True | +—-+———–+———–+——+———–+——+——-+————-+———–+ 查看镜像 [root@linux-node1 ~]# nova image-list +————————————–+——–+——–+——–+ | ID | Name | Status | Server | +————————————–+——–+——–+——–+ | 2707a30b-853f-4d04-861d-e05b0f1855c8 | cirros | ACTIVE | | +————————————–+——–+——–+——–+ 查看网络 [root@linux-node1 ~]# neutron net-list +————————————–+——+—————————————————–+ | id | name | subnets | +————————————–+——+—————————————————–+ | 1d9657f6-de9e-488f-911f-020c8622fe78 | flat | c53da14a-01fe-4f6c-8485-232489deaa6e 192.168.1.0/24 | +————————————–+——+—————————————————–+

创建虚拟机 【这一步容易报错,一般都是由于上面的 nova.conf 配置填写有误所致】 [root@linux-node1 ~]# nova boot –flavor m1.tiny –image cirros –nic net-id=1d9657f6-de9e-488f-911f-020c8622fe78 –security-group default –key-name mykey hello-instance

5、查看虚拟机

[root@linux-node1 ~]# nova list +————————————–+—————+——–+————+————-+——————–+ | ID | Name | Status | Task State | Power State | Networks | +————————————–+—————+——–+————+————-+——————–+ | 7a6215ac-aea7-4e87-99a3-b62c06d4610e | hello-instance| ACTIVE | – | Running | flat=192.168.1.102 | +————————————–+—————+——–+————+————-+——————–+

************************************************************************* 如果要删除虚拟机(利用虚拟机ID进行删除) [root@linux-node1 ~]# nova delete 7a6215ac-aea7-4e87-99a3-b62c06d4610e *************************************************************************

[root@linux-node1 src]# nova list +————————————–+—————-+——–+————+————-+——————–+ | ID | Name | Status | Task State | Power State | Networks | +————————————–+—————-+——–+————+————-+——————–+ | 007db18f-ae3b-463a-b86d-9a8455a21e2d | hello-instance | ACTIVE | – | Running | flat=192.168.1.101 | +————————————–+—————-+——–+————+————-+——————–+

[root@linux-node1 ~]# ssh cirros@192.168.1.101 登录查看

******************************************************************************

上面创建虚拟机的时候,openstack在neutron组网内是采用dhcp-agent自动分配ip的!

可以在创建虚拟机的时候,指定固定ip,方法详见于另一篇博客:

http://www.cnblogs.com/kevingrace/p/5822660.html

******************************************************************************

6、 web 界面打开虚拟机 [root@linux-node1 ~]# nova get-vnc-console hello-instance novnc +——-+———————————————————————————– -+ | Type | Url | + ——-+———————————————————————————– -+ | novnc | http://58.68.250.17:6080/vnc_auto.html?token=303d5a78-c85f-4ed9-93b6-be9d5d28fba6 |       #访问这个链接即可打开vnc界面 +——-+———————————————————————————– -+

4.0 安装 dashboard,登陆 web 管理界面 [root@linux-node1 ~]# yum install openstack-dashboard -y [root@linux-node1 ~]# vim /etc/openstack-dashboard/local_settings               #按照下面几行进行配置修改 OPENSTACK_HOST = “192.168.1.17”                                 #更改为keystone机器地址 OPENSTACK_KEYSTONE_DEFAULT_ROLE = “user”              #默认的角色 ALLOWED_HOSTS = [‘*’]                                                 #允许所有主机访问 CACHES = { ‘default’: { ‘BACKEND’: ‘django.core.cache.backends.memcached.MemcachedCache’, ‘LOCATION’: ‘192.168.1.17:11211’,                                   #连接memcached } } #CACHES = { # ‘default’: { # ‘BACKEND’: ‘django.core.cache.backends.locmem.LocMemCache’, # } #} TIME_ZONE = “Asia/Shanghai”                        #设置时区

重启 httpd 服务 [root@linux-node1 ~]# systemctl restart httpd

web 界面登录访问dashboard http://58.68.250.17/dashboard/ 用户密码 demo 或者 admin(管理员)

image.png

——————————————————————————————— 如果要修改dashboard的访问端口(比如将80端口改为8080端口),则需要修改下面两个配置文件: 1)vim /etc/httpd/conf/httpd.conf 将80端口修改为8080端口

Listen 8080 ServerName 192.168.1.17:8080

2)vim /etc/openstack-dashboard/local_settings #将下面两处的端口由80改为8080 ‘from_port’: ‘8080’, ‘to_port’: ‘8080’,

然后重启http服务: systemctl restart httpd

如果开启了防火墙,还需要开通8080端口访问规则

这样,dashboard访问url: http://58.68.250.17:8080/dashboard ———————————————————————————————

前面建立了两个账号:admin 和 demo,两个账号都可以登陆web!只不过, admin 是管理员账号, admin 登陆后可以看到其他账号下的状态 demo 等普通账号登陆后只能看到自己的状态 注意: 上面的 Rabbit 账号 admin 和 openstack 是消息队列的 web 登陆账号。 比如一下子要建立 10 个虚拟机的指令,但是当前资源处理不过来,就通过 Rabbit 进行排队!!

———————————————————————————————————————– 修改OpenStack中dashboard用户登陆密码的方法:

登陆dashboard:

————————————————————————————————————————————————–

创建虚拟机的时候,我们可以自己定义虚拟机的类型(即配置)。

登陆openstack的web管理界面里进行自定义,也可以将之前的删除。

查看上传到glance的镜像

查看创建的虚拟机实例

自定义虚拟主机类型,设置如下:

(如果想让虚拟机有空闲磁盘空间,用于新建分区之用,则可以在这里分配临时磁盘)

我创建了四个虚拟机实例,采用的是同一个虚拟主机类型(即上面的kvm002),四个实例总共占用宿主机40G的空间。

image.png

登陆到openstack,可以看到,左侧一共有四个标签栏:

—————————————————————————————————————————————————- 可以登陆dashboard界面,在“计算”->“实例”里选择“启动云主机”或者“计算->网络->网络拓扑”里选择“启动虚拟机”就可以再创建一个虚拟机 也可以按照快照再启动(创建)一个虚拟机,不过这样启动起来的虚拟机是一个新的ip(快照前的源虚拟机就要关机了)

查看实例,发现kvm-server005虚拟机已经创建成功了。默认创建后的ip是dhcp自动分配的,可以登陆虚拟机改成static静态ip

image.png

———————————————————————————————————————————————

在openstack 中重启实例有两种,分别被称为“软重启”和“硬重启”。所谓的软重启会尝试正常关机并重启实例,硬重启会直接将实例“断电”并重启。也就是说硬重启会“关闭”电源。其具体命令如下: 默认情况下,如果您通过nova重启,执行的是软重启。 $ nova reboot SERVER 如果您需要执行硬重启,添加–hard参数即可: $ nova reboot –hard SERVER

nova命令管理虚拟机:

$ nova list #查看虚拟机 $ nova stop [vm-name]或[vm-id] #关闭虚拟机 $ nova start [vm-name]或[vm-id] #启动虚拟机 $ nova suspend [vm-name]或[vm-id] #暂停虚拟机 $ nova resume [vm-name]或[vm-id] #启动暂停的虚拟机 $ nova delete [vm-name]或[vm-id] #删除虚拟机

$nova-manage service list    #检查服务是否正常

[root@openstack-server ~]# source /usr/local/src/admin-openrc.sh [root@openstack-server ~]# nova list +————————————–+—————-+——–+————+————-+——————–+ | ID | Name | Status | Task State | Power State | Networks | +————————————–+—————-+——–+————+————-+——————–+ | 11e7ad7f-c0a8-482b-abca-3a4b7cfdd55d | hello-instance | ACTIVE | – | Running | flat=192.168.1.107 | | 67f71703-c32c-4bf1-8778-b2a6600ad34a | kvm-server0 | ACTIVE | – | Running | flat=192.168.1.120 | +————————————–+—————-+——–+————+————-+——————–+ [root@openstack-server ~]# ll /var/lib/nova/instances/           #下面是虚拟机的存放路径 total 8 drwxr-xr-x. 2 nova nova 85 Aug 29 15:22 11e7ad7f-c0a8-482b-abca-3a4b7cfdd55d drwxr-xr-x. 2 nova nova 85 Aug 29 15:48 67f71703-c32c-4bf1-8778-b2a6600ad34a drwxr-xr-x. 2 nova nova 80 Aug 29 15:40 _base -rw-r–r–. 1 nova nova 39 Aug 29 16:44 compute_nodes drwxr-xr-x. 2 nova nova 4096 Aug 29 13:58 locks

———————————————————————————————————————————– virsh命令行管理虚拟机:

[root@openstack-server ~]# virsh list #查看虚拟机

Id Name State —————————————————- 9 instance-00000008 running 41 instance-00000015 running [root@openstack-server ~]# ll /etc/libvirt/qemu/ #虚拟机文件 total 16 -rw——-. 1 root root 4457 Aug 26 17:46 instance-00000008.xml -rw——-. 1 root root 4599 Aug 29 15:40 instance-00000015.xml drwx——. 3 root root 22 Aug 24 12:06 networks

其中: virsh list #显示本地活动虚拟机 virsh list –all #显示本地所有的虚拟机(活动的+不活动的) virsh define instance-00000015.xml #通过配置文件定义一个虚拟机(这个虚拟机还不是活动的) virsh edit instance-00000015 # 编辑配置文件(一般是在刚定义完虚拟机之后) virsh start instance-00000015 #启动名字为ubuntu的非活动虚拟机 virsh reboot instance-00000015 #重启虚拟机 virsh create instance-00000015.xml #创建虚拟机(创建后,虚拟机立即执行,成为活动主机) virsh suspend instance-00000015 #暂停虚拟机 virsh resume instance-00000015 #启动暂停的虚拟机 virsh shutdown instance-00000015 #正常关闭虚拟机 virsh destroy instance-00000015 #强制关闭虚拟机 virsh dominfo instance-00000015 #显示虚拟机的基本信息 virsh domname 2 #显示id号为2的虚拟机名 virsh domid instance-00000015 #显示虚拟机id号 virsh domuuid instance-00000015 #显示虚拟机的uuid virsh domstate instance-00000015 #显示虚拟机的当前状态 virsh dumpxml instance-00000015 #显示虚拟机的当前配置文件(可能和定义虚拟机时的配置不同,因为当虚拟机启动时,需要给虚拟机分配id号、uuid、vnc端口号等等) virsh setmem instance-00000015 512000 #给不活动虚拟机设置内存大小 virsh setvcpus instance-00000015 4 # 给不活动虚拟机设置cpu个数 virsh save instance-00000015 a  #将该instance-00000015虚拟机的运行状态存储到文件a中 virsh restore a    #恢复被存储状态的虚拟机的状态,即便虚拟机被删除也可以恢复(如果虚拟机已经被undefine移除,那么恢复的虚拟机也只是一个临时的状态,关闭后自动消失) virsh undefine instance-00000015    #移除虚拟机,虚拟机处于关闭状态后还可以启动,但是被该指令删除后不能启动。在虚拟机处于Running状态时,调用该指令,该指令暂时不生效,但是当虚拟机被关闭后,该指令生效移除该虚拟机,也可以在该指令生效之前调用define+TestKVM.xml取消该指令

注意: virsh destroy instance-00000015 这条命令并不是真正的删除这个虚拟机,只是将这个虚拟机强制关闭了。可以通过该虚拟机的xml文件恢复。如下: [root@kvm-server ~]# virsh list Id Name State —————————————————- 1 dev-new-test2 running 2 beta-new2 running 5 test-server running 8 ubuntu-test03 running 9 elk-node1 running 10 elk-node2 running 11 ubuntu-test01 running 12 ubuntu-test02 running

强制关闭虚拟机 [root@kvm-server ~]# virsh destroy ubuntu-test02 Domain ubuntu-test02 destroyed

发现ubuntu-test02虚拟机已经关闭了 [root@kvm-server ~]# virsh list Id Name State —————————————————- 1 dev-new-test2 running 2 beta-new2 running 5 test-server running 8 ubuntu-test03 running 9 elk-node1 running 10 elk-node2 running 11 ubuntu-test01 running

但是该虚拟机的xml文件还在,可以通过这个文件恢复 [root@kvm-server ~]# ll /etc/libvirt/qemu/ubuntu-test02.xml -rw——- 1 root root 2600 Dec 26 13:55 /etc/libvirt/qemu/ubuntu-test02.xml [root@kvm-server ~]# virsh define /etc/libvirt/qemu/ubuntu-test02.xml #这只是重新添加了这个虚拟机,目前还不是活动的虚拟机,需要启动下 [root@kvm-server ~]# virsh start ubuntu-test02 Domain ubuntu-test02 started [root@kvm-server ~]# virsh list Id Name State —————————————————- 1 dev-new-test2 running 2 beta-new2 running 5 test-server running 8 ubuntu-test03 running 9 elk-node1 running 10 elk-node2 running 11 ubuntu-test01 running 12 ubuntu-test02 running

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

https://cloud.tencent.com/developer/article/1026128

博纳云标准节点提交注意事项

1.标准节点分为静态IP专线(单设备 5Gbps – 10Gbps)及动态IP汇聚(单设备 3Gbps- 5Gbps)。
(1)静态IP专线要求及设备配置请参考:https://shimo.im/docs/pDQVDH8pr6Pk8qdv
(2)动态IP汇聚要求及设备配置请参考:https://shimo.im/docs/QqJtpkCkYvRTQWvx
2.标准节点收益根据有效带宽 95 峰月结,具体收益情况请加入官方社群咨询二猫。
(1)有效带宽 95 峰:按自然月结算,在一个自然月内,按账户取每5分钟有效带宽值(出带宽-入带宽)进行降序排列,将带宽数值最高的 5% 的点去掉,剩余最高带宽即为月95带宽峰值计费值。以一月30天为例,默认均为有效取值点,每5分钟1个带宽取值点,每天288个取值点,每月总取值点数为 288x 30 = 8640个;将所有的点按带宽数值降序排列,去掉前5%的点(8640 x 5% = 432 个点),即第433个点为月95峰值带宽计费点。
3.动态IP汇聚需要先填写拨号配置,请前往 软路由 – 汇聚拨号配置 填写,保存服务器信息后选择对应的拨号配置提交即可。
4.请点击下方添加节点提交设备信息,如有疑问,请加入官方群咨询二猫。
官方站点:
https://bonuscloud.work/

Windows 10数字权利获取工具HWIDGEN介绍及使用说明

日前在国外科技论坛有大神发布名为HWIDGEN激活工具,该激活工具几乎秒杀所有版本Windows 10系统。

我们知道Windows 10现在激活后会带有数字权利,数字权利可以在我们重装系统后自动激活无需再次激活。

而HWIDGEN激活工具正是直接获取数字激活权利进行永久激活,此方法激活后用户下次安装同样无需激活。

Windows 10数字权利获取工具HWIDGEN介绍及详细使用说明

先介绍使用再介绍原理:

下载由网友黯然 KING编写的简化脚本包: https://lancdn.ctfile.com/dir/18453279-30072124-2ea376/

由于借助该网友制作的脚本激活非常简单因此蓝点网不再赘述,具体直接以下面几张图片介绍整个激活流程。

注意事项 : 激活前电脑必须已经能够联网并且必须未禁用Windows Update服务,如已禁用请先开启该服务。

完整解压压缩包后右键点击Activation.CMD文件并选择使用管理员身份运行,然后会提示工具支持的版本。

接下来有几个选项默认情况下我们直接填写数字1来激活本机系统,输入后脚本自动工作联网获取数字权利。

最后执行完毕后脚本会提示你系统已经激活,至此激活完毕, 若前往系统激活选项会看到已经获得数字权利。

Windows 10数字权利获取工具HWIDGEN介绍及详细使用说明

Windows 10数字权利获取工具HWIDGEN介绍及详细使用说明

Windows 10数字权利获取工具HWIDGEN介绍及详细使用说明

Windows 10数字权利获取工具HWIDGEN介绍及详细使用说明

Windows 10数字权利获取工具HWIDGEN介绍及详细使用说明

HWIDGEN获得数字权利的激活原理:

说到激活原理自然先得继续介绍Windows 10系统的数字权利,所谓数字权利即与已系统绑定的激活许可证。

默认情况下当Windows 10被激活后会自动生成与硬件ID对应的许可证,该许可证会存储到微软的服务器上。

当系统重新安装时自动将硬件ID提交给微软检索对应的许可证,若许可证符合则系统自动激活无需用户操作。

至于 HWIDGEN 是如何通过修改系统内核数据来激活系统就是技术问题了,有兴趣的请看GitHub上的脚本

在激活系统后同时连接微软将硬件ID对应的许可证上传,最终对于用户来说系统在激活的瞬间就有数字权利。

本方法激活的系统没有任何副作用,如果你登录微软账号的话就会自动将数字许可证绑定到你的微软账号上。

当然不论是否登录账号都不会影响数字许可证,即下次重装系统输入对应版本的激活密钥后系统将自动激活。

http://www.pc9.com/pc/info-3892.html

打造自己的win10精简系统(超详细)

教你打造自己的win10精简系统(超详细)

2019/12/12 (Mail:1244180262@qq.com)

前言

近几年来微软对win10的推广策略层出不穷,甚至与 Intel联合宣布最新硬件不在支持Win7,以迫使用户向win10转移,但不得不承认win10系统性能各方面更优于win7系统。可是win10系统太多的自带软件,让我这种有洁癖的人很难受,我喜欢纯洁如处子般的系统——精简版系统。

那些网上下载的精简版,装在自己的电脑上,总让我感觉是穿了在路边捡来的别人的衣服,而且偶尔还能从衣兜里掏出不知道什么玩意儿的东西(比如,360全家桶,百度全家桶,毒霸,腾讯视频等等),这着实让人不舒服。

为此,我要打造属于我自己的win10精简系统,于是开始收集工具,整理资料,并记录如下

一、工具需求

1.MediaCreationTool

2.NTLite_setup_x64.exe

二、开始操作

1.工具和系统的获取

I.win10系统的获取
1.将下面链接复制到任意浏览器地址栏(微软官网链接,选系统,我相信官网)

https://www.microsoft.com/zh-cn/software-download/windows10/

网址界面,点击“立即下载工具”

教你打造自己的win10精简系统(超详细)
2.打开MediaCreationTool工具

点击“接受”

教你打造自己的win10精简系统(超详细)

点击“为另一台电脑创建安装介质(U盘、DVD、或IOS文件)”,并选择“下一步”

教你打造自己的win10精简系统(超详细)

或者

根据自己的需求,选择“语言”、“版本”、“体系结构” 或者直接选择 “对这台电脑使用推荐的选项” ,然后点击“下一步”

选择“IOS文件”,“下一步”

教你打造自己的win10精简系统(超详细)

这一步会让你选择下载系统保存的位置,选择好之后点击“保存”(为了操作方便,我直接保存在桌面了)

工具开始下载win10系统

image.png

下载完成后,工具会自动创建win10系统的安装介质

image.png

创建完成之后,直接点击“完成”即可

教你打造自己的win10精简系统(超详细)

桌面上(你自己选择的保存路径),就会的到一个win10的系统镜像。

image.png

新建一个文件夹

教你打造自己的win10精简系统(超详细)

双击win10镜像,

教你打造自己的win10精简系统(超详细)

打开之后,会看到镜像包含的文件

教你打造自己的win10精简系统(超详细)

将里面所有的文件都复制到,刚刚新建的文件夹(666文件夹)中。

II.精简工具的下载与安装
1.同样,复制下面的链接到浏览器地址栏

https://www.ntlite.com/download/

网页界面,有两个版本“Stable version(稳定版)” 和 “Beta version(测试版)”,这里建议使用稳定版的

教你打造自己的win10精简系统(超详细)
教你打造自己的win10精简系统(超详细)

根据自己的系统,下载64位或者32位的工具,我的系统是64位的

教你打造自己的win10精简系统(超详细)

下载完成后,找到工具,然后双击运行

教你打造自己的win10精简系统(超详细)

点击“我同意此协议”,然后就是傻瓜式的“下一步”、“下一步”的安装操作,这里就不一一演示了。

教你打造自己的win10精简系统(超详细)

安装完成后,打开界面如上

2.开始精简操作

1.初步精简(去除多余系统)
教你打造自己的win10精简系统(超详细)

打开精简工具,点击“添加”,选择“映像文件夹”

image.png

找到,你复制有win10镜像文件的文件夹,我的是“666”文件夹,点击“选择文件夹”

教你打造自己的win10精简系统(超详细)

镜像文件会被 精简工具解析,解析结果如上图

教你打造自己的win10精简系统(超详细)
教你打造自己的win10精简系统(超详细)

在我们不需要的项目上右击,然后“删除”

image.png

我喜欢专业版的,所以我只留了专业版,到这里我们只是去除了不需要的系统,下面我们开始对自己喜欢的系统进行更深度的精简,以便于我们更喜欢它。

2.深度精简(清除多余自带程序)
教你打造自己的win10精简系统(超详细)

鼠标右击自己喜欢的系统,点击”加载“(若无法直接加载系统,也可以加载install.esd文件)

教你打造自己的win10精简系统(超详细)

加载完成后,在左边栏就多了很多选项

a.“组件移除”部分的精简

点击“组件移除”,会弹出一个警告框,可以自行仔细阅读,然后点击“确定”

教你打造自己的win10精简系统(超详细)

接下来我们可以看到系统自带的组件,”IOS镜像“组件是不建议操作的

教你打造自己的win10精简系统(超详细)

Windows App“组件下的 ”Metro 应用“中大多数是可以去除的,去除方法就是把选项前面的 ” √ “ 取消勾选

教你打造自己的win10精简系统(超详细)

至于都对应了什么,有兴趣的同学可以去一一翻译过来看一下,我英语不好,就不在这里献丑了,同学们可以按需取舍。

教你打造自己的win10精简系统(超详细)
教你打造自己的win10精简系统(超详细)

“系统应用”组件下就是系统自带的应用,大家可以根据自己的喜好进行删除,其中“Window Defender”是系统自带的安全软件。不过它喜欢搞事情,比如它会清理掉你下载的盗版游戏啊、盗版软件啊、激活工具啊、破解工具什么的,所以你懂的。。。(呼吁,大家支持正版哈。。。),其他选项同样同学们可以按需取舍。

教你打造自己的win10精简系统(超详细)

Windows App“组件下的其他功能,同学们可以根据备注信息的说明,自由按需取舍。

教你打造自己的win10精简系统(超详细)

多媒体”组件下,我去除了“其他主题”和“墙纸”,其他选项同样同学们可以按需取舍。

教你打造自己的win10精简系统(超详细)

本地化”组件下的“语言”,我这边只保留了“简体中文”,其他选项同样同学们可以按需取舍。

教你打造自己的win10精简系统(超详细)

硬件支持”组件下,去除了“游戏周边”,其他选项同样同学们可以按需取舍。

教你打造自己的win10精简系统(超详细)

系统”、“网络”、“远程控制与隐私”和“驱动程序”四个组件小白的话不建议操作。

b.“配置”部分的精简
教你打造自己的win10精简系统(超详细)

这部分同学们可以根据每一项的备注信息,自由按需取舍,这里就不做赘述啦。

教你打造自己的win10精简系统(超详细)

其中,”设置“选项下的”预安装应用“记得禁用掉

c.”整合“部分
教你打造自己的win10精简系统(超详细)
教你打造自己的win10精简系统(超详细)

以上就是精简系统的步骤。

三、打包自己的系统

精简完毕后就可以打包自己的系统了

教你打造自己的win10精简系统(超详细)
教你打造自己的win10精简系统(超详细)
教你打造自己的win10精简系统(超详细)

点击”应用“,勾选”创建ISO“,会让你选择文件要保存的位置,选好位置点击”保存“,之后会让你给卷标命名

教你打造自己的win10精简系统(超详细)

卷标命名之后,就可以看到右下角的信息

教你打造自己的win10精简系统(超详细)

然后,点击工具右上角的”开始“

教你打造自己的win10精简系统(超详细)

选择”是“

教你打造自己的win10精简系统(超详细)

工具开始自动打包

教你打造自己的win10精简系统(超详细)

每一项完成之后

教你打造自己的win10精简系统(超详细)

就可以到你保存的路径内找到打包好的精简包了

作者:彩虹直至黑白_Joon
链接:https://www.jianshu.com/p/f09739925a4a
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

我不想当大明星

《我不想当大明星》

章节目录 第一章、恶魔系统

夜晚的小区里,左迁穿着一套运动服下了楼,他今年大学刚毕业,家里赶上了好时节,分了两套房子,一套在城北,一套在城南。

而他现在就住在城南这边,平时一个人住,打着出来工作的幌子,其实想着玩两个月游戏过足瘾再去找工作,理由都找好了。

这年头,找个工作哪有这么容易?

左迁乐滋滋的走向小区门口的小超市,这几天玩的那个叫爽快,平时在学校里可没这么自由,现在想怎么玩,就怎么玩。

正当他优哉游哉的走进超市。就这时,突然感觉一阵眩晕袭来。

哎呦~!妈耶!难道营养不良了?这可不成,明天买两斤排骨炖了补补!我可不想明天上新闻。

左迁站定了身子,揉了揉脑袋,眼睁开一瞧,顿时傻了。

原本是黑夜的,怎么变白天了?此时他正站在马路中间。天寒地冻的,马路边还隐隐有着一些雪,看来是下雪没几天。而他此时身上穿着短袖短裤的李宁运动服一套,冻的鼻涕直流。

一辆辆擦身而过的车,人行道指指点点的行人。左迁一脸懵逼样。此时一阵凉风袭来,冷的他鸡皮疙瘩都起来了,直打哆嗦。

我去!这尼玛什么情况啊?谁特么来解释一下?左迁脑子有些转不过弯来。

他双手抱着手臂,哆嗦的来到人行道,不明白为什么会这样。但先保住小命要紧。为了理解到底发生了什么,他哆嗦的举起手,勉强的挤出笑容对一个低头玩着手机的妹子招呼到,

“美女!这哪儿?”

那低头玩着手机的美女抬头一瞧,顿时一脸嫌弃的绕过了他。左迁那个郁闷啊!又一阵冷风吹来,冻得他打了个喷嚏,连忙跑到墙角落避避风先。他四处看了看,正巧见一家卖衣服的店,跑过去一看,虽然不知道啥牌子!呦!价格养眼噢!

左迁跑跑跳跳的跑进店里瞧了瞧,见一见黑色的大衣,只需要198只需要198。价格不贵!而且保暖,关键能裹住大半个腿肚子。

“老板,给我来这件,要最大号的。”

那导购员是个女的!长得还算漂亮。她打量了下左迁,差点没笑出来,她也没拿衣服,直接问道,“你有钱吗?”

左迁一听,顿时来火了。“啥意思啊?瞧不起人?什么眼神啊这是?我告你,今天不给我一个解释,还没完了!”

又一阵风刮进来,吹的左迁打哆嗦,他一把从口袋里掏出三张红票子,牛气哄哄的喝道:“这是什么?钱~!看到了没?还不赶紧给我拿衣服,傻站着那干啥?”

“我从来没见过这样的钱!”那导购此时眼神里已经流露出鄙夷了,她从口袋里掏出一张蓝色一百的,甩了甩,“这才是钱!你那钱,抱歉,我没见过,不收!哪里收你哪里用去!”

左迁懵逼了!怎么回事?这不对啊!他又连续跑了两家,都是不收这钱。

这个世界怎么了?怎么就突然变了?连钱也不一样了,左迁突然有些害怕了,对未知的恐惧。

就在这时,突然一个机械般的女人声音直接在左迁脑海里响起。

——恶魔系统开启,

http://www.it09.net/?action=read&book=%E6%88%91%E4%B8%8D%E6%83%B3%E5%BD%93%E5%A4%A7%E6%98%8E%E6%98%9F.html

中国,加油!China, come on!

转载一篇好文如下:

我们不理解6000万意大利人为什么不戴口罩就像他们不理解14亿中国人为什么都带口罩一样!
我们不理解3亿美国人喜欢在地下室存满食物就像美国人不理解14亿中国为什么会乖乖宅家一个月一样!
美国的医院都是私立的,检测一次新冠肺炎需要个人承担2000美元,美国CDC找药厂协商要求降低试剂价格,药厂说如果我们不赚钱,我们就不生产,中国政府告诉我们:免费!
美国记者追问副总统,没有买医疗保险的美国人感染新冠状病毒怎么办?副总统助理怒斥记者:对着镜头大声追问是什么都得不到的!中国政府告诉我们:免费!
韩国缺少隔离点,政府找到宾馆,宾馆说没门!政府只能出资买下,中国政府告诉我们:征用!
日本、意大利的疫区超市被抢购一空,连卫生纸都没有,中国政府告诉我们:送货上门!
我们静下心来想想,为什么美国建议普通人不戴口罩,只建议医护人员戴口罩,对新冠肺炎的致命性闭口不谈,坚决不做大规模检测?为什么意大利女议员因为戴口罩受奚落后被赶出会场,其他医院认为新冠病毒是夸大其词?是因为他们是傻×吗?不,是因为国情不同,设想一下,如果在一个游行示威合法、枪支买卖合法、言论自由的国家里,你的政府告诉你:“这个病很严重,必须带口罩,不带口罩就会死,而我们没有口罩”,会发生什么?能依靠什么?举个例子,2019年的法国大规模暴动中,法国警察罢工了!上周,韩国护士集体辞职了!
我们建火神山、雷神山、方舱医院、封城、封小区、14亿人响应国家号召宅在家,他们很羡慕,但是这些国家很清楚哪些是他们能做到的,哪些是他们做不到的,抹黑中国的声音也变得有气无力。
我们一直在讲政治自信,大家总是问什么是政治自信?总是觉得看不清摸不明,当疫情发生,对比全世界各个国家的反应后,你会由衷的感叹一声,辛亏我是中国人,这就是政治自信。
我们总是会抱怨我们的国家、我们的社会、我们的制度、我们的政策,这也不好,那也不好,但你终会发现,每到生死关头,这个你觉得土的掉渣的国家和一群身上画着红色五角星的人总会像你亲爹亲妈一样,狠狠的拉你一把。
最后引用世卫组织总干事高级顾问艾尔沃德的话:“如果我感染了,我希望在中国治疗。”

 

Reprint a good article as follows:

We don’t understand why 60 million Italians don’t wear masks just as they don’t understand why 1.4 billion Chinese wear masks!

We don’t understand that 300 million Americans like to store food in the basement just as Americans don’t understand why 1.4 billion Chinese people live in their homes for a month!

Novel coronavirus pneumonia is a private hospital. It takes 2000 dollars to detect a new crown pneumonia. The US CDC seeks consultation with pharmaceutical companies to reduce the price of reagents. The pharmaceutical factory says if we do not make money, we will not produce. China’s government tells us that it is free!

American reporters asked the vice president how to deal with the new coronavirus among Americans who did not buy medical insurance? The assistant vice president angrily scolded the reporter: ask the camera loudly what you can’t get! The Chinese government tells us: free!

South Korea is short of isolation points. The government finds hotels. Hotels say no way! The government can only pay for it. The Chinese government tells us: expropriation!

Supermarkets in epidemic areas in Japan and Italy were snapped up without toilet paper. The Chinese government told us: deliver to your door!

Novel coronavirus pneumonia is what the United States suggests. The general public recommends that the ordinary people not wear masks, but only suggest that the medical staff wear masks to silence the fatal nature of the new crown pneumonia and firmly refuse to do large-scale detection. Why are Italian Women Parliamentarians expelled from the meeting after being ridiculed for wearing masks? Other hospitals think the new coronavirus is exaggerated? Is it because they are stupid? No, it’s because of the different national conditions. Imagine what would happen if your government told you in a country where demonstrations are legal, guns are sold legally, and speech is free: “this disease is very serious. You have to wear masks. If you don’t wear masks, you will die, and we don’t have masks.”? What can I rely on? For example, in the massive riots in France in 2019, the French police went on strike! Last week, South Korean nurses resigned collectively!

We have built huoshenshan, leishenshan, fangcang hospital, Fengcheng, fengxiaoqu, and 1.4 billion people who respond to the call of the state to stay at home. They are envious, but these countries are very clear about what they can do, what they can’t do, and the voice of blackening China has become powerless.

We have been talking about political self-confidence. What is political self-confidence? I always feel that I can’t see clearly. When the epidemic happens, compare the reactions of countries all over the world, you will sincerely sigh that I am Chinese, which is political self-confidence.

We always complain about our country, our society, our system and our policies. This is not good, and that is not good. But you will find that, at the critical moment of life and death, this country and a group of people with red five pointed stars on it will always pull you like your parents.

“If I have an infection, I want to be treated in China,” he said