title: Postgres replication not starting due to wal error
body: <p>I am using postgres version 9.3.2 on two servers one master, one primary.</p>
  
  <p>I am setting up replication as follows:-</p>
  
  <p>On master:-</p>
  
  <pre><code>  sudo -u postgres psql -c "CREATE USER replicator REPLICATION LOGIN ENCRYPTED PASSWORD 'FOO’;"
  </code></pre>
  
  <p>Edit postgresql.conf </p>
  
  <pre><code>listen_address = '*'
  wal_level = hot_standby
  max_wal_senders = 32 
  checkpoint_segments = 8    
  wal_keep_segments = 100 
  </code></pre>
  
  <p>Edit pg_hba.conf</p>
  
  <pre><code>hostssl replication     replicator      &lt;SLAVE IP&gt;/32        md5
  </code></pre>
  
  <p>On Slave:-</p>
  
  <p>Edit postgresql.conf</p>
  
  <pre><code>wal_level = hot_standby
  max_wal_senders = 3
  checkpoint_segments = 8
  wal_keep_segments = 8
  hot_standby = on
  </code></pre>
  
  <p>Run</p>
  
  <pre><code>sudo service postgresql stop
  
  sudo -u postgres rm -rf /var/lib/postgresql/9.3/main
  
  sudo -u postgres pg_basebackup -h &lt;MASTER IP&gt; -D /var/lib/postgresql/9.3/main -U replicator -v -P
  </code></pre>
  
  <p>CREATE /var/lib/postgresql/9.3/main/recovery.conf</p>
  
  <pre><code> standby_mode = 'on'
   primary_conninfo = 'host=&lt;MASTER IP&gt; port=5432 user=replicator password=FOO sslmode=require'
   trigger_file = '/tmp/postgresql.trigger'
  </code></pre>
  
  <p>Run:-</p>
  
  <pre><code>sudo service postgresql restart
  </code></pre>
  
  <p>When I restart postgres on the slave I get this error message:-</p>
  
  <pre><code>LOG: database system was shut down at 2015-01-14 09:10:50 GMT 2015-01-14 09:11:01 GMT [16741-2] 
  LOG: entering standby mode 2015-01-14 09:11:01 GMT [16741-3] WARNING: WAL was generated with wal_level=minimal, data may be missing 2015-01-14 09:11:01 GMT [16741-4] HINT: This happens if you temporarily set wal_level=minimal without taking a new base backup. 2015-01-14 09:11:01 GMT [16741-5] 
  FATAL: hot standby is not possible because wal_level was not set to "hot_standby" on the master server 2015-01-14 09:11:01 GMT [16741-6] HINT: Either set wal_level to "hot_standby" on the master, or turn off hot_standby here. 2015-01-14 09:11:01 GMT [16740-1] 
  LOG: startup process (PID 16741) exited with exit code 1 2015-01-14 09:11:01 GMT [16740-2] LOG: aborting startup due to startup process failure ... failed!
  </code></pre>
  
  <p>Why is this happening? I have checked and rechecked that on the master wal_level is set to hot_standby. On the master running "show all" shows that this is the case? I am at a loss as to what I am doing wrong here.</p>