#!/bin/bash			#声明解释器路径
source /etc/xiandian/openrc.sh #生效环境变量
ping $HOST_IP -c 4 >> /dev/null 2>&1
if [ 0 -ne $? ]; then
echo -e "\033[31m Warning\nPlease make sure the network configuration is correct!\033[0m"
exit 1
fi #shell语法不做解释,这一部分的作用是确保网络配置正确,错误则输出(Please make sure the network configuration is correct!)并终止执行脚本
#MariaDB

yum install -y mariadb mariadb-server python2-PyMySQL		#安装MariaDB软件包

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

#修改 /etc/my.cnf文件[mysqld]中添加

max_connections=10000
设置 mariadb最大连接数为10000 default-storage-engine = innodb
innodb_file_per_table
设置数据库默认存储引擎为innodb collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8**
设置数据库的编码格式为utf8
sed -i 's/plugin-load-add*/#plugin-load-add/g' /etc/my.cnf.d/auth_gssapi.cnf  

#修改/etc/my.cnf.d/auth_gssapi.cnf文件参数
[mariadb]
注释一行参数
#plugin-load-add=auth_gssapi.so
crudini --set /usr/lib/systemd/system/mariadb.service Service LimitNOFILE 10000
crudini --set /usr/lib/systemd/system/mariadb.service Service LimitNPROC 10000 #由于mariadb有默认打开文件数限制。可以通过修改
/usr/lib/systemd/system/mariadb.service文件参数
[Service]
新添加两行如下参数: LimitNOFILE=10000
LimitNPROC=10000 来调大打开文件数目。
systemctl daemon-reload			#后台程序重新加载,使配置文件生效生效
systemctl enable mariadb.service #设置开机自启mariadb服务
systemctl restart mariadb.service #重启mariadb服务
expect -c "						#自动执行脚本
spawn /usr/bin/mysql_secure_installation #执行安全配置向导命令
expect \"Enter current password for root (enter for none):\"
send \"\r\"
expect \"Set root password?\"
send \"y\r\"
expect \"New password:\"
send \"$DB_PASS\r\"
expect \"Re-enter new password:\"
send \"$DB_PASS\r\"
expect \"Remove anonymous users?\"
send \"y\r\"
expect \"Disallow root login remotely?\"
send \"n\r\"
expect \"Remove test database and access to it?\"
send \"y\r\"
expect \"Reload privilege tables now?\"
send \"y\r\"
expect eof
" #借助expect处理交互的命令,配置Mysql #MariaDB简介:https://blog.csdn.net/cxu0262/article/details/106257174
#RabbitMQ

yum install rabbitmq-server -y					#安装rabbitmq软件包
systemctl start rabbitmq-server.service #启动rabbitmq服务
systemctl enable rabbitmq-server.service #设置rabbitmq服务开机自启
rabbitmqctl add_user $RABBIT_USER $RABBIT_PASS #创建RabbitMQ用户和密码
rabbitmqctl set_permissions $RABBIT_USER ".*" ".*" ".*" #设置用户访问虚拟机权限:授予用户可访问虚拟主机,在所有资源上都具备可配置,可写及可读的权限。 #python-memcached:使用python语言开发的与memcached内存守护进程通信的接口程序 #RabbitMQ简介:https://blog.csdn.net/qq_45533841/article/details/106026991
#Memcache

yum install memcached python-memcached -y
sed -i -e 's/OPTIONS.*/OPTIONS="-l 127.0.0.1,::1,'$HOST_NAME'"/g' /etc/sysconfig/memcached
systemctl start memcached.service
systemctl enable memcached.service #Memcache简介:https://blog.csdn.net/qq_33753147/article/details/79159410
#ETCD

yum install etcd -y
sed -i -e 's/#ETCD_LISTEN_PEER_URLS.*/ETCD_LISTEN_PEER_URLS="http:\/\/'$HOST_IP':2380"/g' \
-e 's/^ETCD_LISTEN_CLIENT_URLS.*/ETCD_LISTEN_CLIENT_URLS="http:\/\/'$HOST_IP':2379"/g' \
-e 's/^ETCD_NAME="default"/ETCD_NAME="'$HOST_NAME'"/g' \
-e 's/#ETCD_INITIAL_ADVERTISE_PEER_URLS.*/ETCD_INITIAL_ADVERTISE_PEER_URLS="http:\/\/'$HOST_IP':2380"/g' \
-e 's/^ETCD_ADVERTISE_CLIENT_URLS.*/ETCD_ADVERTISE_CLIENT_URLS="http:\/\/'$HOST_IP':2379"/g' \
-e 's/#ETCD_INITIAL_CLUSTER=.*/ETCD_INITIAL_CLUSTER="'$HOST_NAME'=http:\/\/'$HOST_IP':2380"/g' \
-e 's/#ETCD_INITIAL_CLUSTER_TOKEN.*/ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"/g' \
-e 's/#ETCD_INITIAL_CLUSTER_STATE.*/ETCD_INITIAL_CLUSTER_STATE="new"/g' /etc/etcd/etcd.conf #修改/etc/etcd/etcd.conf配置文件,添加以下内容:
ETCD_LISTEN_PEER_URLS="http://192.168.100.10:2380"
ETCD_LISTEN_CLIENT_URLS="http://192.168.100.10:2379"
ETCD_NAME="controller"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.100.10:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://192.168.100.10:2379"
ETCD_INITIAL_CLUSTER="controller=http://192.168.100.10:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
ETCD_INITIAL_CLUSTER_STATE="new" #ETCD简介:https://blog.csdn.net/BlademasterDZ/article/details/113561889

解读先电2.4版 iaas-install-mysql.sh 脚本的更多相关文章

  1. Install MySQL on Mac by Homebrew

    1.  安装mysql brew update brew install mysql 2. 启动mysql mysql.server start 3. 登录mysql mysql -uroot -p ...

  2. yum install mysql

    rpm -qa|grep -i mysqlmysql-libs-5.1.52-1.1.alios6.1.x86_64mysql-5.1.52-1.1.alios6.1.x86_64mysql-deve ...

  3. 在OSX狮子(Lion)上安装MYSQL(Install MySQL on Mac OSX)

    这篇文章简述了在Mac OSX狮子(Lion)上安装MySQL Community Server最新版本v10.6.7的过程. MySQL是最流行的开源数据库管理系统.首先,从MySQL的下载页面上下 ...

  4. ubuntu install mysql server method

         recently try to install mysql in my computer so that  I can practise some sql statement on seve ...

  5. macbook install mysql

    安装Homebrew,详细步骤参见Homebrew官网. brew doctor确认brew在正常工作. brew update更新包. brew install mysql 安装mysql.log如 ...

  6. install mysql from source and troubleshooting example

    I tried to install MySQL 5.7 from source file and upgrading previous MySQL version to the lastest 5. ...

  7. 执行了‘“npm install mysql"

    http是核心模块,封装到安装包里面了,如果在你项目的当前目录下<code>npm install mysql<code>的话就会在你当前目录下的node_modules文件夹 ...

  8. Install MySQL 5.7 on Fedora 25/24, CentOS/RHEL 7.3/6.8/5.11

    MySQL is a relational database management system (RDBMS) that runs as a server providing multi-user ...

  9. Install MySql on CentOS

    Installing & Configuring MySQL Server This Howto will show you how to install MySQL 5.x, start t ...

随机推荐

  1. 如何实现集群中的 session 共享存储?

    Session 是运行在一台服务器上的,所有的访问都会到达我们的唯一服务器上,这 样我们可以根据客户端传来的 sessionID,来获取 session,或在对应 Session 不 存在的情况下(s ...

  2. composer安装报错

    问题报错:Fatal error: Declaration of Fxp\Composer\AssetPlugin\Repository\AbstractAssetsRepository::searc ...

  3. 学习 Haproxy (四)

    一. haproxy 的安装配置 # cat /etc/redhat-release CentOS release 6.6 (Final) # uname -r 2.6.32-504.el6.i686 ...

  4. 如何解决Visual Studio 2017 运行后控制台窗口一闪就消失了

    出现这种情况的原因 安装使用Visual Studio 2017 后,用Ctrl+F5运行程序,结果控制台窗口一闪就没了,也没有出现"press any key to continue-&q ...

  5. PN结

    摘自:https://blog.csdn.net/CPJ_phone/article/details/40979027                                          ...

  6. POP3:基于命令行的电子邮件(EMail)在线查看和批量下载工具

    使用该工具可以在不安装outlook和foxmail等邮件客户端的情况下快速下载指定邮箱的邮件,并将下载的邮件以eml格式进行保存. 附: 查看eml格式的邮件可使用 EmlReader 工具,该工具 ...

  7. javaScript设计模式:发布订阅模式

    发布订阅模式的思想是在观察者模式的基础上演变而来,在观察者模式中客户端监听到对象某个行为就触发对应任务程序.而在发布订阅模式中依然基于这个核心思想,所以有时候也会将两者认为是同一种设计模式.它们的不同 ...

  8. 机器学习---kmeans聚类的python实现

    """ Name: study_kmeans.py Author: KX-Lau Time: 2020/11/6 16:59 Desc: 实现kmeans聚类 " ...

  9. Blazor 在开发环境保存机密(User Secrets)

    前言 在应用程序开发的过程中,有的时候需要在代码中保存一些机密的信息,比如微信appkey, 连接字符串,加密密钥,字符串,或者是用户名密码等.通常的做法是保存到一个配置文件中,例如 appsetti ...

  10. Machine Learning 学习笔记 01 Typora、配置OSS、导论

    Typora 安装与使用. Typora插件. OSS图床配置. 机器学习导论. 机器学习的基本思路. 机器学习实操的7个步骤