共计使用三台虚拟机进行部署实验,系统环境:centos7.3

在master上进行部署配置:

配置主机名

[root@localhost ~]# hostname salt-master

[root@localhost ~]# cat /etc/sysconfig/network

# Created by anaconda

HOSTNAME=salt-master

配置hosts

cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

salt-master     192.168.143.19

salt-minion-01  192.168.143.28

salt-minion-02  192.168.143.35

关闭防火墙

[root@localhost ~]# systemctl disable firewalld.service

Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.

[root@localhost ~]#  systemctl stop firewalld.service

修改selinux为Permissive模式

[root@localhost ~]# setenforce 0

[root@localhost ~]# getenforce

Permissive

安装配置阿里云yum源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

安装epel-release和salt-master工具包

[root@localhost ~]#  yum install epel-release –y

[root@localhost ~]#  yum install salt-master –y

配置saltstack开机自启动服务

[root@localhost ~]# systemctl enable salt-master.service

至此,Master部署配置完成!

在第一个minion端部署配置:

配置主机名

[root@localhost ~]# hostname salt-minion-01

[root@localhost ~]# cat /etc/sysconfig/network

# Created by anaconda

HOSTNAME=salt-minion-01

配置hosts

cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

salt-master     192.168.143.19

salt-minion-01  192.168.143.28

salt-minion-02  192.168.143.35

关闭防火墙

[root@localhost ~]# systemctl disable firewalld.service

Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.

[root@localhost ~]#  systemctl stop firewalld.service

修改selinux为Permissive模式

[root@localhost ~]# setenforce 0

[root@localhost ~]# getenforce

Permissive

安装配置阿里云yum源

[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

安装epel-release工具包和salt-minion客户端

[root@localhost ~]# yum install epel-release -y

[root@localhost ~]# yum install salt-minion -y

在minion端配置master的ip地址和ID

[root@localhost ~]# cat /etc/salt/minion

##### Primary configuration settings #####

##########################################

# This configuration file is used to manage the behavior of the Salt Minion.

# With the exception of the location of the Salt Master Server, values that are

# commented out but have an empty line after the comment are defaults that need

# not be set in the config. If there is no blank line after the comment, the

# value is presented as an example and is not the default.

# Per default the minion will automatically include all config files

# from minion.d/*.conf (minion.d is a directory in the same directory

# as the main minion config file).

#default_include: minion.d/*.conf

# Set the location of the salt master server. If the master server cannot be

# resolved, then the minion will fail to start.

#master: salt

maser: 192.168.143.19

# If multiple masters are specified in the 'master' setting, the default behavior

# is to always try to connect to them in the order they are listed. If random_master is

# set to True, the order will be randomized instead. This can be helpful in distributing

# the load of many minions executing salt-call requests, for example, from a cron job.

# If only one master is listed, this setting is ignored and a warning will be logged.

# NOTE: If master_type is set to failover, use master_shuffle instead.

#random_master: False

# Use if master_type is set to failover.

#master_shuffle: False

# Minions can connect to multiple masters simultaneously (all masters

# are "hot"), or can be configured to failover if a master becomes

# unavailable.  Multiple hot masters are configured by setting this

# value to "str".  Failover masters can be requested by setting

# to "failover".  MAKE SURE TO SET master_alive_interval if you are

# using failover.

# master_type: str

# Poll interval in seconds for checking if the master is still there.  Only

# respected if master_type above is "failover". To disable the interval entirely,

# set the value to -1. (This may be necessary on machines which have high numbers

# of TCP connections, such as load balancers.)

# master_alive_interval: 30

# Set whether the minion should connect to the master via IPv6:

#ipv6: False

# Set the number of seconds to wait before attempting to resolve

# the master hostname if name resolution fails. Defaults to 30 seconds.

# Set to zero if the minion should shutdown and not retry.

# retry_dns: 30

# Set the port used by the master reply and authentication server.

#master_port: 4506

# The user to run salt.

#user: root

# Setting sudo_user will cause salt to run all execution modules under an sudo

# to the user given in sudo_user.  The user under which the salt minion process

# itself runs will still be that provided in the user config above, but all

# execution modules run by the minion will be rerouted through sudo.

#sudo_user: saltdev

# Specify the location of the daemon process ID file.

#pidfile: /var/run/salt-minion.pid

# The root directory prepended to these options: pki_dir, cachedir, log_file,

# sock_dir, pidfile.

#root_dir: /

# The directory to store the pki information in

#pki_dir: /etc/salt/pki/minion

# Explicitly declare the id for this minion to use, if left commented the id

# will be the hostname as returned by the python call: socket.getfqdn()

# Since salt uses detached ids it is possible to run multiple minions on the

# same machine but with different ids, this can be useful for salt compute

# clusters.

id: salt-minion-01

配置开机minion开启自启动服务

[root@localhost ~]# systemctl enable salt-minion.service

Created symlink from /etc/systemd/system/multi-user.target.wants/salt-minion.service to /usr/lib/systemd/system/salt-minion.service.

至此,第一个minion配置部署完毕,第二个minion部署配置同理第一个minion部署配置!

启动salt-master服务: systemctl start salt-master.service

启动salt-minion服务:systemctl start salt-minion.service

测试master和minion之间的通信是否正常

salt "*" test.ping

查看 minion 列表:

salt-key –L

认证所有 key,当然你也可以通过 
salt-key -a saltstack-minion 指定某台 minion
进行认证 key

说明:-a :accept ,-A:accept-all,-d:delete,-D:delete-all。可以使用 salt-key 命令查看到已经签名的客户端。此时我们在客户端的
/etc/salt/pki/minion 目录下面会多出一个minion_master.pub 文件。

saltstack部署配置的更多相关文章

  1. 01 . SaltStack部署配置及简单应用

    SaltStack简介 SaltStack saltstack是一个新的基础平台管理工具,只需要花费数分钟即可运行起来,可以支撑管理上万台服务器的规模,数秒钟即可完成数据传递. saltstack是使 ...

  2. SaltStack部署配置Tomcat-第三篇

    实验目标 简单部署tomcat及安装java环境 实现步骤 编写salt的状态模块 [root@linux-node1 web]# pwd /srv/salt/base/web [root@linux ...

  3. salt-stack部署

    saltstack部署   环境准备 [root@server elasticsearch]# cat /etc/redhat-release CentOS release 6.6 (Final)[r ...

  4. SaltStack部署服务及配置管理apache+php-第二篇

    实验目标 1.使用SaltStack部署apache和php, 2.使用salt管理httpd.conf配置文件配置访问info.php使用账户密码 3.在salt里面增加对conf.d目录进行配置管 ...

  5. saltstack安装配置(syndic)

    syndic是saltstack用来做集群部署的,一般结构如图: syndic是一个特殊的minion,syndic类继承于minion类,syndic可以看作一个代理,只做数据传递. CentOS上 ...

  6. Jenkins部署配置简介

    前段时间研究了一下自动化测试,因而接触到了Jenkins,今天有时间进行一下Jenkins部署配置相关知识的总结分享 前言:由于本次只是实验性研究,采用Windows环境,因此Jenkins可以通过下 ...

  7. TOMCAT的安装部署配置(配图解)

    TOMCAT的安装部署配置 前提已经成功搭建配置JDK 下载好压缩包后,直接解压至某一目录下,目录中不能包含中文 双击安装文件,出现如下界面 点击[NEXT],出现如下界面 点击[I AGREE],出 ...

  8. PL/SQL安装部署配置(配图解)

    PL/SQL安装部署配置 下载好安装包之后,双击exe程序 双击安装程序,出现如下页面 点击[NEXT],出现如下界面 选择[I Accept...],点击[NEXT],出现如下界面 选择安装路径,点 ...

  9. JDK的安装及部署配置(配图解)

    JDK的安装及部署配置 双击安装文件,出现如下界面 点击[下一步]出现如下界面,更改安装路径(建议安装至D盘), 点击[下一步],出现如下界面,修改文件夹名. 点击[确定],耐心等待 直至出现如下界面 ...

随机推荐

  1. Linux 网络工具详解之 ip tuntap 和 tunctl 创建 tap/tun 设备

    本文首发于我的公众号 Linux云计算网络(id: cloud_dev),专注于干货分享,号内有 10T 书籍和视频资源,后台回复「1024」即可领取,欢迎大家关注,二维码文末可以扫. 在前面一篇文章 ...

  2. mysql 开发进阶篇系列 18 MySQL Server(innodb_buffer_pool_size)

    从这篇开始,讲innodb存储引擎中,对于几个重要的服务器参数配置.这些参数以innodb_xx 开头. 1. innodb_buffer_pool_size的设置 这个参数定义了innodb存储引擎 ...

  3. mysql 开发进阶篇系列 5 SQL 优化(表优化)

    一. 使用sql提示 sql 提示(sql hint)是优化数据库的一个重要手段, 是在sql语句中加入一些人为的提示来达到优化操作的目的. 1.1 use index 在查询语句中表名的后面,添加u ...

  4. 项目ITP(四) javaweb http json 交互 in action (服务端 spring 手机端 提供各种工具类)勿喷!

    前言 系列文章:[传送门] 洗了个澡,准备写篇博客.然后看书了.时间 3 7 分.我慢慢规律生活,向目标靠近.  很喜欢珍惜时间像叮当猫一样 正文 慢慢地,二维码实现签到将要落幕了.下篇文章出二维码实 ...

  5. C#系列之聊聊.Net Core的InMemoryCache

    作者:暴王 个人博客:http://www.boydwang.com/2017/12/net-core-in-memory-cache/ 这两天在看.net core的in memory cache, ...

  6. for循环输出素数探究【java】

    一.判断953是不是为素数(质数). 代码: /** 判断953是不是为素数(质数) 分析: 素数指整数在一个大于1的自然数中,除了1和此整数自身外,没法被其他自然数整除的数. 假设953是素数,则: ...

  7. for循环输出空心菱形的形状【java】

    使用for循环语句输出以下“空心菱形”效果: * * * * * * * * * * * * * * * * 建议优先参考笔者的另一篇文章:<for循环输出菱形的形状[java]> 代码: ...

  8. 提升 PLSQL 开发性能漫谈

    本文内容摘自<剑破冰山--Oracle开发艺术>一书,有删改. 1.触发器尽量考虑内部代码过程封装(解析次数) 2.避免动态 SQL 动态 SQL 和普通 SQL 在执行过程中最大的差别在 ...

  9. 数据结构(一) 单链表的实现-JAVA

    数据结构还是很重要的,就算不是那种很牛逼的,但起码得知道基础的东西,这一系列就算是复习一下以前学过的数据结构和填补自己在这一块的知识的空缺.加油.珍惜校园中自由学习的时光.按照链表.栈.队列.排序.数 ...

  10. ES6躬行记(4)——模板字面量

    模板字面量(Template Literal)是一种能够嵌入表达式的格式化字符串,有别于普通字符串,它使用反引号(`)包裹字符序列,而不是双引号或单引号.模板字面量包含特定形式的占位符(${expre ...