Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get postgres db host endpoint of existing postgres runnning in cf to use in diego ? #305

Closed
deepakdefender264 opened this issue May 12, 2017 · 7 comments
Labels

Comments

@deepakdefender264
Copy link

deepakdefender264 commented May 12, 2017

I want to use postgres db host endpoint of existing postgres running in cf to use in diego ?
Is there a way to get it. I am using bosh v2 cli and director.

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/145333557

The labels on this github issue will be updated when the story is started.

@emalm
Copy link
Member

emalm commented May 12, 2017

Hi, @deepakdefender264,

The Diego BBS's connection to its SQL database is configured with the BOSH properties under diego.bbs.sql that are listed in the BBS job spec: https://github.com/cloudfoundry/diego-release/blob/v1.15.3/jobs/bbs/spec#L100-L129. If you are using the manifest-generation scripts in the diego-release repository, those can be configured via a stub file passed to the -s argument. As an example, the manifest-generation for BOSH-Lite selects either the MySQL or the Postgres stub file in https://github.com/cloudfoundry/diego-release/blob/v1.15.3/scripts/generate-bosh-lite-manifests#L14-L37, with the Postgres stub file at https://github.com/cloudfoundry/diego-release/blob/v1.15.3/manifest-generation/bosh-lite-stubs/postgres/diego-sql.yml.

If you need to know the values to configure in that stub, you should be able to get those from the existing CF manifest if CC and UAA are using that Postgres instance for their own databases. It may end up being simply a single IP address, in which case you could also get it from the bosh instances output.

Best,
Eric, CF Diego PM

@deepakdefender264
Copy link
Author

Hi @ematpl
Thanks for providing links. Currently I am running CF in only 1 zone and have only 1 postgres sql in our vsphere environment. I can provide postgres_z1 IP address but when I need deploy CF on 2 zones. In that case which address should I provide.
Is there any link which I can use to deploy diego release on vsphere enviroment ? I have cf running on my vsphere env.

@emalm
Copy link
Member

emalm commented May 14, 2017

Hi, @deepakdefender264,

The postgres job in cf-release does not support any sort of clustered deployment, so even if you expand your CF deployment to 2 or more availability zones you'll still only have one instance of that postgres job. You can then continue to supply the IP of that instance as the host for the Diego BBS database connection.

Alternately, the cf-mysql release supports a highly available clustered database deployment that is compatible with the Diego BBS and the other SQL-database-based components in CF. Its proxy instances are capable of being registered as Consul services and hence would be addressable via Consul under a domain name such as mysql.service.cf.internal.

If you are using the manifest-generation script and templates from diego-release, all of the infrastructure-specific configuration will be specified in the "IaaS-settings" stub file that is the argument to the -i flag on the generate-deployment-manifest script. This configuration includes networks and resource pools for the different job types in the generated manifest. An example for BOSH-Lite is located at https://github.com/cloudfoundry/diego-release/blob/v1.15.3/manifest-generation/bosh-lite-stubs/iaas-settings.yml.

Finally, if you are already using the new v2 BOSH CLI, you may be interested in cf-deployment as an alternative to the separate manifest-generation script/template systems in cf-release and diego-release that uses Diego instead of the DEAs and takes advantage of new BOSH features such as cloud-config, links, and variable generation and interpolation. It's not quite ready for all production deployments, but reaching that milestone is the next major goal for the Release Integration team that is responsible for developing it.

Best,
Eric

@mayankkaushik2
Copy link

Hi @ematpl ,
Thanks for the explanation. I got it.
Regarding cf-deployment, can I deploy windows-cells directly to my cf-release instead of going for diego-release first. Currently I am deploying diego-release over cf-release and then will go for windows-garden.

Here I am confused about these values, I am not sure what to do as I am getting errors for pem certs in updating database_z1 vm.
bbs:
active_key_label: key1
encryption_keys:
- label: key1
passphrase: "a secure passphrase"
and what are diego_credentials in property-overrides.yml
Error: Error: 'database_z1/0 (6595b96a-845e-4a4f-b33c-1335e9757054)' is not running after update. Reviewed logs for failed jobs: bbs
goroutine 1 [running]:
panic(0xc14620, 0xc42025e600)
/var/vcap/data/packages/golang/b2f1508f98daf236581e0146f0af18f55b24067e/src/runtime/panic.go:500 +0x1a1
code.cloudfoundry.org/lager.(*logger).Fatal(0xc420156180, 0xd42aa4, 0x18, 0x10e85e0, 0xc42025e600, 0x0, 0x0, 0x0)
/var/vcap/packages/bbs/src/code.cloudfoundry.org/lager/logger.go:152 +0x41c
main.main()
/var/vcap/packages/bbs/src/code.cloudfoundry.org/bbs/cmd/bbs/main.go:235 +0x313f
panic: failed to load keypair: tls: failed to find any PEM data in key input

@deepakdefender264
Copy link
Author

Additional to @mayankkaushik2, we got below error while running diego deploy.
In task error, it is
E, [2017-05-16 16:59:39 #27717] [] ERROR -- DirectorJobRunner: Worker thread raised exception: 'cell_z1/0 (d81b6ec3-0655-4269-9ca3-ef5f621e3e4a)' is not running after update. Review logs for failed jobs: rep - /var/vcap/packages/director/gem_home/ruby/2.3.0/gems/bosh-director-261.4.0/lib/bosh/director/instance_updater/state_applier.rb:48:in `post_start'

In rep errors, we encountered this
{"timestamp":"1494953958.998428106","source":"rep","message":"rep.executor-fetching-containers-to-destroy","log_level":1,"data":{}}
{"timestamp":"1494953959.001061440","source":"rep","message":"rep.executor-fetched-containers-to-destroy","log_level":1,"data":{"num-containers":0}}
{"timestamp":"1494953959.042432547","source":"rep","message":"rep.initial-capacity","log_level":1,"data":{"capacity":{"memory_mb":3951,"disk_mb":6595,"containers":249}}}
{"timestamp":"1494953959.042812347","source":"rep","message":"rep.instance-identity-enabled","log_level":1,"data":{}}
{"timestamp":"1494953959.045436382","source":"rep","message":"rep.failed-to-initialize-executor","log_level":2,"data":{"error":"asn1: structure error: tags don't match (2 vs {class:0 tag:6 length:9 isCompound:false}) {optional:false explicit:false application:false defaultValue:\u003cnil\u003e tag:\u003cnil\u003e stringType:0 timeType:0 set:false omitEmpty:false} @2"}}
{"timestamp":"1494953999.149849415","source":"rep","message":"rep.creating-grpc-client","log_level":1,"data":{"address":"localhost:3458"}}
{"timestamp":"1494953999.152936935","source":"rep","message":"rep.wait-for-garden.ping-garden","log_level":1,"data":{"initialTime:":"2017-05-16T16:59:59.151594178Z","session":"2","wait-time-ns:":1332316}}
{"timestamp":"1494953999.154919863","source":"rep","message":"rep.wait-for-garden.ping-garden-success","log_level":1,"data":{"initialTime:":"2017-05-16T16:59:59.151594178Z","session":"2","wait-time-ns:":3322762}}

Seems interesting error.

@deepakdefender264
Copy link
Author

Resolved, After correcting certificate values, its get resolved

n4wei pushed a commit that referenced this issue Oct 9, 2019
Submodule src/github.com/onsi/ginkgo eea6ad008..d90e0dcda:
  > Add integration test
  > Fix coverage files combining
  > A new CLI option: -ginkgo.reportFile <file path> (#601)
  > v1.10.2
  > speed up table entry generateIt() (#609)
  > Fix. Write errors to stderr instead of stdout (#610)
  > v1.10.1
  > stack backtrace: fix skipping (#600)
  > v1.10.0
  > stack backtrace: fix alignment and skipping
  > fix typo in documentation
  > v1.9.0
  > Fixed typos in comments
  > gofmt code
  > Simplify code
  > Simplify concatenation, incrementation and function assignment
  > Avoid unnecessary conversions
  > JUnit: include more detailed information about panic
  > Option to print output into report, when tests have passed
  > Print help to stdout when the user asks for help
Submodule src/github.com/onsi/gomega 41673fd8f..bdebf9e0e:
  > v1.7.0
  > export format property variables (#347)
  > minor fix in the documentation of ExpectWithOffset (#358)
  > v1.6.0
  > Remove duplication in XML matcher tests
  > Remove unnecessary conversions (#357)
  > Fixed import order (#353)
  > Added missing error handling in test (#355)
  > Simplify code (#356)
  > Simplify code (#354)
  > Fixed typos (#352)
  > Add failure message tests to BeElementOf matcher
  > Update go-testcov untested sections
  > mark all uncovered files so go-testcov ./... works
  > display special chars on error
  > Reenable gotip in travis
  > Add BeElementOf matcher
  > Fix the typo of comment (#345)
  > Optimize contain_element_matcher
  > v1.5.0
  > add analogous tests to fields_test.go
  > added tests for error messages
  > remove redundant validity check
  > ensure error messages refer to the underlying interface, not the `reflect.Value`
  > Run CI on go 1.12 and not 1.9
  > Turn off gotip on travis
  > Mark session_test.go with build tag (#324)
  > more matcher tests
  > try to appease linters
  > MatchKeys
  > Clarify message for unexpected errors
  > make it easy to run everythin that travis would do
  > remove go 1.6, 1.7, 1.8 from the build matrix, and add tip
  > fix lint errors and use type aliases to remove stuttering
  > remove duplication of code and add docs to public function
  > v1.4.3
  > test yaml parser errors and better comment on why panics are there
  > add test for not matcher with errors
  > add test for or matcher with errors
  > add tests for positive failure messages of Panic
  > ensure file name and line numbers are correctly reported
  > Fail the build if gofmt detects any changes required
  > Make changes to satisfy gofmt
  > Move GO111MODULE into more suitable env key in Travis
  > Add coverage for BeZero and Succeed matchers (#307)
  > Fixed matcher for content-type (#305)
  > v1.4.2
  > Refactor goexec build test
  > Updates for Go v1.11 official release
  > Add go.mod and go.sum files to define the gomega go module
  > Work around go vet issue with Go v1.11 (#300)
  > Better output when using with go XUnit-style tests, fixes #255 (#297)
  > Fix MatchJSON fail to parse json.RawMessage (#298)
  > Move funcs shared by MatchJSON and MatchYAML to a dedicated support file
  > Added first failure path matching for YAML (#279)
  > show threshold in failure message of BeNumericallyMatcher (#293)
  > v1.4.1
  > Update documentation (#289)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants