主頁 > 軟體設計 > 用虛擬機搭建iaas先電私有云平臺

用虛擬機搭建iaas先電私有云平臺

2020-10-03 03:20:17 軟體設計

搭建流程

    • 1.配置網路,主機名(雙節點)
    • 2.永久閉防火墻和selinux(雙節點)
    • 3.配置YUM源(雙節點)
    • 4.寫入/etc/fstab,并掛載鏡像
    • 5.安裝iaas相關軟體包
    • 6.劃分磁盤作為swift和cinder
    • 7.修改環境變數
    • 8.配置NTP服務
    • 9.通過腳本安裝服務
    • 10.通過IP訪問云平臺
    • 11.測驗
    • 12.附錄(用xshell連接虛擬機)

1.配置網路,主機名(雙節點)

controller:192.168.1.10 192.168.2.10
compute:192.168.1.20 192.168.2.20

controller配置:
[root@controller ~]# hostnamectl set-hostname controller
[root@controller ~]# logout
重連登錄
[root@controller ~]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777728 
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777728
UUID=33c092da-748f-4504-b735-d9dff2a49d33
DEVICE=eno16777728
ONBOOT=yes
IPADDR=192.168.1.10
PREFIX=24
GATEWAY=192.168.1.1

[root@controller ~]# cd /etc/sysconfig/network-scripts/
[root@controller network-scripts]# cp -a ifcfg-eno16777728 ifcfg-eno33554960
[root@controller network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-eno33554960 
DEVICE=eno33554960
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.2.10
PREFIX=24
[root@controller ~]# systemctl restart network
[root@controller ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    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: eno16777728: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:01:7e:b7 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.10/24 brd 192.168.1.255 scope global eno16777728
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe01:7eb7/64 scope link 
       valid_lft forever preferred_lft forever
3: eno33554960: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master ovs-system state UP qlen 1000
    link/ether 00:0c:29:01:7e:c1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.10/24 brd 192.168.2.255 scope global eno33554960
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe01:7ec1/64 scope link 
       valid_lft forever preferred_lft forever

關機直接克隆compute
compute配置:
[root@compute ~]# hostnamectl set-hostname compute
[root@compute ~]# logout
重連登錄
[root@compute ~]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777728 
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777728
UUID=33c092da-748f-4504-b735-d9dff2a49d33
DEVICE=eno16777728
ONBOOT=yes
IPADDR=192.168.1.20
PREFIX=24

[root@compute ~]# cd /etc/sysconfig/network-scripts/
[root@compute network-scripts]# cp -a ifcfg-eno16777728 ifcfg-eno33554960
[root@compute network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-eno33554960 
DEVICE=eno33554960
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.2.20
PREFIX=24
[root@compute ~]# systemctl restart network
[root@compute ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    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: eno16777728: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:01:7e:b7 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.20/24 brd 192.168.1.255 scope global eno16777728
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe01:7eb7/64 scope link 
       valid_lft forever preferred_lft forever
3: eno33554960: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master ovs-system state UP qlen 1000
    link/ether 00:0c:29:01:7e:c1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.20/24 brd 192.168.2.255 scope global eno33554960
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe01:7ec1/64 scope link 
       valid_lft forever preferred_lft forever

記得拉取兩個鏡像!!!(只需要在controller節點拉取)

2.永久閉防火墻和selinux(雙節點)

[root@controller yum.repos.d]# systemctl stop firewalld
[root@controller yum.repos.d]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.

[root@controller yum.repos.d]# setenforce 0
[root@controller yum.repos.d]# vi /etc/selinux/config 


# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 








[root@compute yum.repos.d]# systemctl stop firewalld
[root@compute yum.repos.d]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.

[root@compute yum.repos.d]# setenforce 0
[root@compute yum.repos.d]# vi /etc/selinux/config 


# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 

3.配置YUM源(雙節點)

配置主機名映射
[root@controller ~]# vi /etc/hosts
192.168.1.10 controller
192.168.1.20 compute
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

[root@compute ~]# vi /etc/hosts
192.168.1.10 controller
192.168.1.20 compute
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6


[root@controller ~]# cd /etc/yum.repos.d/
[root@controller yum.repos.d]# rm -rf *
[root@controller yum.repos.d]# cat local.repo 
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=file:///opt/iaas/iaas-repo
gpgcheck=0
enabled=1


[root@compute ~]# cd /etc/yum.repos.d/
[root@compute yum.repos.d]# rm -rf *
[root@compute yum.repos.d]# cat local.repo 
[centos]
name=centos
baseurl=ftp://controller/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=ftp://controller/iaas/iaas-repo
gpgcheck=0
enabled=1

4.寫入/etc/fstab,并掛載鏡像

[root@controller ~]# ls
anaconda-ks.cfg  CentOS-7-x86_64-DVD-1511.iso  XianDian-IaaS-v2.2.iso

[root@controller ~]# mkdir /opt/centos
[root@controller ~]# mkdir /opt/iaas

[root@controller ~]# cat /etc/fstab 

#
# /etc/fstab
# Created by anaconda on Thu Oct  1 06:46:45 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=36615874-b25f-4539-b376-8a5c387c0212 /                       xfs     defaults        0 0
UUID=02223747-779a-4b6d-a300-2774ec29a144 /boot                   xfs     defaults        0 0
UUID=01956b4a-500a-4f23-8b60-75b3bb457ded swap                    swap    defaults        0 0
/root/CentOS-7-x86_64-DVD-1511.iso        /opt/centos	          iso9660	defaults 0 0
/root/XianDian-IaaS-v2.2.iso              /opt/iaas	          iso9660	defaults 0 0


[root@controller ~]# mount -a
mount: /dev/loop0 is write-protected, mounting read-only
mount: /dev/loop1 is write-protected, mounting read-only

[root@controller ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        98G  7.6G   90G   8% /
devtmpfs        904M     0  904M   0% /dev
tmpfs           913M     0  913M   0% /dev/shm
tmpfs           913M  8.5M  904M   1% /run
tmpfs           913M     0  913M   0% /sys/fs/cgroup
/dev/sda1       497M  118M  380M  24% /boot
tmpfs           183M     0  183M   0% /run/user/0
/dev/loop0      4.1G  4.1G     0 100% /opt/centos
/dev/loop1      2.7G  2.7G     0 100% /opt/iaas


[root@controller ~]# yum list
[root@controller ~]# yum install -y vim
[root@controller ~]# yum install -y vsftpd
[root@controller ~]# cat /etc/vsftpd/vsftpd.conf (在第一行添加下面內容,點點不用寫)
anon_root=/opt/
...
...
[root@controller ~]# systemctl restart vsftpd
[root@controller ~]# systemctl enable vsftpd
Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.

5.安裝iaas相關軟體包

[root@controller ~]# yum install -y iaas-xiandian
[root@compute ~]# yum install -y iaas-xiandian

6.劃分磁盤作為swift和cinder

[root@computer ~]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0002f10c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     4196351     2097152   82  Linux swap / Solaris
/dev/sda2   *     4196352    41943039    18873344   83  Linux

Disk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@computer ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xa5eb8d25.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): 
Using default response p
Partition number (1-4, default 1): 
First sector (2048-209715199, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199): +30G
Partition 1 of type Linux and of size 30 GiB is set

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): 
Using default response p
Partition number (2-4, default 2): 
First sector (62916608-209715199, default 62916608): 
Using default value 62916608
Last sector, +sectors or +size{K,M,G} (62916608-209715199, default 209715199): +30G
Partition 2 of type Linux and of size 30 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

[root@computer ~]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0002f10c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     4196351     2097152   82  Linux swap / Solaris
/dev/sda2   *     4196352    41943039    18873344   83  Linux

Disk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xa5eb8d25

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    62916607    31457280   83  Linux
/dev/sdb2        62916608   125831167    31457280   83  Linux
[root@compute ~]# mkfs.xfs /dev/sdb1
[root@compute ~]# mkfs.xfs /dev/sdb2

7.修改環境變數

[root@controller ~]# cat /etc/xiandian/openrc.sh
cat /etc/xiandian/openrc.sh
##--------------------system Config--------------------##
##Controller Server Manager IP. example:x.x.x.x
HOST_IP=192.168.1.10

##Controller Server hostname. example:controller
HOST_NAME=controller

##Compute Node Manager IP. example:x.x.x.x
HOST_IP_NODE=192.168.1.20

##Compute Node hostname. example:compute
HOST_NAME_NODE=compute

##--------------------Rabbit Config ------------------##
##user for rabbit. example:openstack
RABBIT_USER=openstack

##Password for rabbit user .example:000000
RABBIT_PASS=a

##--------------------MySQL Config---------------------##
##Password for MySQL root user . exmaple:000000
DB_PASS=a

##--------------------Keystone Config------------------##
##Password for Keystore admin user. exmaple:000000
DOMAIN_NAME=lyb
ADMIN_PASS=a
DEMO_PASS=a

##Password for Mysql keystore user. exmaple:000000
KEYSTONE_DBPASS=a

##--------------------Glance Config--------------------##
##Password for Mysql glance user. exmaple:000000
GLANCE_DBPASS=a

##Password for Keystore glance user. exmaple:000000
GLANCE_PASS=a

##--------------------Nova Config----------------------##
##Password for Mysql nova user. exmaple:000000
NOVA_DBPASS=a

##Password for Keystore nova user. exmaple:000000
NOVA_PASS=a

##--------------------Neturon Config-------------------##
##Password for Mysql neutron user. exmaple:000000
NEUTRON_DBPASS=a

##Password for Keystore neutron user. exmaple:000000
NEUTRON_PASS=a

##metadata secret for neutron. exmaple:000000
METADATA_SECRET=a

##External Network Interface. example:eth1
INTERFACE_NAME=eno33554960

##First Vlan ID in VLAN RANGE for VLAN Network. exmaple:101
#minvlan=

##Last Vlan ID in VLAN RANGE for VLAN Network. example:200
#maxvlan=

##--------------------Cinder Config--------------------##
##Password for Mysql cinder user. exmaple:000000
CINDER_DBPASS=a

##Password for Keystore cinder user. exmaple:000000
CINDER_PASS=a

##Cinder Block Disk. example:md126p3
BLOCK_DISK=/dev/sdb1

##--------------------Trove Config--------------------##
##Password for Mysql Trove User. exmaple:000000
TROVE_DBPASS=a

##Password for Keystore Trove User. exmaple:000000
TROVE_PASS=a

##--------------------Swift Config---------------------##
##Password for Keystore swift user. exmaple:000000
SWIFT_PASS=a

##The NODE Object Disk for Swift. example:md126p4.
OBJECT_DISK=/dev/sdb2

##The NODE IP for Swift Storage Network. example:x.x.x.x.
STORAGE_LOCAL_NET_IP=192.168.1.20

##--------------------Heat Config----------------------##
##Password for Mysql heat user. exmaple:000000
HEAT_DBPASS=a

##Password for Keystore heat user. exmaple:000000
HEAT_PASS=a

##--------------------Ceilometer Config----------------##
##Password for Mysql ceilometer user. exmaple:000000
CEILOMETER_DBPASS=a

##Password for Keystore ceilometer user. exmaple:000000
CEILOMETER_PASS=a

##--------------------AODH Config----------------##
##Password for Mysql AODH user. exmaple:000000
AODH_DBPASS=a

##Password for Keystore AODH user. exmaple:000000
AODH_PASS=a

[root@controller ~]# scp /etc/xiandian/openrc.sh root@compute:/etc/xiandian/openrc.sh

8.配置NTP服務

安裝ntp服務(時間同步)1)controller和compute節點
[root@controller ~]# yum -y install ntp
(2)配置controller節點
[root@controller ~]# vim /etc/ntp.conf
添加以下內容(洗掉默認sever規則)
server 127.127.1.0
fudge 127.127.1.0   stratum 10

[root@controller ~]# systemctl restart ntpd
[root@controller ~]# systemctl enable ntpd
Created symlink from /etc/systemd/system/multi-user.target.wants/ntpd.service to /usr/lib/systemd/system/ntpd.service.3)配置compute節點
[root@compute ~]# yum install -y ntp
[root@compute ~]# ntpdate controller
 1 Oct 08:36:16 ntpdate[2255]: adjust time server 192.168.1.10 offset -0.229334 sec
[root@compute ~]# systemctl enable ntpd
Created symlink from /etc/systemd/system/multi-user.target.wants/ntpd.service to /usr/lib/systemd/system/ntpd.service.

9.通過腳本安裝服務

控制節點

iaas-pre-host.sh
reboot
iaas-install-mysql.sh
iaas-install-keystone.sh
iaas-install-glance.sh
iaas-install-nova-controller.sh
iaas-install-neutron-controller.sh
iaas-install-neutron-controller-gre.sh
iaas-install-dashboard.sh

計算節點
iaas-pre-host.sh
reboot
iaas-install-nova-compute.sh
iaas-install-neutron-compute.sh
iaas-install-neutron-compute-gre.sh

10.通過IP訪問云平臺

http://192.168.1.10/dashboard

11.測驗

在這里插入圖片描述
登錄會有點卡
在這里插入圖片描述

12.附錄(用xshell連接虛擬機)

怎么用XSHELL連接虛擬機?
統一用橋接模式
1.查看本地wife屬型(可以看出本地wife是192.168.1.0網段)
在這里插入圖片描述
我拿controller節點舉例子
1.設定網卡模式為橋接模式
在這里插入圖片描述
2.配置IP和wife網段一致
也就是192.168.1.0網段
在這里插入圖片描述
3.用xshell進行連接
在這里插入圖片描述
4.連接成功
在這里插入圖片描述

完成啦,記得一鍵三連哦!

轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/150066.html

標籤:其他

上一篇:mac由于斷網導致accountsd行程占用cpu過高以及軟體打不開的問題

下一篇:Ubuntu獲取root權限

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 面試突擊第一季,第二季,第三季

    第一季必考 https://www.bilibili.com/video/BV1FE411y79Y?from=search&seid=15921726601957489746 第二季分布式 https://www.bilibili.com/video/BV13f4y127ee/?spm_id_fro ......

    uj5u.com 2020-09-10 05:35:24 more
  • 第三單元作業總結

    1.前言 這應該是本學期最后一次寫作業總結了吧。總體來說,對作業的節奏也差不多掌握了,作業做起來的效率也更高了。雖然和之前的作業一樣,作業中都要用到新的知識,但是相比之前,更加懂得了如何利用工具以及資料。雖然之間卡過殼,但總體而言,這幾次作業還算完成的比較好。 2.作業程序總結 相比前兩個單元,此單 ......

    uj5u.com 2020-09-10 05:35:41 more
  • 北航OO(2020)第四單元博客作業暨課程總結博客

    北航OO(2020)第四單元博客作業暨課程總結博客 本單元作業的架構設計 在本單元中,由于UML圖具有比較清晰的樹形結構,因此我對其中需要進行查詢操作的元素進行了包裝,在樹的父節點中存盤所有孩子的參考。考慮到性能問題,我采用了快取機制,一次查詢后盡可能快取已經遍歷過的資訊,以減少遍歷次數。 本單元我 ......

    uj5u.com 2020-09-10 05:35:48 more
  • BUAA_OO_第四單元

    一、UML決議器設計 ? 先看下題目:第四單元實作一個基于JDK 8帶有效性檢查的UML(Unified Modeling Language)類圖,順序圖,狀態圖分析器 MyUmlInteraction,實際上我們要建立一個有向圖模型,UML中的物件(元素)可能與同級元素連接,也可與低級元素相連形成 ......

    uj5u.com 2020-09-10 05:35:54 more
  • 6.1邏輯運算子

    邏輯運算子 1. && 短路與 運算式1 && 運算式2 01.運算式1為true并且運算式2也為true 整體回傳為true 02.運算式1為false,將不會執行運算式2 整體回傳為false 03.只要有一個運算式為false 整體回傳為false 2. || 短路或 運算式1 || 運算式2 ......

    uj5u.com 2020-09-10 05:35:56 more
  • BUAAOO 第四單元 & 課程總結

    1. 第四單元:StarUml檔案決議 本單元采用了圖模型決議UML。 UML檔案可以抽象為圖、子圖、邊的邏輯結構。 在實作中,圖的節點包括類、介面、屬性,子圖包括狀態圖、順序圖等。 采用了三次遍歷UML元素的方法建圖,第一遍遍歷建點,第二、三次遍歷設定屬性、連邊,實作圖物件的初始化。這里借鑒了一些 ......

    uj5u.com 2020-09-10 05:36:06 more
  • 談談我對C# 多型的理解

    面向物件三要素:封裝、繼承、多型。 封裝和繼承,這兩個比較好理解,但要理解多型的話,可就稍微有點難度了。今天,我們就來講講多型的理解。 我們應該經常會看到面試題目:請談談對多型的理解。 其實呢,多型非常簡單,就一句話:呼叫同一種方法產生了不同的結果。 具體實作方式有三種。 一、多載 多載很簡單。 p ......

    uj5u.com 2020-09-10 05:36:09 more
  • Python 資料驅動工具:DDT

    背景 python 的unittest 沒有自帶資料驅動功能。 所以如果使用unittest,同時又想使用資料驅動,那么就可以使用DDT來完成。 DDT是 “Data-Driven Tests”的縮寫。 資料:http://ddt.readthedocs.io/en/latest/ 使用方法 dd. ......

    uj5u.com 2020-09-10 05:36:13 more
  • Python里面的xlrd模塊詳解

    那我就一下面積個問題對xlrd模塊進行學習一下: 1.什么是xlrd模塊? 2.為什么使用xlrd模塊? 3.怎樣使用xlrd模塊? 1.什么是xlrd模塊? ?python操作excel主要用到xlrd和xlwt這兩個庫,即xlrd是讀excel,xlwt是寫excel的庫。 今天就先來說一下xl ......

    uj5u.com 2020-09-10 05:36:28 more
  • 當我們創建HashMap時,底層到底做了什么?

    jdk1.7中的底層實作程序(底層基于陣列+鏈表) 在我們new HashMap()時,底層創建了默認長度為16的一維陣列Entry[ ] table。當我們呼叫map.put(key1,value1)方法向HashMap里添加資料的時候: 首先,呼叫key1所在類的hashCode()計算key1 ......

    uj5u.com 2020-09-10 05:36:38 more
最新发布
  • 【中介者設計模式詳解】C/Java/JS/Go/Python/TS不同語言實作

    * 中介者模式是一種行為型設計模式,它可以用來減少類之間的直接依賴關系,
    * 將物件之間的通信封裝到一個中介者物件中,從而使得各個物件之間的關系更加松散。
    * 在中介者模式中,物件之間不再直接相互互動,而是通過中介者來中轉訊息。 ......

    uj5u.com 2023-04-20 08:20:47 more
  • 露天煤礦現場調研和交流案例分享

    他們集團的資訊化公司及研究院在一個礦區正在做智能礦山的統一平臺的 試點,專案投資大概1億,包括了礦山的各方面的內容,顯示得我們這次交流有點多余。他們2年前開始做智能礦山的規劃,有很多煤礦行業專家的加持,他們的描述是非常完美,但是去年底應該上線的平臺,現在還沒有看到影子。他們確實有很多場景需求,但是被... ......

    uj5u.com 2023-04-20 08:20:25 more
  • 《社區人員管理》實戰案例設計&個人案例分享

    設計是一個讓人夢想成真程序,開始編碼、測驗、除錯之前進行需求分析和架構設計,才能保證關鍵方面都做正確 ......

    uj5u.com 2023-04-20 08:20:17 more
  • 軟體架構生態化-多角色交付的探索實踐

    作為一個技術架構師,不僅僅要緊跟行業技術趨勢,還要結合研發團隊現狀及痛點,探索新的交付方案。在日常中,你是否遇到如下問題 “ 業務需求排期長研發是瓶頸;非研發角色感受不到研發技改提效的變化;引入ISV 團隊又擔心質量和安全,培訓周期長“等等,基于此我們探索了一種新的技術體系及交付方案來解決如上問題。 ......

    uj5u.com 2023-04-20 08:20:10 more
  • 【中介者設計模式詳解】C/Java/JS/Go/Python/TS不同語言實作

    * 中介者模式是一種行為型設計模式,它可以用來減少類之間的直接依賴關系,
    * 將物件之間的通信封裝到一個中介者物件中,從而使得各個物件之間的關系更加松散。
    * 在中介者模式中,物件之間不再直接相互互動,而是通過中介者來中轉訊息。 ......

    uj5u.com 2023-04-20 08:19:44 more
  • 露天煤礦現場調研和交流案例分享

    他們集團的資訊化公司及研究院在一個礦區正在做智能礦山的統一平臺的 試點,專案投資大概1億,包括了礦山的各方面的內容,顯示得我們這次交流有點多余。他們2年前開始做智能礦山的規劃,有很多煤礦行業專家的加持,他們的描述是非常完美,但是去年底應該上線的平臺,現在還沒有看到影子。他們確實有很多場景需求,但是被... ......

    uj5u.com 2023-04-20 08:19:07 more
  • 《社區人員管理》實戰案例設計&個人案例分享

    設計是一個讓人夢想成真程序,開始編碼、測驗、除錯之前進行需求分析和架構設計,才能保證關鍵方面都做正確 ......

    uj5u.com 2023-04-20 08:18:57 more
  • 軟體架構生態化-多角色交付的探索實踐

    作為一個技術架構師,不僅僅要緊跟行業技術趨勢,還要結合研發團隊現狀及痛點,探索新的交付方案。在日常中,你是否遇到如下問題 “ 業務需求排期長研發是瓶頸;非研發角色感受不到研發技改提效的變化;引入ISV 團隊又擔心質量和安全,培訓周期長“等等,基于此我們探索了一種新的技術體系及交付方案來解決如上問題。 ......

    uj5u.com 2023-04-20 08:18:49 more
  • 05單件模式

    #經典的單件模式 public class Singleton { private static Singleton uniqueInstance; //一個靜態變數持有Singleton類的唯一實體。 // 其他有用的實體變數寫在這里 //構造器宣告為私有,只有Singleton可以實體化這個類! ......

    uj5u.com 2023-04-19 08:42:51 more
  • 【架構與設計】常見微服務分層架構的區別和落地實踐

    軟體工程的方方面面都遵循一個最基本的道理:沒有銀彈,架構分層模型更是如此,每一種都有各自優缺點,所以請根據不同的業務場景,并遵循簡單、可演進這兩個重要的架構原則選擇合適的架構分層模型即可。 ......

    uj5u.com 2023-04-19 08:42:41 more