1.9通过脚本安装数据库服务

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

# Controller节点

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

1.10安装Mysql数据库服务

1)安装mysql服务

# yum install -y mariadb mariadb-server python2-PyMySQL

2)修改mysql配置文件参数

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

max_connections=10000

default-storage-engine = innodb

innodb_file_per_table

collation-server = utf8_general_ci

init-connect = 'SET NAMES utf8'

character-set-server = utf8

3)启动服务

#systemctl enable mariadb.service

#systemctl start mariadb.service

4)修改/usr/lib/systemd/system/mariadb.service文件参数

[Service]

新添加两行如下参数:

LimitNOFILE=10000

LimitNPROC=10000

5)修改/etc/my.cnf.d/auth_gssapi.cnf文件参数

[mariadb]

注释一行参数

#plugin-load-add=auth_gssapi.so

6)重新加载系统服务,并重启mariadb服务

# systemctl daemon-reload

# service mariadb restart

7)配置Mysql

# mysql_secure_installation

enter确认后设置数据库root密码

Remove anonymous users? [Y/n] y

Disallow root login remotely? [Y/n] n

Remove test database and access to it? [Y/n] y

Reload privilege tables now? [Y/n] y

8compute节点

#yum -y install  MySQL-python

1.11安装RabbitMQ服务

# yum install -y rabbitmq-server

# systemctl enable rabbitmq-server.service

# systemctl restart rabbitmq-server.service

# rabbitmqctl add_user $RABBIT_USER $RABBIT_PASS

# rabbitmqctl set_permissions $RABBIT_USER ".*" ".*" ".*"

1.12安装memcahce服务

# yum install memcached python-memcached

# systemctl enable memcached.service

# systemctl restart memcached.service

1.13 安装etcd服务

# yum install etcd –y

1)修改/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"

2)启动服务

# systemctl start etcd

# systemctl enable etcd

你可能感兴趣的:(分布式,云原生)