ubuntu 18.04.1 LTS postgres systemd service
I am installing Postgres 11 on Ubuntu 18.04. When you do a non-default install:
First install postgresql-common
. Adapt the config file to NOT create main cluster , start_conf= 'auto'
and data_directory = '/pgs002/%v/%c'
Install postgresql-11
, contrib
and postgresql-11-postgis-2.5
Then you create a cluster with pg_createcluster
.
There are two problems:
The DB does not start. (because the
pg_hba_conf
etc are in/etc/postgres
... and not in/pgs002/11/cluster/data
).
This is easy to fix, just copy the conf files to the right places.
- The service is not created or not created in the correct way. There are two
postgresql
files in/lib/systemd/system
,postgresql.service
andpostgresql@.service
. The latter's file size is 1580, the former's 337. The latter seems to be correct, (contents of the file) but not the name. There is no service created for the cluster.
How can I fix this problem?
systemd postgresql
add a comment |
I am installing Postgres 11 on Ubuntu 18.04. When you do a non-default install:
First install postgresql-common
. Adapt the config file to NOT create main cluster , start_conf= 'auto'
and data_directory = '/pgs002/%v/%c'
Install postgresql-11
, contrib
and postgresql-11-postgis-2.5
Then you create a cluster with pg_createcluster
.
There are two problems:
The DB does not start. (because the
pg_hba_conf
etc are in/etc/postgres
... and not in/pgs002/11/cluster/data
).
This is easy to fix, just copy the conf files to the right places.
- The service is not created or not created in the correct way. There are two
postgresql
files in/lib/systemd/system
,postgresql.service
andpostgresql@.service
. The latter's file size is 1580, the former's 337. The latter seems to be correct, (contents of the file) but not the name. There is no service created for the cluster.
How can I fix this problem?
systemd postgresql
add a comment |
I am installing Postgres 11 on Ubuntu 18.04. When you do a non-default install:
First install postgresql-common
. Adapt the config file to NOT create main cluster , start_conf= 'auto'
and data_directory = '/pgs002/%v/%c'
Install postgresql-11
, contrib
and postgresql-11-postgis-2.5
Then you create a cluster with pg_createcluster
.
There are two problems:
The DB does not start. (because the
pg_hba_conf
etc are in/etc/postgres
... and not in/pgs002/11/cluster/data
).
This is easy to fix, just copy the conf files to the right places.
- The service is not created or not created in the correct way. There are two
postgresql
files in/lib/systemd/system
,postgresql.service
andpostgresql@.service
. The latter's file size is 1580, the former's 337. The latter seems to be correct, (contents of the file) but not the name. There is no service created for the cluster.
How can I fix this problem?
systemd postgresql
I am installing Postgres 11 on Ubuntu 18.04. When you do a non-default install:
First install postgresql-common
. Adapt the config file to NOT create main cluster , start_conf= 'auto'
and data_directory = '/pgs002/%v/%c'
Install postgresql-11
, contrib
and postgresql-11-postgis-2.5
Then you create a cluster with pg_createcluster
.
There are two problems:
The DB does not start. (because the
pg_hba_conf
etc are in/etc/postgres
... and not in/pgs002/11/cluster/data
).
This is easy to fix, just copy the conf files to the right places.
- The service is not created or not created in the correct way. There are two
postgresql
files in/lib/systemd/system
,postgresql.service
andpostgresql@.service
. The latter's file size is 1580, the former's 337. The latter seems to be correct, (contents of the file) but not the name. There is no service created for the cluster.
How can I fix this problem?
systemd postgresql
systemd postgresql
edited Dec 12 at 9:59
Zanna
50k13131238
50k13131238
asked Dec 12 at 8:24
Herwig Goemans
13
13
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I think I can answer my own question after some: when you create a PG cluster this way, you have to enable the service yourself: sudo systemctl enable postgresql@version-cluster name.
After that, the symlinks are created and you can manage the instance with the service file.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1100247%2fubuntu-18-04-1-lts-postgres-systemd-service%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I think I can answer my own question after some: when you create a PG cluster this way, you have to enable the service yourself: sudo systemctl enable postgresql@version-cluster name.
After that, the symlinks are created and you can manage the instance with the service file.
add a comment |
I think I can answer my own question after some: when you create a PG cluster this way, you have to enable the service yourself: sudo systemctl enable postgresql@version-cluster name.
After that, the symlinks are created and you can manage the instance with the service file.
add a comment |
I think I can answer my own question after some: when you create a PG cluster this way, you have to enable the service yourself: sudo systemctl enable postgresql@version-cluster name.
After that, the symlinks are created and you can manage the instance with the service file.
I think I can answer my own question after some: when you create a PG cluster this way, you have to enable the service yourself: sudo systemctl enable postgresql@version-cluster name.
After that, the symlinks are created and you can manage the instance with the service file.
answered Dec 19 at 9:02
Herwig Goemans
13
13
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1100247%2fubuntu-18-04-1-lts-postgres-systemd-service%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown