使用devstack 一鍵安裝 openstack詳細過程和遇到的坑

安裝參考鏈接 https://www.cnblogs.com/dyd168/p/14482507.html

後面都是解決坑。。。。

安裝之前以下操作是必要的:

[root@jay-server ~]# vim /etc/selinux/config
[root@jay-server ~]# setenforce 0
[root@jay-server ~]# cat /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 these three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

注意點:遇到安裝錯誤,重裝需執行 ./clean.sh ==》 /unstack.sh ==》 ./stack.sh

安裝過程中很多東西需要從github下載,所以最好提前準備好代理服務,執行安裝之前代理一下

export https_proxy=代理服務:端口

坑一:

ERROR /opt/stack/devstack/lib/neutron_plugins/ovn_agent:174 Socket

As said above by Sage Ren, When we are going to run Command $ ./stack.sh first time and the above error is encounters.

This error is solved easily by following below steps.

  1. Go to neutron_plugin folder, by default the folder is reside in the /opt/stack/devstack/lib/neutron_plugins directory.
  2. open ovn_agent file with sudo privileges.
  3. change line 116 which looks like this OVS_RUNDIR=$OVS_PREFIX/var/run/openvswitch you just have to change ovn by replacing of openvswitch. after change your line will become OVS_RUNDIR=$OVS_PREFIX/var/run/ovn now save the file.
  4. Now go to /var/run/ovn/ directory, In this you will find ovn folder over there. Just remove the folder using $sudo rm -rf ovn command
  5. Now first run ./clean.sh and then ./unstack.sh command
  6. reboot the system
  7. run ./stack.sh

 

坑二:(這個我沒遇到,來自網上)

==========================
[Call Trace]
./stack.sh:499:check_path_perm_sanity
/opt/stack/devstack/functions:612:die
[ERROR] /opt/stack/devstack/functions:612 Invalid path permissions
==========================
fixed:
$ sudo chmod 755 /opt/stack
==========================

 

坑三:python3.6 安裝不了 futures-3.0.5

ERROR: Cannot install nova because these package versions have conflicting dependencies.

The conflict is caused by:
    pypowervm 1.1.26 depends on futures>=3.0; python_version == "3.6"
    The user requested (constraint) futures===3.0.5

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

fixed:
$ wget https://files.pythonhosted.org/packages/55/db/97c1ca37edab586a1ae03d6892b6633d8eaa23b23ac40c7e5bbc55423c78/futures-3.0.5.tar.gz#sha256=0542525145d5afc984c88f914a0c85c77527f65946617edb5274f72406f981df

$ tar xfvz futures-3.0.5.tar.gz

$ cd futures-3.0.5/

$ sed -i 's/raise type(self._exception), self._exception, self._traceback/raise Exeption(type(self._exception), self._exception, self._traceback)/' concurrent/futures/_base.py

$ sudo python3 setup.py install

坑四:(這個我沒遇到,來自網上)

+./stack.sh:main:1102 create_keystone_accounts
+lib/keystone:create_keystone_accounts:314 local admin_project
++lib/keystone:create_keystone_accounts:315 oscwrap project show admin -f value -c id
++functions-common:oscwrap:2330 local xtrace
+++functions-common:oscwrap:2331 grep xtrace
+++functions-common:oscwrap:2331 set +o
++functions-common:oscwrap:2331 xtrace='set -o xtrace'
++functions-common:oscwrap:2332 set +o xtrace
/opt/stack/devstack/functions-common: line 2342: openstack: command not found
++functions-common:oscwrap:2349 return 127
+lib/keystone:create_keystone_accounts:315 admin_project=
+lib/keystone:create_keystone_accounts:1 exit_trap
+./stack.sh:exit_trap:507 local r=127
++./stack.sh:exit_trap:508 jobs -p
+./stack.sh:exit_trap:508 jobs=99848
+./stack.sh:exit_trap:511 [[ -n 99848 ]]
+./stack.sh:exit_trap:511 [[ -n '' ]]
+./stack.sh:exit_trap:517 '[' -f /tmp/tmp.6eYDz6mXg1 ']'
+./stack.sh:exit_trap:518 rm /tmp/tmp.6eYDz6mXg1
+./stack.sh:exit_trap:522 kill_spinner
+./stack.sh:kill_spinner:417 '[' '!' -z '' ']'
+./stack.sh:exit_trap:524 [[ 127 -ne 0 ]]
+./stack.sh:exit_trap:525 echo 'Error on exit'
Error on exit
+./stack.sh:exit_trap:527 type -p generate-subunit
+./stack.sh:exit_trap:530 [[ -z /opt/stack/logs ]]
+./stack.sh:exit_trap:533 /bin/python3.6 /opt/stack/devstack/tools/worlddump.py -d /opt/stack/logs
==========================
fixed:
$ id
uid=1000(stack) gid=1000(stack) groups=1000(stack),1002(libvirtd)

$ echo "PATH=/usr/local/bin/:\$PATH" >> /opt/stack/.bashrc
$ echo "export PATH" >> /opt/stack/.bashrc

logout and login

坑五:這個其實是因爲上次執行報錯,沒有執行clean.sh

+lib/neutron_plugins/ovn_agent:install_ovn:357 sudo mkdir -p /var/run/openvswitch
++lib/neutron_plugins/ovn_agent:install_ovn:358 whoami
+lib/neutron_plugins/ovn_agent:install_ovn:358 sudo chown stack /var/run/openvswitch
+lib/neutron_plugins/ovn_agent:install_ovn:362 sudo ln -s /var/run/openvswitch /var/run/ovn
ln: failed to create symbolic link '/var/run/ovn/openvswitch': File exists
+lib/neutron_plugins/ovn_agent:install_ovn:1 exit_trap
==========================
fixed:
$ vim /opt/stack/devstack/lib/neutron_plugins/ovn_agent
- sudo ln -s $OVS_RUNDIR $OVN_RUNDIR
+ [ -f $OVN_RUNDIR ] || sudo ln -s $OVS_RUNDIR $OVN_RUNDIR

 

坑六:按教程安裝完之後,重啓電腦服務沒起來

開放80 6640 9696端口  

 1 [root@jay-server ~]# cat /etc/sysconfig/iptables
 2 # sample configuration for iptables service
 3 # you can edit this manually or use system-config-firewall
 4 # please do not ask us to add additional ports/services to this default configuration
 5 *filter
 6 :INPUT ACCEPT [0:0]
 7 :FORWARD ACCEPT [0:0]
 8 :OUTPUT ACCEPT [0:0]
 9 -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
10 -A INPUT -p icmp -j ACCEPT
11 -A INPUT -i lo -j ACCEPT
12 -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
13 -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
14 -A INPUT -p tcp -m state --state NEW -m tcp --dport 6640 -j ACCEPT
15 -A INPUT -p tcp -m state --state NEW -m tcp --dport 9696 -j ACCEPT
16 -A INPUT -j REJECT --reject-with icmp-host-prohibited
17 -A FORWARD -j REJECT --reject-with icmp-host-prohibited
18 COMMIT

 開啓啓動以下服務:

systemctl ebable httpd
systemctl enable memcached
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章