Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
Fix Ip mgr ignite misconfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
Liguang Xie committed Jul 13, 2021
1 parent 85de8fb commit d6ed075
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
33 changes: 33 additions & 0 deletions kubernetes/services/ignite_ip_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,42 @@ Copyright(c) 2020 Futurewei Cloud
</bean>
</property>
<property name="storagePath" value="/opt/ip"/>
<property name="walPath" value="/db/wal"/>
<property name="walArchivePath" value="/db/wal/archive"/>
</bean>
</property>

<property name="cacheConfiguration">
<list>
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.privateipmanager.entity.IpAddrAlloc"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.privateipmanager.entity.IpAddrRange"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.privateipmanager.entity.VpcIpRange"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>
</list>
</property>

<!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,12 @@ public SubnetWebJson createSubnetState(@PathVariable String projectId, @RequestB
// Synchronous blocking
CompletableFuture<Void> allFuture = CompletableFuture.allOf(vpcFuture, ipFuture);
allFuture.join();
VpcWebJson vpcResponse = vpcFuture.join();
String ipRangeId = ipFuture.join();

logger.info("Total processing time:" + (System.currentTimeMillis() - start) + "ms");
logger.info("[createSubnetState] Verified VPC id:" + vpcResponse.toString());
logger.info("[createSubnetState] Allocated ip range:" + ipRangeId);
logger.info("[createSubnetState] Time to verify VPC id and allocate ip range:" + (System.currentTimeMillis() - start) + "ms");

this.subnetDatabaseService.addSubnet(inSubnetEntity);

Expand All @@ -270,10 +274,10 @@ public SubnetWebJson createSubnetState(@PathVariable String projectId, @RequestB
}

if (Ipv4AddrUtil.formatCheck(gatewayIp)) {
inSubnetEntity.setIpV4RangeId(ipFuture.join());
inSubnetEntity.setIpV4RangeId(ipRangeId);
inSubnetEntity.setIpVersion(4);
} else {
inSubnetEntity.setIpV6RangeId(ipFuture.join());
inSubnetEntity.setIpV6RangeId(ipRangeId);
inSubnetEntity.setIpVersion(6);
}

Expand Down

1 comment on commit d6ed075

@pkommoju
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make it work from inside Kubernetes, also needs to replace this line:
spec:
serviceAccountName: ignite-alcor-ip
containers:
- name: ignite-alcor-ip-node
image: ignite_alcor:lib8
imagePullPolicy: IfNotPresent
#resources:
#requests:
#cpu: "16"
env:
- name: OPTION_LIBS
value: ignite-kubernetes,ignite-rest-http
- name: CONFIG_URI
value: https://raw.githubusercontent.com/kevin-zhonghao/alcor/xml/kubernetes/services/ignite_ip_config.xml <<>>

in kubernetes/services/ignite_alcor_ip.yaml
with a URL which points to the updated ignite config file:
either https://github.com/futurewei-cloud/alcor/blob/master/kubernetes/services/ignite_config.xml, or a private one but accessible from inside kubernetes.

If PM and MAC are somehow involved in these errors, kubernetes/services/ignite_alcor_mac.yaml and kubernetes/services/ignite_alcor_port.yaml will also need similar modifications (change cache mode to TRANSACTIONAL and the links in these files).

Please sign in to comment.