SaltStack DigitalOcean

Salt Master

Clone the formula

sudo su

mkdir -p /srv/formulas
cd /srv/formulas

git clone https://github.com/adithya321/cassandra-formula.git

Master Config

vim /etc/salt/master
file_roots:
  base:
    - /srv/salt
    - /srv/formulas/cassandra-formula

pillar_roots:
  base:
  - /srv/pillar

Cassandra Config Pillar

mkdir -p /srv/pillar/

vim /srv/pillar/cassandra.sls
cassandra:
  series: 311x

  conf:
    dc: dc1
    rack: rack1
    cluster_name: AdmaticCassandraCluster
    listen_address: {{ grains['ip4_interfaces']['eth0'][0] }}
    rpc_address: {{ grains['ip4_interfaces']['eth0'][0] }}
    broadcast_address: {{ grains['ip4_interfaces']['eth0'][0] }}
    seeds:
      - 159.89.171.52
      - 139.59.65.108
      - 159.89.172.167
      - 159.89.171.49
    endpoint_snitch: GossipingPropertyFileSnitch

Top Pillar

vim /srv/pillar/top.sls
base:
  '*':
    - cassandra

Salt Top File

mkdir -p /srv/salt/
vim /srv/salt/top.sls
base:
  '*':
    - cassandra
    - cassandra.config
service salt-master restart
service salt-minion restart
salt-key -A
salt '*' saltutil.refresh_pillar
salt '*' pillar.items

salt 'minion3' saltutil.refresh_pillar
salt 'minion3' pillar.items
salt '*' state.show_highstate
salt '*' state.show_lowstate

salt '*' saltutil.refresh_pillar
salt '*' state.highstate

salt -C 'cassandra-0[0-2]' saltutil.refresh_pillar
salt -C 'c[0-1]' pillar.items
salt -C 'c[0-1]' state.highstate

salt -C 'c[2-3]' saltutil.refresh_pillar
salt -C 'c[2-3]' pillar.items
salt -C 'c[2-3]' state.highstate

Salt Minion

Minion Config

mkdir -p /etc/salt/

vim /etc/salt/roster
minion2:
  host: 159.65.150.95
  user: hadoop
  passwd: Bigd4t4
salt-ssh 'minion2' -i test.ping
ssh 159.65.150.95

vim /etc/salt/minion
master: 159.89.167.62
id: c0

Restart the minion

service salt-minion restart

results matching ""

    No results matching ""