The setup should be correct. In Chef 10, the UI listens on port 4040
and the API listens in port 4000.

Take into account that your Chef Server must be reachable from the
node you are trying to bootstrap. The IPs you provide are private IPs,
so is the Chef server reachable from your node? If you are deploying
it in a cloud provider such as Amazon, those IPs might not be
reachable.

On 9 December 2013 15:11, Jayant Kaushal <[email protected]> wrote:
> Ok. yes got it.
> but another problem.
> My chef Server is running on Port http://192.168.20.66:4000
> notice the port is 4000
> then when it tries to create a client
>
> Chef encountered an error attempting to create the client
> "itappgroup-10.188.175.85"
> ================================================================================
>
>
> Network Error:
> --------------
> There was a network error connecting to the Chef Server:
> Error connecting to http://192.168.20.66:4000/clients - Connection timed
> out - connect(2)
>
>
>
> Relevant Config Settings:
> -------------------------
> chef_server_url  "http://192.168.20.66:4000";
>
> but my chef web ui is being listened on port 4040
> http://192.168.20.66:4000/clients is invalid
> http://192.168.20.66:4040/clients is valid
>
> have i missed something while configuring my chef server.
>
>
> Thanks in advance
>
>
>
> Jayant Kaushal
> +91-9060519860
>
>
> On Mon, Dec 9, 2013 at 6:18 PM, Ignasi Barrera 
> <[email protected]>wrote:
>
>> The line that fails [1] suggests that the validation certificate is
>> missing.
>>
>> The bootstrap process simulates the "knife bootstrap" and it requires
>> the validation certificate, which will allow the node to auto-register
>> in the Chef Server. It must be provided when creating the context.
>> Could you check you are properly setting it?
>>
>> Here is a code example of how to configure it:
>>
>> // Read the validator PEM file
>> String validatorPemFile ="/home/foo/.chef/chef-validator.pem";
>> String validatorCredential = Files.toString(new
>> File(validatorPemFile), Charsets.UTF_8);
>>
>> // Configure the validator properties used to create the context
>> Properties chefConfig = new Properties();
>> chefConfig.put(ChefProperties.CHEF_VALIDATOR_NAME, "chef-validator");
>> chefConfig.put(ChefProperties.CHEF_VALIDATOR_CREDENTIAL,
>> validatorCredential);
>>
>> // Create the context using the configured properties
>> ChefContext context = ContextBuilder.newBuilder("chef") //
>>     .endpoint(endpoint) //
>>     .credentials(client, credential) //
>>     .overrides(chefConfig) //  <-- This is the important line
>>     .buildView(ChefContext.class);
>>
>>
>>
>>
>> [1]
>> https://github.com/jclouds/jclouds-chef/blob/master/core/src/main/java/org/jclouds/chef/functions/GroupToBootScript.java#L93
>>
>> On 9 December 2013 11:56, Jayant Kaushal <[email protected]> wrote:
>> > I tried to bootstrap a node on chef server 10
>> > Statement bootstrap =
>> > chefContext.getChefService().createBootstrapScriptForGroup(chefGroup); //
>> > Build the script that will bootstrap the node
>> >
>> >
>> > this is what i got.
>> >
>> > Optional.get() cannot be called on an absent value
>> > at com.google.common.base.Absent.get(Absent.java:42)
>> > at
>> >
>> org.jclouds.chef.functions.GroupToBootScript.apply(GroupToBootScript.java:93)
>> > at
>> >
>> org.jclouds.chef.internal.BaseChefService.createBootstrapScriptForGroup(BaseChefService.java:173)
>> > at
>> >
>> com.itapp.transports.chef.ChefComputeProducer.updateRunlistAndRunChefClient(ChefComputeProducer.java:224)
>> > at
>> >
>> com.itapp.transports.chef.ChefComputeProducer.process(ChefComputeProducer.java:108)
>>

Reply via email to