Here's a more specific breakdown of what I did:
$ juju bootstrap # local ... $ juju deploy postgresql $ juju status environment: local machines: "0": agent-state: started agent-version: 1.21-alpha1.1 dns-name: localhost instance-id: localhost series: trusty state-server-member-status: has-vote "1": agent-state: started agent-version: 1.21-alpha1.1 dns-name: 10.0.3.58 instance-id: esnow-local-machine-1 series: trusty hardware: arch=amd64 services: postgresql: charm: cs:trusty/postgresql-3 exposed: false relations: replication: - postgresql units: postgresql/0: agent-state: error agent-state-info: 'hook failed: "install"' agent-version: 1.21-alpha1.1 machine: "1" open-ports: - 5432/tcp public-address: 10.0.3.58 $ juju remove-service postgresql # Nothing written to std*. $ juju status environment: local machines: "0": agent-state: started agent-version: 1.21-alpha1.1 dns-name: localhost instance-id: localhost series: trusty state-server-member-status: has-vote "1": agent-state: started agent-version: 1.21-alpha1.1 dns-name: 10.0.3.58 instance-id: esnow-local-machine-1 series: trusty hardware: arch=amd64 services: postgresql: charm: cs:trusty/postgresql-3 exposed: false life: dying units: postgresql/0: agent-state: error agent-state-info: 'hook failed: "install"' agent-version: 1.21-alpha1.1 life: dying machine: "1" open-ports: - 5432/tcp public-address: 10.0.3.58
Removing the unit:
$ juju remove-unit postgresql/0 $ juju status environment: local machines: "0": agent-state: started agent-version: 1.21-alpha1.1 dns-name: localhost instance-id: localhost series: trusty state-server-member-status: has-vote "1": agent-state: started agent-version: 1.21-alpha1.1 dns-name: 10.0.3.58 instance-id: esnow-local-machine-1 series: trusty hardware: arch=amd64 services: postgresql: charm: cs:trusty/postgresql-3 exposed: false life: dying units: postgresql/0: agent-state: error agent-state-info: 'hook failed: "install"' agent-version: 1.21-alpha1.1 life: dying machine: "1" open-ports: - 5432/tcp public-address: 10.0.3.58
Removing the machine:
$ juju remove-machine 1 ERROR no machines were destroyed: machine 1 has unit "postgresql/0" assigned
Here's a more specific breakdown of what I did:
$ juju bootstrap # local server- member- status: has-vote machine- 1 postgresql- 3
agent- state: error
agent- state-info: 'hook failed: "install"'
agent- version: 1.21-alpha1.1
public- address: 10.0.3.58 server- member- status: has-vote machine- 1 postgresql- 3
agent- state: error
agent- state-info: 'hook failed: "install"'
agent- version: 1.21-alpha1.1
public- address: 10.0.3.58
...
$ juju deploy postgresql
$ juju status
environment: local
machines:
"0":
agent-state: started
agent-version: 1.21-alpha1.1
dns-name: localhost
instance-id: localhost
series: trusty
state-
"1":
agent-state: started
agent-version: 1.21-alpha1.1
dns-name: 10.0.3.58
instance-id: esnow-local-
series: trusty
hardware: arch=amd64
services:
postgresql:
charm: cs:trusty/
exposed: false
relations:
replication:
- postgresql
units:
postgresql/0:
machine: "1"
open-ports:
- 5432/tcp
$ juju remove-service postgresql
# Nothing written to std*.
$ juju status
environment: local
machines:
"0":
agent-state: started
agent-version: 1.21-alpha1.1
dns-name: localhost
instance-id: localhost
series: trusty
state-
"1":
agent-state: started
agent-version: 1.21-alpha1.1
dns-name: 10.0.3.58
instance-id: esnow-local-
series: trusty
hardware: arch=amd64
services:
postgresql:
charm: cs:trusty/
exposed: false
life: dying
units:
postgresql/0:
life: dying
machine: "1"
open-ports:
- 5432/tcp
Removing the unit:
$ juju remove-unit postgresql/0 server- member- status: has-vote machine- 1 postgresql- 3
agent- state: error
agent- state-info: 'hook failed: "install"'
agent- version: 1.21-alpha1.1
public- address: 10.0.3.58
$ juju status
environment: local
machines:
"0":
agent-state: started
agent-version: 1.21-alpha1.1
dns-name: localhost
instance-id: localhost
series: trusty
state-
"1":
agent-state: started
agent-version: 1.21-alpha1.1
dns-name: 10.0.3.58
instance-id: esnow-local-
series: trusty
hardware: arch=amd64
services:
postgresql:
charm: cs:trusty/
exposed: false
life: dying
units:
postgresql/0:
life: dying
machine: "1"
open-ports:
- 5432/tcp
Removing the machine:
$ juju remove-machine 1
ERROR no machines were destroyed: machine 1 has unit "postgresql/0" assigned