当前位置:   article > 正文

Warning Please make sure the network configuration is correct!( iaas-install-mysql.sh 脚本)

please make sure the network configuration is correct!

解读先电2.4版 iaas-install-mysql.sh 脚本

基础服务的操作命令已经编写成shell脚本,通过脚本进行一键安装。如下:

# Controller节点 安装

执行脚本iaas-install-mysql.sh进行安装

 报错的原因是:

source /etc/xiandian/openrc.sh,脚本里ping通,
  1. 1 #!/bin/bash
  2. 2
  3. 3 source /etc/xiandian/openrc.sh
  4. 4
  5. 5 ping $HOST_IP -c 4 >> /dev/null 2>&1
  6. 6
  7. 7 if [ 0 -ne $? ]; then
  8. 8
  9. 9 echo -e "\033[31m Warning\nPlease make sure the network configuration is correct!\033[0m"
  10. 10
  11. 11 exit 1
  12. 12
  13. 13 fi

解决:

vim /etc/xiandian/openrc.sh ,#此文件是安装过程中的各项参数,根据每项参数上一行的说明及服务器实际情况进行配置。

  1. 1 HOST_IP=192.168.220.10
  2. 2 HOST_NAME=controller
  3. 3 HOST_IP_NODE=192.168.220.11
  4. 4 HOST_NAME_NODE=compute
  5. 5 RABBIT_USER=openstack
  6. 6 RABBIT_PASS=000000
  7. 7 DB_PASS=000000
  8. 8 DOMAIN_NAME=demo
  9. 9 ADMIN_PASS=000000
  10. 10 DEMO_PASS=000000
  11. 11 KEYSTONE_DBPASS=000000
  12. 12 GLANCE_DBPASS=000000
  13. 13 GLANCE_PASS=000000
  14. 14 NOVA_DBPASS=000000
  15. 15 NOVA_PASS=000000
  16. 16 NEUTRON_DBPASS=000000
  17. 17 NEUTRON_PASS=000000
  18. 18 METADATA_SECRET=000000
  19. 19 INTERFACE_NAME=ens37
  20. 20 CINDER_DBPASS=000000
  21. 21 CINDER_PASS=000000
  22. 22 TROVE_DBPASS=000000
  23. 23 TROVE_PASS=000000
  24. 24 BLOCK_DISK=sdb
  25. 25 SWIFT_PASS=000000
  26. 26 OBJECT_DISK=sdb
  27. 27 STORAGE_LOCAL_NET_IP=192.168.220.11
  28. 28 HEAT_DBPASS=000000
  29. 29 HEAT_PASS=000000
  30. 30 CEILOMETER_DBPASS=000000
  31. 31 CEILOMETER_PASS=000000
  32. 32 AODH_DBPASS=000000
  33. 33 AODH_PASS=000000

aas-install-mysql.sh:源码这样的

  1. 1 #!/bin/bash
  2. 2
  3. 3 source /etc/xiandian/openrc.sh
  4. 4
  5. 5 ping $HOST_IP -c 4 >> /dev/null 2>&1
  6. 6
  7. 7 if [ 0 -ne $? ]; then
  8. 8
  9. 9 echo -e "\033[31m Warning\nPlease make sure the network configuration is correct!\033[0m"
  10. 10
  11. 11 exit 1
  12. 12
  13. 13 fi
  14. 14
  15. 15 # check system
  16. 16
  17. 17 sed -i -e '/server/d' -e "/fudge/d" /etc/ntp.conf
  18. 18
  19. 19 sed -i -e "1i server 127.127.1.0" -e "2i fudge 127.127.1.0 stratum 10" /etc/ntp.conf
  20. 20
  21. 21 systemctl restart ntpd
  22. 22
  23. 23 systemctl enable ntpd
  24. 24
  25. 25 yum install mariadb mariadb-server python2-PyMySQL expect mongodb-server mongodb rabbitmq-server memcached python-memcached -y
  26. 26
  27. 27 sed -i "/^symbolic-links/a\default-storage-engine = innodb\ninnodb_file_per_table\ncollation-server = utf8_general_ci\ninit-connect = 'SET NAMES utf8'\ncharacter-set-server = utf8\nmax_connections=10000" /etc/my.cnf
  28. 28
  29. 29 crudini --set /usr/lib/systemd/system/mariadb.service Service LimitNOFILE 10000
  30. 30
  31. 31 crudini --set /usr/lib/systemd/system/mariadb.service Service LimitNPROC 10000
  32. 32
  33. 33 systemctl daemon-reload
  34. 34
  35. 35 systemctl enable mariadb.service
  36. 36
  37. 37 systemctl restart mariadb.service
  38. 38
  39. 39 expect -c "
  40. 40
  41. 41 spawn /usr/bin/mysql_secure_installation
  42. 42
  43. 43 expect \"Enter current password for root (enter for none):\"
  44. 44
  45. 45 send \"\r\"
  46. 46
  47. 47 expect \"Set root password?\"
  48. 48
  49. 49 send \"y\r\"
  50. 50
  51. 51 expect \"New password:\"
  52. 52
  53. 53 send \"$DB_PASS\r\"
  54. 54
  55. 55 expect \"Re-enter new password:\"
  56. 56
  57. 57 send \"$DB_PASS\r\"
  58. 58
  59. 59 expect \"Remove anonymous users?\"
  60. 60
  61. 61 send \"y\r\"
  62. 62
  63. 63 expect \"Disallow root login remotely?\"
  64. 64
  65. 65 send \"n\r\"
  66. 66
  67. 67 expect \"Remove test database and access to it?\"
  68. 68
  69. 69 send \"y\r\"
  70. 70
  71. 71 expect \"Reload privilege tables now?\"
  72. 72
  73. 73 send \"y\r\"
  74. 74
  75. 75 expect eof
  76. 76
  77. 77 "
  78. 78
  79. 79 # mongo
  80. 80
  81. 81 sed -i -e '/bind_ip/d' -e 's/#smallfiles.*/smallfiles=true/g' /etc/mongod.conf
  82. 82
  83. 83 systemctl enable mongod.service
  84. 84
  85. 85 systemctl restart mongod.service
  86. 86
  87. 87 # rabbitmq
  88. 88
  89. 89 systemctl enable rabbitmq-server.service
  90. 90
  91. 91 systemctl restart rabbitmq-server.service
  92. 92
  93. 93 rabbitmqctl add_user $RABBIT_USER $RABBIT_PASS
  94. 94
  95. 95 rabbitmqctl set_permissions $RABBIT_USER ".*" ".*" ".*"
  96. 96
  97. 97 # memcache

systemctl enable memcached.service

systemctl restart memcached.service

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/70522
推荐阅读
相关标签
  

闽ICP备14008679号