000000

[root@controller ~]# source /etc/keystone/admin-openrc.sh

Zookeeper集群(40分)
使用提供的三台虚拟机和软件包,完成Zookeeper集群的安装与配置,配置完成后,在相应的目录使用./zkServer.sh status命令查看三个Zookeeper节点的状态,将三个节点的状态以文本形式提交到答题框。

[root@xiandian ~]# hostnamectl set-hostname zookeeper1
[root@xiandian ~]# bash
[root@zookeeper1 ~]# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.10    zookeeper1
192.168.1.20    zookeeper2
192.168.1.30    zookeeper3
[root@zookeeper1 ~]# vim /etc/yum.repos.d/local.repo 
[centos]
name=centos
baseurl=file:///opt/centos
enabled=1
gpgcheck=0
[gpmall]
name=gpmall
baseurl=file:///opt/gpmall-repo
enabled=1
gpgcheck=0
[root@zookeeper1 ~]# yum repolist
[root@zookeeper1 ~]# yum install -y vsftpd
[root@zookeeper1 ~]# vim /etc/vsftpd/vsftpd.conf 
[root@zookeeper1 ~]# systemctl restart vsftpd
[root@zookeeper1 ~]# yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
[root@zookeeper1 ~]# java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
[root@zookeeper1 ~]# tar -zvxf zookeeper-3.4.14.tar.gz
[root@zookeeper1 ~]# cd zookeeper-3.4.14/conf/
[root@zookeeper1 conf]# mv zoo_sample.cfg zoo.cfg
[root@zookeeper1 conf]# vim zoo.cfg 
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
server.1=192.168.1.10:2888:3888
server.2=192.168.1.20:2888:3888
server.3=192.168.1.30:2888:3888
[root@zookeeper1 conf]# grep -n '^'[a-Z] zoo.cfg 
2:tickTime=2000
5:initLimit=10
8:syncLimit=5
12:dataDir=/tmp/zookeeper
14:clientPort=2181
29:server.1=192.168.1.10:2888:3888
30:server.2=192.168.1.20:2888:3888
31:server.3=192.168.1.30:2888:3888
[root@zookeeper1 conf]# cd 
[root@zookeeper1 ~]# mkdir /tmp/zookeeper
[root@zookeeper1 ~]# vim /tmp/zookeeper/myid
1
[root@zookeeper1 ~]# cat /tmp/zookeeper/myid 
1
[root@zookeeper1 ~]# cd zookeeper-3.4.14/bin/
[root@zookeeper1 bin]# ./zkServer.sh start
zookeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@zookeeper1 bin]# ./zkServer.sh status
zookeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: follower


[root@xiandian ~]# hostnamectl set-hostname zookeeper2
[root@xiandian ~]# bash
[root@zookeeper2 ~]# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.10    zookeeper1
192.168.1.20    zookeeper2
192.168.1.30    zookeeper3
[root@zookeeper2 ~]# vim /etc/yum.repos.d/local.repo 
[centos]
name=centos
baseurl=file:///opt/centos
enabled=1
gpgcheck=0
[gpmall]
name=gpmall
baseurl=ftp://zookeeper1/gpmall-repo
enabled=1
gpgcheck=0
[root@zookeeper2 ~]# yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
[root@zookeeper2 ~]# java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
[root@zookeeper2 ~]# tar -zvxf zookeeper-3.4.14.tar.gz
[root@zookeeper2 ~]# cd zookeeper-3.4.14/conf/
[root@zookeeper2 conf]# mv zoo_sample.cfg zoo.cfg
[root@zookeeper2 conf]# vim zoo.cfg 
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
server.1=192.168.1.10:2888:3888
server.2=192.168.1.20:2888:3888
server.3=192.168.1.30:2888:3888
[root@zookeeper2 conf]# grep -n '^'[a-Z] zoo.cfg 
2:tickTime=2000
5:initLimit=10
8:syncLimit=5
12:dataDir=/tmp/zookeeper
14:clientPort=2181
29:server.1=192.168.1.10:2888:3888
30:server.2=192.168.1.20:2888:3888
31:server.3=192.168.1.30:2888:3888
[root@zookeeper2 conf]# cd 
[root@zookeeper2 ~]# mkdir /tmp/zookeeper
[root@zookeeper2 ~]# vim /tmp/zookeeper/myid
2
[root@zookeeper1 ~]# cat /tmp/zookeeper/myid 
2
[root@zookeeper2 ~]# cd zookeeper-3.4.14/bin/
[root@zookeeper2 bin]# ./zkServer.sh start
zookeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@zookeeper2 bin]# ./zkServer.sh status
zookeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: leader

[root@xiandian ~]# hostnamectl set-hostname zookeeper3
[root@xiandian ~]# bash
[root@zookeeper3 ~]# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.10    zookeeper1
192.168.1.20    zookeeper2
192.168.1.30    zookeeper3
[root@zookeeper3 ~]# vim /etc/yum.repos.d/local.repo 
[centos]
name=centos
baseurl=file:///opt/centos
enabled=1
gpgcheck=0
[gpmall]
name=gpmall
baseurl=ftp://zookeeper1/gpmall-repo
enabled=1
gpgcheck=0
[root@zookeeper3 ~]# yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
[root@zookeeper3 ~]# java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
[root@zookeeper3 ~]# tar -zvxf zookeeper-3.4.14.tar.gz
[root@zookeeper3 ~]# cd zookeeper-3.4.14/conf/
[root@zookeeper3 conf]# mv zoo_sample.cfg zoo.cfg
[root@zookeeper3 conf]# vim zoo.cfg 
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
server.1=192.168.1.10:2888:3888
server.2=192.168.1.20:2888:3888
server.3=192.168.1.30:2888:3888
[root@zookeeper3 conf]# grep -n '^'[a-Z] zoo.cfg 
2:tickTime=2000
5:initLimit=10
8:syncLimit=5
12:dataDir=/tmp/zookeeper
14:clientPort=2181
29:server.1=192.168.1.10:2888:3888
30:server.2=192.168.1.20:2888:3888
31:server.3=192.168.1.30:2888:3888
[root@zookeeper3 conf]# cd 
[root@zookeeper3 ~]# mkdir /tmp/zookeeper
[root@zookeeper3 ~]# vim /tmp/zookeeper/myid
3
[root@zookeeper3 ~]# cat /tmp/zookeeper/myid 
3
[root@zookeeper3 ~]# cd zookeeper-3.4.14/bin/
[root@zookeeper3 bin]# ./zkServer.sh start
zookeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@zookeeper3 bin]# ./zkServer.sh status
zookeeper JMX enabled by default
Using config: /root/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: follower

Kafka集群(40分)
使用提供的三台虚拟机和软件包,完成Kafka集群的安装与配置,配置完成后,在相应的目录使用 ./kafka-topics.sh --create --zookeeper 你的IP:2181 --replication-factor 1 --partitions 1 --topic test创建topic,将输入命令后的返回结果以文本形式提交到答题框。

将kafka_2.11-1.1.1.tgz上传至三个节点:(可以在上体的基础上做kafka,因为kafka依赖于zookeeper)


[root@zookeeper1 ~]# tar -zvxf kafka_2.11-1.1.1.tgz
[root@zookeeper1 ~]# cd kafka_2.11-1.1.1/config/
[root@zookeeper1 config]# vim server.properties
#broker.id=0
#zookeeper.connect=localhost:2181
broker.id = 1
zookeeper.connect = 192.168.1.10:2181,192.168.1.20:2181,192.168.1.30:2181
listeners = PLAINTEXT://192.168.1.10:9092
 
[root@zookeeper1 config]# cd /root/kafka_2.11-1.1.1/bin/
[root@zookeeper1 bin]# ./kafka-server-start.sh -daemon ../config/server.properties 
[root@zookeeper1 bin]# jps
17645 QuorumPeerMain
18029 Kafka
18093 Jps
[root@zookeeper1 bin]# ./kafka-topics.sh --create --zookeeper 192.168.1.10:2181 --replication-factor 1 --partitions 1 --topic test
Created topic "test".
[root@zookeeper1 bin]# ./kafka-topics.sh --list --zookeeper 192.168.1.10:2181
test


[root@zookeeper2 ~]# tar -zvxf kafka_2.11-1.1.1.tgz
[root@zookeeper2 ~]# cd kafka_2.11-1.1.1/config/
[root@zookeeper2 config]# vim server.properties
#broker.id=0
#zookeeper.connect=localhost:2181
broker.id = 2
zookeeper.connect = 192.168.1.10:2181,192.168.1.20:2181,192.168.1.30:2181
listeners = PLAINTEXT://192.168.1.20:9092
 
[root@zookeeper2config]# cd /root/kafka_2.11-1.1.1/bin/
[root@zookeeper2 bin]# ./kafka-server-start.sh -daemon ../config/server.properties 
[root@zookeeper2 bin]# jps
3573 Kafka
3605 Jps
3178 QuorumPeerMain
[root@zookeeper2 bin]# ./kafka-topics.sh --list --zookeeper 192.168.1.20:2181
test

[root@zookeeper3 ~]# tar -zvxf kafka_2.11-1.1.1.tgz
[root@zookeeper3 ~]# cd kafka_2.11-1.1.1/config/
[root@zookeeper3 config]# vim server.properties
#broker.id=0
#zookeeper.connect=localhost:2181
broker.id = 3
zookeeper.connect = 192.168.1.10:2181,192.168.1.20:2181,192.168.1.30:2181
listeners = PLAINTEXT://192.168.1.30:9092
 
[root@zookeeper3 config]# cd /root/kafka_2.11-1.1.1/bin/
[root@zookeeper3 bin]# ./kafka-server-start.sh -daemon ../config/server.properties 
[root@zookeeper3 bin]# jps 
3904 QuorumPeerMain
4257 Kafka
4300 Jps
[root@zookeeper3 bin]# ./kafka-topics.sh --list --zookeeper 192.168.1.30:2181
test


Neutron服务运维(40分)
使用提供的“all-in-one”虚拟机,使用Neutron命令,查询网络服务的列表信息中的“binary”一列,并且查询网络sharednet1详细信息。然后查询网络服务DHCP agent的详细信息。将以上操作命令及结果以文本形式填入答题框

[root@xiandian ~]# neutron agent-list -c binary
+---------------------------+
| binary |
+---------------------------+
| neutron-l3-agent |
| neutron-openvswitch-agent |
| neutron-dhcp-agent |
| neutron-metadata-agent |
+---------------------------+
[root@xiandian ~]# neutron net-list
+--------------------------------------+------------+---------+
| id | name | subnets |
+--------------------------------------+------------+---------+
| bd923693-d9b1-4094-bd5b-22a038c44827 | sharednet1 | |
+--------------------------------------+------------+---------+
# neutron net-show bd923693-d9b1-4094-bd5b-22a038c44827
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| availability_zone_hints | |
| availability_zones | |
| created_at | 2023-12-07T10:58:17 |
| description | |
| id | bd923693-d9b1-4094-bd5b-22a038c44827 |
| ipv4_address_scope | |
| ipv6_address_scope | |
| mtu | 1500 |
| name | sharednet1 |
| port_security_enabled | True |
| provider:network_type | flat |
| provider:physical_network | physnet1 |
| provider:segmentation_id | |
| router:external | False |
| shared | True |
| status | ACTIVE |
| subnets | |
| tags | |
| tenant_id | 20b1ab08ea644670addb52f6d2f2ed61 |
| updated_at | 2023-12-07T10:58:17 |
+---------------------------+--------------------------------------+
[root@xiandian ~]# neutron agent-list
+-----------+----------------+----------+-------------------+-------+-------------------+--------------+
| id | agent_type | host | availability_zone | alive | admin_state_up | binary |
+-----------+----------------+----------+-------------------+-------+-------------------+--------------+
| 7dd3ea38-c6fc-4a73-a530-8b007afeb778 | L3 agent | xiandian | nova | :-) | True | neutron-l3-agent |
| 8c0781e7-8b3e-4c9f-a8da-0d4cdc570afb | Open vSwitch agent | xiandian | | :-) | True | neutron-openvswitch-agent |
| a3504292-e108-4ad1-ae86-42ca9ccfde78 | DHCP agent | xiandian | nova | :-) | True | neutron-dhcp-agent |
| be17aa73-deba-411a-ac10-fd523079085d | Metadata agent | xiandian | | :-) | True | neutron-metadata-agent |
+-----------+----------------+----------+-------------------+-------+-------------------+--------------+
[root@xiandian ~]# neutron agent-show a3504292-e108-4ad1-ae86-42ca9ccfde78
+---------------------+----------------------------------------------------------+
| Field | Value |
+---------------------+----------------------------------------------------------+
| admin_state_up | True |
| agent_type | DHCP agent |
| alive | True |
| availability_zone | nova |
| binary | neutron-dhcp-agent |
| configurations | { |
| | "subnets": 1, |
| | "dhcp_lease_duration": 86400, |
| | "dhcp_driver": "neutron.agent.linux.dhcp.Dnsmasq", |
| | "networks": 1, |
| | "log_agent_heartbeats": false, |
| | "ports": 2 |
| | } |
| created_at | 2023-12-07 11:00:05 |
| description | |
| heartbeat_timestamp | 2023-12-07 11:12:23 |
| host | xiandian |
| id | a3504292-e108-4ad1-ae86-42ca9ccfde78 |
| started_at | 2023-12-07 11:12:36 |
| topic | dhcp_agent |
+---------------------+----------------------------------------------------------+

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值