Chinaunix首页 | 论坛 | 博客
  • 博客访问: 753216
  • 博文数量: 230
  • 博客积分: 6330
  • 博客等级: 准将
  • 技术积分: 2188
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-10 15:55
个人简介

脚踏实地

文章分类

全部博文(230)

文章存档

2017年(1)

2016年(7)

2015年(10)

2014年(32)

2013年(24)

2012年(33)

2011年(50)

2010年(30)

2009年(43)

分类: 云计算

2017-01-08 23:52:01

1.  准备工作
@配置文件
local.conf 和.localrc.auto 和 stackrc
GIT_BASE 选github优于openstack.org
GIT_BASE=
NOVNC_REPO=
SPICE_REPO=


@GNUTLS很是烦人,不定期出现。

调整:
×××××1:
Additional error details:
fatal: unable to access ‘/angular/bower-angular-animate.git/‘: GnuTLS recv error (-9): A TLS packet with unexpected length was received.

解决办法:git config --global url."https://".insteadOf git://


×××××2:
调整MTU
cat /sys/class/net/enp0s3/mtu                                                        
1300

git的版本在/usr/libexec/git-core下也有一个,最好用2.7.0

@@@sudo chmod 777 /var/run/screen

+./stack.sh:main:986                       screen -d -m -S stack -t shell -s /bin/bash
2017-01-21 15:12:41.103 | Directory '/var/run/screen' must have mode 777.

@@@ devstack会自动升级git
需要注释掉apt_get install "$@"
 function real_install_package {
     if is_ubuntu; then
#        apt_get install "$@"


@@@ 修改16.7到16.8 否则keystone编译不通过
stack@terry-VirtualBox:/opt/stack/requirements$ git diff
diff --git a/upper-constraints.txt b/upper-constraints.txt
index 5671755..96653b7 100644
--- a/upper-constraints.txt
+++ b/upper-constraints.txt
@@ -232,7 +232,7 @@ osprofiler===1.4.0
 ovs===2.5.0;python_version=='2.7'
 ovs===2.6.0.dev3;python_version=='3.4'
 ovs===2.6.0.dev3;python_version=='3.5'
-packaging===16.7
+packaging===16.8
 paramiko===2.0.2
 passlib===1.6.5
 pathlib===1.0.1;python_version=='2.7'

@@@n-cpu显示failed to start

在functions-common文件中的sg前面加上sudo
ENABLED_SERVICES+=,n-api,n-cpu,n-cond,n-sch,n-novnc,n-cauth
1560     if [[ -n "$group" ]]; then
1561         command="sudo sg $group '$command'"
1562     fi


----
因为在 /opt/stack/logs ? cat n-cpu.log                 
|| echo "n-cpu failed to start" | tee "/opt/stack/status/stack/n-cpu.failure"fg  
[1] 24659
sg libvirtd '/usr/local/bin/nova-compute --config-file /etc/nova/nova.conf'
setgid: Operation not permitted
n-cpu failed to start

会发现是由于sg命令引起的,/usr/local/bin/的用户和用户组都是root所以没有权限修改他的group id

@@@ magmum-ui检查一下是不是已经在stable/newton上面了?
默认是master

@@@ubuntu的cloud init脚本
#cloud-config
chpasswd:
  list: |
    root:r00tme
    guest:r00tme
  expire: False

@@@VNC无法输入的问题
 was able to work around it by using an older version of noVNC. go to /opt/stack/noVNC and do a git checkout v0.6.0. Then reload the the console for the instance.

Alternatively you can add NOVNC_BRANCH=v0.6.0 to your local.conf file, and restack.

@@@ 重启其中的服务比如neutron
kill 掉进程,然后用下面的服务相应的pts重新拉起服务
http://stackoverflow.com/questions/24725051/execute-a-command-in-another-terminal-via-dev-pts

代码保存后,gcc exe_pts.c -o exe_pts
sudo exe_pts -n /dev/pts/3 whoami, runs a whoami on /dev/pts/3

sudo exe_pts -n /dev/pts/19 /usr/bin/python /usr/local/bin/neutron-server --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini


@@@zabbix
zabbix_sender命令详解

zabbix mtr info:
/linuxpf/linux/blob/master/zabbix-plus/getmtr_info.sh

@@@ screen和服务的重启
screen -x stack
script /dev/null

有问题的话参考:http://blog.csdn.net/jmilk/article/details/52096635


2. Designate
CLI 参考:

实践参考:

internal 的DNS已经验证了:
:/opt/stack/logs# tcpdump -enn udp and port 53                                                                                                                           
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tap89aed75f-57, link-type EN10MB (Ethernet), capture size 262144 bytes
^C23:25:03.353993 fa:16:3e:d3:00:2a > fa:16:3e:57:f5:e2, ethertype IPv4 (0x0800), length 77: 10.0.11.6.56506 > 10.0.11.2.53: 41781+ A? my-vm.example.org. (35)
23:25:03.354116 fa:16:3e:57:f5:e2 > fa:16:3e:d3:00:2a, ethertype IPv4 (0x0800), length 93: 10.0.11.2.53 > 10.0.11.6.56506: 41781* 1/0/0 A 10.0.11.3 (51)

2 packets captured
2 packets received by filter
0 packets dropped by kernel


@@@对于devstack的集成
designate  domain-create --name testing123.net. --email me@mydomain.com
designate  record-create --name myhost.testing123.net. --type A --data 1.2.3.4 f98c3d91-f514-4956-a955-20eefb413a64
designate domain-list
designate domain-update --email sample@example.com 88c14ecf-b034-424c-b081-ca42494dcdf9
designate record-list 66584cdd-f7a6-4f0e-acf0-3dd5ad04830d


参考:https://docs.openstack.org/developer/designate/devstack.html

测试内容的笔记:
stack@terry-VirtualBox:~/devstack$ designate server-list
/usr/local/lib/python2.7/dist-packages/designateclient/cli/base.py:38: DeprecationWarning: The "designate" CLI is being deprecated in favour of the "openstack" CLI plugin. All designate API v2 commands are implemented there. When the v1 API is removed this CLI will stop functioning
  DeprecationWarning)
+--------------------------------------+-------------------+
| id                                   | name              |
+--------------------------------------+-------------------+
| 080a557a-053f-4849-bc7c-f6ab4704ce2d | ns1.devstack.org. |
| 5dc9e795-8482-4a5d-ac36-cedeeef0c01b | ns.foo.com.       |
+--------------------------------------+-------------------+
stack@terry-VirtualBox:~/devstack$ designate server-delete 5dc9e795-8482-4a5d-ac36-cedeeef0c01b
/usr/local/lib/python2.7/dist-packages/designateclient/cli/base.py:38: DeprecationWarning: The "designate" CLI is being deprecated in favour of the "openstack" CLI plugin. All designate API v2 commands are implemented there. When the v1 API is removed this CLI will stop functioning
  DeprecationWarning)


stack@terry-VirtualBox:~/devstack$ designate server-list
/usr/local/lib/python2.7/dist-packages/designateclient/cli/base.py:38: DeprecationWarning: The "designate" CLI is being deprecated in favour of the "openstack" CLI plugin. All designate API v2 commands are implemented there. When the v1 API is removed this CLI will stop functioning
  DeprecationWarning)
+--------------------------------------+-------------------+
| id                                   | name              |
+--------------------------------------+-------------------+
| 080a557a-053f-4849-bc7c-f6ab4704ce2d | ns1.devstack.org. |
+--------------------------------------+-------------------+
stack@terry-VirtualBox:~/devstack$ designate record-list  testing123.net.
/usr/local/lib/python2.7/dist-packages/designateclient/cli/base.py:38: DeprecationWarning: The "designate" CLI is being deprecated in favour of the "openstack" CLI plugin. All designate API v2 commands are implemented there. When the v1 API is removed this CLI will stop functioning
  DeprecationWarning)
+--------------------------------------+------+------------------------+-------------------------------------------------------------------+
| id                                   | type | name                   | data                                                              |
+--------------------------------------+------+------------------------+-------------------------------------------------------------------+
| 67462040-2a33-4815-aa4a-b5964888ccb9 | NS   | testing123.net.        | ns1.devstack.org.                                                 |
| 208da861-53d2-4e72-a5a0-f044580eb8db | SOA  | testing123.net.        | ns1.devstack.org. me.mydomain.com. 1488727414 3530 600 86400 3600 |
| 701077ba-5f37-4133-9b34-108cff4ca97b | A    | myhost.testing123.net. | 1.2.3.4                                                           |
+--------------------------------------+------+------------------------+-------------------------------------------------------------------+
stack@terry-VirtualBox:~/devstack$
stack@terry-VirtualBox:~/devstack$ neutron port-create 10075458-5411-4f56-85af-afba09545a8d --dns_name my-vm2
Created a new port:
+-----------------------+-----------------------------------------------------------------------------------+
| Field                 | Value                                                                             |
+-----------------------+-----------------------------------------------------------------------------------+
| admin_state_up        | True                                                                              |
| allowed_address_pairs |                                                                                   |
| binding:host_id       |                                                                                   |
| binding:profile       | {}                                                                                |
| binding:vif_details   | {}                                                                                |
| binding:vif_type      | unbound                                                                           |
| binding:vnic_type     | normal                                                                            |
| created_at            | 2017-03-05T15:24:15Z                                                              |
| description           |                                                                                   |
| device_id             |                                                                                   |
| device_owner          |                                                                                   |
| dns_assignment        | {"hostname": "my-vm2", "ip_address": "10.0.11.11", "fqdn": "my-vm2.example.org."} |
| dns_name              | my-vm2                                                                            |
| extra_dhcp_opts       |                                                                                   |
| fixed_ips             | {"subnet_id": "75196dce-776b-43f9-8b3d-88191b36a7d1", "ip_address": "10.0.11.11"} |
| id                    | 7fe1af9a-59b4-4676-ab2d-5d550e7a888e                                              |
| mac_address           | fa:16:3e:ea:78:6a                                                                 |
| name                  |                                                                                   |
| network_id            | 10075458-5411-4f56-85af-afba09545a8d                                              |
| port_security_enabled | True                                                                              |
| project_id            | 2a51e662e5b64baa8433d0cb964038d5                                                  |
| revision_number       | 6                                                                                 |
| security_groups       | b463a4a2-7c0f-45c7-bdef-a004777f42bb                                              |
| status                | DOWN                                                                              |
| tenant_id             | 2a51e662e5b64baa8433d0cb964038d5                                                  |
| updated_at            | 2017-03-05T15:24:15Z                                                              |
+-----------------------+-----------------------------------------------------------------------------------+
stack@terry-VirtualBox:~/devstack$ neutron router-list
+--------------------------------------+----------+-----------------------------------------------------------------------------+-------------+-------+
| id                                   | name     | external_gateway_info                                                       | distributed | ha    |
+--------------------------------------+----------+-----------------------------------------------------------------------------+-------------+-------+
| 03c3593d-4419-49f7-99b9-d70ab5358fde | router1  | {"network_id": "c4cf1c55-ba85-45eb-9ffe-bb8cc06251ee", "enable_snat": true, | False       | False |
|                                      |          | "external_fixed_ips": [{"subnet_id": "e85e9d3d-                             |             |       |
|                                      |          | fd9f-4466-8321-6978e008259b", "ip_address": "172.24.4.6"}, {"subnet_id":    |             |       |
|                                      |          | "73f6ff29-c1b7-4be1-8c5a-cce4f128b8cd", "ip_address": "2001:db8::1"}]}      |             |       |
| bbb38ac0-0258-4cc8-9c94-04655156f820 | test-int | {"network_id": "c4cf1c55-ba85-45eb-9ffe-bb8cc06251ee", "enable_snat": true, | False       | False |
|                                      |          | "external_fixed_ips": [{"subnet_id": "e85e9d3d-                             |             |       |
|                                      |          | fd9f-4466-8321-6978e008259b", "ip_address": "172.24.4.9"}, {"subnet_id":    |             |       |
|                                      |          | "73f6ff29-c1b7-4be1-8c5a-cce4f128b8cd", "ip_address": "2001:db8::c"}]}      |             |       |
+--------------------------------------+----------+-----------------------------------------------------------------------------+-------------+-------+
stack@terry-VirtualBox:~/devstack$
stack@terry-VirtualBox:~/devstack$
stack@terry-VirtualBox:~/devstack$ neutron router-list|grep extern -i
| id                                   | name     | external_gateway_info                                                                                                                                                                                                                                                      | distributed | ha    |
| 03c3593d-4419-49f7-99b9-d70ab5358fde | router1  | {"network_id": "c4cf1c55-ba85-45eb-9ffe-bb8cc06251ee", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "e85e9d3d-fd9f-4466-8321-6978e008259b", "ip_address": "172.24.4.6"}, {"subnet_id": "73f6ff29-c1b7-4be1-8c5a-cce4f128b8cd", "ip_address": "2001:db8::1"}]} | False       | False |
| bbb38ac0-0258-4cc8-9c94-04655156f820 | test-int | {"network_id": "c4cf1c55-ba85-45eb-9ffe-bb8cc06251ee", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "e85e9d3d-fd9f-4466-8321-6978e008259b", "ip_address": "172.24.4.9"}, {"subnet_id": "73f6ff29-c1b7-4be1-8c5a-cce4f128b8cd", "ip_address": "2001:db8::c"}]} | False       | False |
stack@terry-VirtualBox:~/devstack$ neutron floatingip-list
+--------------------------------------+------------------+---------------------+---------+
| id                                   | fixed_ip_address | floating_ip_address | port_id |
+--------------------------------------+------------------+---------------------+---------+
| 0e8696b7-3984-40ca-a3cc-820f938a5e3e |                  | 172.24.4.4          |         |
+--------------------------------------+------------------+---------------------+---------+
stack@terry-VirtualBox:~/devstack$ neutron floatingip-list
+--------------------------------------+------------------+---------------------+--------------------------------------+
| id                                   | fixed_ip_address | floating_ip_address | port_id                              |
+--------------------------------------+------------------+---------------------+--------------------------------------+
| 0e8696b7-3984-40ca-a3cc-820f938a5e3e | 10.0.11.6        | 172.24.4.4          | b436957b-ee74-4228-acc4-ced769f7920e |
+--------------------------------------+------------------+---------------------+--------------------------------------+
stack@terry-VirtualBox:~/devstack$ designate record-list  testing123.net.
/usr/local/lib/python2.7/dist-packages/designateclient/cli/base.py:38: DeprecationWarning: The "designate" CLI is being deprecated in favour of the "openstack" CLI plugin. All designate API v2 commands are implemented there. When the v1 API is removed this CLI will stop functioning
  DeprecationWarning)
+--------------------------------------+------+--------------------------+-------------------------------------------------------------------+
| id                                   | type | name                     | data                                                              |
+--------------------------------------+------+--------------------------+-------------------------------------------------------------------+
| 67462040-2a33-4815-aa4a-b5964888ccb9 | NS   | testing123.net.          | ns1.devstack.org.                                                 |
| 208da861-53d2-4e72-a5a0-f044580eb8db | SOA  | testing123.net.          | ns1.devstack.org. me.mydomain.com. 1488728659 3530 600 86400 3600 |
| 701077ba-5f37-4133-9b34-108cff4ca97b | A    | myhost.testing123.net.   | 1.2.3.4                                                           |
| df9fb634-ed6f-496b-89a4-030f319105b4 | A    | test-dns.testing123.net. | 172.24.4.4                                                        |
+--------------------------------------+------+--------------------------+-------------------------------------------------------------------+
stack@terry-VirtualBox:~/devstack$ dig -x 1.2.3.4 @127.0.0.1 +short


; <<>> DiG 9.10.3-P4-Ubuntu <<>> -x 1.2.3.4 @127.0.0.1 +short
;; global options: +cmd
;; connection timed out; no servers could be reached
stack@terry-VirtualBox:~/devstack$ neutron floatingip-create ^C
stack@terry-VirtualBox:~/devstack$ neutron net-list
+--------------------------------------+----------+---------------------------------------------------------+
| id                                   | name     | subnets                                                 |
+--------------------------------------+----------+---------------------------------------------------------+
| 10075458-5411-4f56-85af-afba09545a8d | test-int | 75196dce-776b-43f9-8b3d-88191b36a7d1 10.0.11.0/24       |
| c4cf1c55-ba85-45eb-9ffe-bb8cc06251ee | ext_net  | 73f6ff29-c1b7-4be1-8c5a-cce4f128b8cd 2001:db8::/64      |
|                                      |          | e85e9d3d-fd9f-4466-8321-6978e008259b 172.24.4.0/24      |
| ed606587-b27f-4634-9496-b3731069ee9f | net1     | 78b46510-af15-4099-bdf5-7f4f865180c1 fdcd:c992:29f::/64 |
|                                      |          | 9cbd8363-80fc-49b7-9a73-19ab90ab28b7 10.0.0.0/24        |
+--------------------------------------+----------+---------------------------------------------------------+
stack@terry-VirtualBox:~/devstack$ neutron floatingip-create c4cf1c55-ba85-45eb-9ffe-bb8cc06251ee --dns_domain testing123.net. --dns_name my-float
Created a new floatingip:
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| created_at          | 2017-03-05T15:50:52Z                 |
| description         |                                      |
| dns_domain          | testing123.net.                      |
| dns_name            | my-float                             |
| fixed_ip_address    |                                      |
| floating_ip_address | 172.24.4.13                          |
| floating_network_id | c4cf1c55-ba85-45eb-9ffe-bb8cc06251ee |
| id                  | be51c087-c453-4103-9838-01af52b15651 |
| port_id             |                                      |
| project_id          | 2a51e662e5b64baa8433d0cb964038d5     |
| revision_number     | 1                                    |
| router_id           |                                      |
| status              | DOWN                                 |
| tenant_id           | 2a51e662e5b64baa8433d0cb964038d5     |
| updated_at          | 2017-03-05T15:50:52Z                 |
+---------------------+--------------------------------------+
stack@terry-VirtualBox:~/devstack$ designate record-list  testing123.net.
/usr/local/lib/python2.7/dist-packages/designateclient/cli/base.py:38: DeprecationWarning: The "designate" CLI is being deprecated in favour of the "openstack" CLI plugin. All designate API v2 commands are implemented there. When the v1 API is removed this CLI will stop functioning
  DeprecationWarning)
+--------------------------------------+------+--------------------------+-------------------------------------------------------------------+
| id                                   | type | name                     | data                                                              |
+--------------------------------------+------+--------------------------+-------------------------------------------------------------------+
| 67462040-2a33-4815-aa4a-b5964888ccb9 | NS   | testing123.net.          | ns1.devstack.org.                                                 |
| 208da861-53d2-4e72-a5a0-f044580eb8db | SOA  | testing123.net.          | ns1.devstack.org. me.mydomain.com. 1488729052 3530 600 86400 3600 |
| 701077ba-5f37-4133-9b34-108cff4ca97b | A    | myhost.testing123.net.   | 1.2.3.4                                                           |
| df9fb634-ed6f-496b-89a4-030f319105b4 | A    | test-dns.testing123.net. | 172.24.4.4                                                        |
| 5c2e69a6-fc38-4936-92dd-74c45fe1a906 | A    | my-float.testing123.net. | 172.24.4.13                                                       |
+--------------------------------------+------+--------------------------+-------------------------------------------------------------------+
stack@terry-VirtualBox:~/devstack$




Django REST 


中文版:





阅读(1692) | 评论(0) | 转发(0) |
0

上一篇:CoreOS安装挖坑

下一篇:没有了

给主人留下些什么吧!~~